arXiv is now an independent nonprofit! Learn more
License: arXiv.org perpetual non-exclusive license
arXiv:2008.01704v2 [cs.CR] 16 Nov 2021

Verifying Pufferfish Privacy in Hidden Markov Models

Depeng Liu Affiliation: Institute of Software, Chinese Academy of Sciences, Beijing, China E-mail {liudp,zhanglj}@ios.ac.cn Affiliation: University of Chinese Academy of Sciences, Beijing, China    Bow-Yaw Wang Affiliation: Institute of Information Science, Academia Sinica, Taipei, Taiwan E-mail bywang@iis.sinica.edu.tw    Lijun Zhang Affiliation: Institute of Software, Chinese Academy of Sciences, Beijing, China E-mail {liudp,zhanglj}@ios.ac.cn Affiliation: University of Chinese Academy of Sciences, Beijing, China
Abstract

Pufferfish is a Bayesian privacy framework for designing and analyzing privacy mechanisms. It refines differential privacy, the current gold standard in data privacy, by allowing explicit prior knowledge in privacy analysis. In practice, privacy mechanisms often need be modified or adjusted to specific applications. Their privacy risks have to be re-evaluated for different circumstances. Privacy proofs can thus be complicated and prone to errors. Such tedious tasks are burdensome to average data curators. In this paper, we propose an automatic verification technique for Pufferfish privacy. We use hidden Markov models to specify and analyze discrete mechanisms in Pufferfish privacy. We show that the Pufferfish verification problem in hidden Markov models is NP-hard. Using Satisfiability Modulo Theories solvers, we propose an algorithm to verify privacy requirements. We implement our algorithm in a prototypical tool called FAIER, and analyze several classic privacy mechanisms in Pufferfish privacy. Surprisingly, our analysis show that naïve discretization of well-established privacy mechanisms often fails, witnessed by counterexamples generated by FAIER. In discrete Above Threshold, we show that it results in absolutely no privacy. Finally, we compare our approach with state-of-the-art tools for differential privacy, and show that our verification technique can be efficiently combined with these tools for the purpose of certifying counterexamples and finding a more precise lower bound for the privacy budget ϵ\epsilon.

1 Introduction

Differential privacy is a framework for designing and analyzing privacy measures [16, 17]. In the framework, data publishing mechanisms are formalized as randomized algorithms. On any input data set, such mechanisms return randomized answers to queries. In order to preserve privacy, differential privacy aims to ensure that similar output distributions are yielded on similar input data sets. Differential privacy moreover allows data curators to evaluate privacy and utility quantitatively. The framework has attracted lots of attention from academia and industry such as Microsoft [13] and Apple [2].

Pufferfish is a more recent privacy framework which refines differential privacy [23]. In differential privacy, there is no explicit correlation among entries in data sets during privacy analysis. The no free lunch theorem [22] in data privacy shows that prior knowledge about data sets is crucial to privacy analysis. The Pufferfish privacy framework hence allows data curators to analyze privacy with prior knowledge about data sets. Under the Bayesian privacy framework, it is shown that differential privacy preserves the same level of privacy if there is no correlation among entries in data sets.

For differential and Pufferfish privacy, data publishing mechanisms are analyzed –often on paper– with sophisticated mathematical tools. The complexity of the problem is high [19], and moreover, it is well-known that such proofs are very subtle and error-prone. For instance, several published variations of differentially private mechanisms are shown to violate privacy [11, 25]. In order to minimize proof errors and misinterpretation, the formal method community has also started to develop techniques for checking differentially private mechanisms, such as verification techniques based on approximate couplings [1, 5, 6, 7, 8, 18], randomness alignments [31, 32, 33], model checking [24] as well as those with well-defined programming semantics [3, 26] and techniques based on testing and searching [9, 10, 14, 34].

Reality nevertheless can be more complicated than mathematical proofs. Existing privacy mechanisms hardly fit their data publishing requirements perfectly. These algorithms may be implemented differently when used in practice. Majority of differentially private mechanisms utilize continuous perturbations by applying the Laplace mechanism. Computing devices however only approximate continuous noises through floating-point computation, which is discrete in nature. Care must be taken lest privacy should be lost during such finite approximations [27]. Moreover, adding continuous noises may yield uninterpretable outputs for categorical or discrete numerical data. Discrete noises are hence necessary for such data. A challenging task for data curators is to guarantee that the implementation (discrete in nature) meets the specification (often continuous distributions are used). It is often time consuming – if not impossible, to carry out privacy analysis for each modification. Automated verification and testing techniques are in this case a promising methodology for preserving privacy.

In this work, we take a different approach to solve the problems above. We focus on Pufferfish privacy, and propose a lightweight but automatic verification technique. We propose a formal model for data publishing mechanisms and reduce Pufferfish privacy into a verification problem for hidden Markov models (HMMs). Through our formalization, data curators can verify their specialized privacy mechanisms without going through tedious mathematical proofs.

We have implemented our algorithm in a prototypical tool called FAIER (the pufferFish privAcy verifIER). We consider privacy mechanisms for bounded discrete numerical queries such as counting. For those queries, classical continuous perturbations may give unusable answers or even lose privacy [27]. We hence discretize privacy mechanisms by applying discrete perturbations on such queries. We report case studies derived from differentially private mechanisms. Our studies show that naïve discretization may induce significant privacy risks. For the Above Threshold example, we show that discretization does not have any privacy at all. For this example, our tool generates counterexamples for an arbitrary small privacy budget ϵ\epsilon. Another interesting problem for differential privacy is to find the largest lower bound of ϵ\epsilon, below which the mechanism will not be differentially private. We discuss how our verification approach can be efficiently combined with testing techniques to solve this problem.

Below we summarize the main contributions of our paper:

  1. 1.

    We propose a verification framework for Pufferfish privacy by specifying privacy mechanisms as HMMs and analyzing privacy requirements in the models (Section 4). To our best knowledge, the work of Pufferfish privacy verification had not been investigated before.

  2. 2.

    Then we study the Pufferfish privacy verification problem on HMMs and prove the verification problem to be NP-hard (Section 5.1).

  3. 3.

    On the practical side, nevertheless, using SMT solvers, we design a verification algorithm which automatically verifies Pufferfish privacy (Section 5.2).

  4. 4.

    The verification algorithm is implemented into the tool FAIER (Section 6.1). We then perform case studies of classic mechanisms, such as Noisy Max and Above Threshold. Using our tool, we are able to catch privacy breaches of the specialized mechanisms (Section 6.2  6.3).

  5. 5.

    Compared with the state-of-the-art tools DP-Sniper [10] and StatDP [14] on finding the privacy budget ϵ\epsilon (or finding privacy violations) for differential privacy, our tool has advantageous performances in obtaining the most precise results within acceptable time for discrete mechanisms. We propose to exploit each advantage to the full to efficiently obtain a precise lower bound for the privacy budget ϵ\epsilon (Section 7).

2 Preliminaries

A Markov Chain K=(S,p)K=(S,p) consists of a finite set SS of states and a transition distribution p:S×S[0,1]p:S\times S\rightarrow{[0,1]} such that tSp(s,t)=1\sum_{t\in S}p(s,t)=1 for every sSs\in S. A Hidden Markov Model (HMM) H=(K,Ω,o)H=(K,\Omega,o) is a Markov chain K=(S,p)K=(S,p) with a finite set Ω\Omega of observations and an observation distribution o:S×Ω[0,1]o:S\times\Omega\rightarrow{[0,1]} such that ωΩo(s,ω)=1\sum_{\omega\in\Omega}o(s,\omega)=1 for every sSs\in S. Intuitively, the states of HMMs are not observable. External observers do not know the current state of an HMM. Instead, they have a state distribution (called information state) π:S[0,1]\pi:S\rightarrow[0,1] with sSπ(s)=1\sum_{s\in S}\pi(s)=1 to represent the likelihood of each state in an HMM.

Let H=((S,p),Ω,o)H=((S,p),\Omega,o) be an HMM and π\pi an initial state distribution. The HMM HH can be seen as a (randomized) generator for sequences of observations. The following procedure generates observation sequences of an arbitrary length:

  1. 1.

    t0t\leftarrow 0.

  2. 2.

    Choose an initial state s0Ss_{0}\in S by the initial state distribution π\pi.

  3. 3.

    Choose an observation ωt\omega_{t} by the observation distribution o(st,)o(s_{t},\bullet).

  4. 4.

    Choose a next state st+1s_{t+1} by the transition distribution p(st,)p(s_{t},\bullet).

  5. 5.

    tt+1t\leftarrow t+1 and go to 3.

Given an observation sequence ω¯=ω0ω1ωk\overline{\omega}=\omega_{0}\omega_{1}\cdots\omega_{k} and a state sequence s¯=s0s1sk\overline{s}=s_{0}s_{1}\cdots s_{k}, it is not hard to compute the probability of observing ω¯\overline{\omega} along s¯\overline{s} on an HMM H=((S,p),Ω,o)H=((S,p),\Omega,o) with an initial state distribution π\pi. Precisely,

Pr(ω¯,s¯|H)=Pr(ω¯|s¯,H)×Pr(s¯,H)\displaystyle\Pr(\overline{\omega},\overline{s}|H)=\Pr(\overline{\omega}|\overline{s},H)\times\Pr(\overline{s},H)
=[o(s0,ω0)o(sk,ωk)]×[π(s0)p(s0,s1)p(sk1,sk)]\displaystyle=[o(s_{0},\omega_{0})\!\cdots\!o(s_{k},\omega_{k})]\!\times\![\pi(s_{0})p(s_{0},s_{1})\!\cdots\!p(s_{k-1},s_{k})]
=π(s0)o(s0,ω0)p(s0,s1)p(sk1,sk)o(sk,ωk).\displaystyle=\pi(s_{0})o(s_{0},\omega_{0})\cdot p(s_{0},s_{1})\!\cdots\!p(s_{k-1},s_{k})o(s_{k},\omega_{k}). (1)

Since state sequences are not observable, we are interested in the probability Pr(ω¯|H)\Pr(\overline{\omega}|H) for a given observation sequence ω¯\overline{\omega}. Using (1), we have Pr(ω¯|H)=s¯Sk+1Pr(ω¯,s¯|H)\Pr(\overline{\omega}|H)=\sum_{\overline{s}\in S^{k+1}}\Pr(\overline{\omega},\overline{s}|H). But the summation has |S|k+1|S|^{k+1} terms and is hence inefficient to compute. An efficient algorithm is available to compute the probability αt(s)\alpha_{t}(s) for the observation sequence ω0ω1ωt\omega_{0}\omega_{1}\cdots\omega_{t} with the state ss at time tt [30]. Consider the following definition:

α0(s)\displaystyle\alpha_{0}(s) =π(s)o(s,ω0)\displaystyle=\pi(s)o(s,\omega_{0}) (2)
αt+1(s)\displaystyle\alpha_{t+1}(s^{\prime}) =[sSαt(s)p(s,s)]o(s,ωt+1).\displaystyle=\left[\sum_{s\in S}\alpha_{t}(s)p(s,s^{\prime})\right]o(s^{\prime},\omega_{t+1}). (3)

Informally, α0(s)\alpha_{0}(s) is the probability that the initial state is ss with the observation ω0\omega_{0}. By induction, αt(s)\alpha_{t}(s) is the probability that the tt-th state is ss with the observation sequence ω0ω1ωt\omega_{0}\omega_{1}\cdots\omega_{t}. The probability of observing ω¯=ω0ω1ωk\overline{\omega}=\omega_{0}\omega_{1}\cdots\omega_{k} is therefore the sum of probabilities of observing ω¯\overline{\omega} over all states ss. Thus Pr(ω¯|H)=sSαk(s)\Pr(\overline{\omega}|H)=\sum_{s\in S}\alpha_{k}(s).

3 Pufferfish Privacy Framework

Differential privacy is a privacy framework for design and analysis of data publishing mechanisms [16]. Let 𝒳\mathcal{X} denote the set of data entries. A data set of size nn is an element in 𝒳n\mathcal{X}^{n}. Two data sets 𝐝¯,𝐝¯𝒳n\overline{\mathbf{d}},\overline{\mathbf{d}}^{\prime}\in\mathcal{X}^{n} are neighbors (written Δ(𝐝¯,𝐝¯)1\Delta(\overline{\mathbf{d}},\overline{\mathbf{d}}^{\prime})\leq 1) if 𝐝¯\overline{\mathbf{d}} and 𝐝¯\overline{\mathbf{d}}^{\prime} are identical except for at most one data entry. A data publishing mechanism (or simply mechanism) \mathcal{M} is a randomized algorithm which takes a data set 𝐝¯\overline{\mathbf{d}} as inputs. A mechanism satisfies ϵ\epsilon-differential privacy if its output distributions differ by at most the multiplicative factor eϵe^{\epsilon} on every neighboring data sets.

Definition 1

Let ϵ0\epsilon\geq 0. A mechanism \mathcal{M} is ϵ\epsilon-differentially private if for all rrange()r\in\textmd{range}(\mathcal{M}) and data sets 𝐝¯,𝐝¯𝒳n\overline{\mathbf{d}},\overline{\mathbf{d}}^{\prime}\in\mathcal{X}^{n} with Δ(𝐝¯,𝐝¯)1\Delta(\overline{\mathbf{d}},\overline{\mathbf{d}}^{\prime})\leq 1, we have Pr((𝐝¯)=r)eϵPr((𝐝¯)=r).\Pr(\mathcal{M}(\overline{\mathbf{d}})=r)\leq e^{\epsilon}\Pr(\mathcal{M}(\overline{\mathbf{d}}^{\prime})=r).

Intuitively, ϵ\epsilon-differential privacy ensures similar output distributions on similar data sets. Limited differential information about each data entry is revealed and individual privacy is hence preserved. Though, differential privacy makes no assumption nor uses any prior knowledge about data sets. For data sets with correlated data entries, differential privacy may reveal too much information about individuals. Consider, for instance, a data set of family members. If a family member has contracted a highly contagious disease, all family are likely to have the same disease. In order to decide whether a specific family member has contracted the disease, it suffices to determine whether any member has the disease. It appears that specific information about an individual can be inferred from differential information when data entries are correlated. Differential privacy may be ineffective to preserve privacy in such circumstances [22].

Pufferfish is a Bayesian privacy framework which refines differential privacy. Theorem 6.1 in [23] shows how to define differential privacy equivalently in Pufferfish framework. In Pufferfish privacy, a random variable 𝐃¯\overline{\mathbf{D}} represents a data set drawn from a distribution θ𝔻\theta\in\mathbb{D}. The set 𝔻\mathbb{D} of distributions formalizes prior knowledge about data sets, such as whether data entries are independent or correlated. Moreover, a set 𝕊\mathbb{S} of secrets and a set 𝕊pairs𝕊×𝕊\mathbb{S}_{\textmd{pairs}}\subseteq\mathbb{S}\times\mathbb{S} of discriminative secret pairs formalize the information to be protected. A mechanism \mathcal{M} satisfies ϵ\epsilon-Pufferfish privacy if its output distributions differ by at most the multiplicative factor eϵe^{\epsilon} when conditioned on all the secret pairs.

Definition 2

Let 𝕊\mathbb{S} be a set of secrets, 𝕊pairs𝕊×𝕊\mathbb{S}_{\textmd{pairs}}\subset\mathbb{S}\times\mathbb{S} a set of discriminative secret pairs, 𝔻\mathbb{D} a set of data set distributions scenarios, and ϵ0\epsilon\geq 0, a mechanism \mathcal{M} is ϵ\epsilon-Pufferfish private if for all rrange()r\in\textmd{range}(\mathcal{M}), (si,sj)𝕊pairs(s_{i},s_{j})\in\mathbb{S}_{\textmd{pairs}}, θ𝔻\theta\in\mathbb{D} with Pr(si|θ)0\Pr(s_{i}|\theta)\neq 0 and Pr(sj|θ)0\Pr(s_{j}|\theta)\neq 0, we have

Pr((𝐃¯)=r|si,θ)eϵPr((𝐃¯)=r|sj,θ)\Pr(\mathcal{M}(\overline{\mathbf{D}})=r|s_{i},\theta)\leq e^{\epsilon}\Pr(\mathcal{M}(\overline{\mathbf{D}})=r|s_{j},\theta)

where 𝐃¯\overline{\mathbf{D}} is a random variable with the distribution θ\theta.

In the definition, Pr(si|θ)0\Pr(s_{i}|\theta)\neq 0 and Pr(sj|θ)0\Pr(s_{j}|\theta)\neq 0 ensure the probabilities Pr((𝐃¯)CLOSE\Pr(\mathcal{M}(\overline{\mathbf{D}}) == OPENr|si,θ)r|s_{i},\theta) and Pr((𝐃¯)=r|sj,θ)\Pr(\mathcal{M}(\overline{\mathbf{D}})=r|s_{j},\theta) are defined. Hence Pr((𝐃¯)=r|s,θ)\Pr(\mathcal{M}(\overline{\mathbf{D}})=r|s,\theta) is the probability of observing rr conditioned on the secret ss and the data set distribution θ\theta. Informally, ϵ\epsilon-Pufferfish privacy ensures similar output distributions on discriminative secrets and prior knowledge. Since limited information is revealed from prior knowledge, each pair of discriminative secrets is protected.

4 Geometric Mechanism as Hidden Markov Model

We first recall in Section 4.1 the definition of geometric mechanism, a well-known discrete mechanism for differential privacy. In Section 4.2, we then recall an example exploiting Markov chains to model geometric mechanisms, followed by our modeling formalism and Pufferfish privacy analysis using HMMs in Section 4.3.

4.1 Geometric Mechanism

Consider a simple data set with only two data entries. Each entry denotes whether an individual has a certain disease. Given such a data set, we wish to know how many individuals contract the disease in the data set. More generally, a counting query returns the number of entries satisfying a given predicate in a data set 𝐝¯𝒳n\overline{\mathbf{d}}\in\mathcal{X}^{n}. The number of individuals contracting the disease in a data set is hence a counting query. Note that the difference of counting query results on neighboring data sets is at most 11.

Counting queries may reveal sensitive information about individuals. For instance, suppose we know John’s record is in the data set. We immediately infer that John has contracted the disease if the query answer is 22. In order to protect privacy, several mechanisms are designed to answer counting queries.

Consider a counting query f:𝒳n{0,1,,n}f:\mathcal{X}^{n}\rightarrow\{0,1,\ldots,n\}. Let α(0,1)\alpha\in(0,1). The α\alpha-geometric mechanism 𝒢f\mathcal{G}_{f} for the counting query ff on the data set 𝐝¯\overline{\mathbf{d}} outputs f(𝐝¯)+Yf(\overline{\mathbf{d}})+Y on a data set 𝐝¯\overline{\mathbf{d}} where YY is a random variable with the geometric distribution [20, 21]: Pr[Y=y]=1α1+αα|y| for y\Pr[Y=y]=\frac{1-\alpha}{1+\alpha}\alpha^{|y|}\textmd{ for }y\in\mathbb{Z}. For any neighboring data sets 𝐝¯,𝐝¯𝒳n\overline{\mathbf{d}},\overline{\mathbf{d}}^{\prime}\in\mathcal{X}^{n}, recall that |f(𝐝¯)f(𝐝¯)|1|f(\overline{\mathbf{d}})-f(\overline{\mathbf{d}}^{\prime})|\leq 1. If f(𝐝¯)=f(𝐝¯)f(\overline{\mathbf{d}})=f(\overline{\mathbf{d}}^{\prime}), the α\alpha-geometric mechanism has the same output distribution for ff on 𝐝¯\overline{\mathbf{d}} and 𝐝¯\overline{\mathbf{d}}^{\prime}. If |f(𝐝¯)f(𝐝¯)|=1|f(\overline{\mathbf{d}})-f(\overline{\mathbf{d}}^{\prime})|=1, it is easy to conclude that Pr(𝒢f(𝐝¯)=r)elnαPr(𝒢f(𝐝¯)=r)\Pr(\mathcal{G}_{f}(\overline{\mathbf{d}})=r)\leq e^{-\ln\alpha}\Pr(\mathcal{G}_{f}(\overline{\mathbf{d}}^{\prime})=r) for any neighboring 𝐝¯,𝐝¯\overline{\mathbf{d}},\overline{\mathbf{d}}^{\prime} and rr\in\mathbb{Z}. The α\alpha-geometric mechanism is lnα-\ln\alpha-differentially private for any counting query ff. To achieve ϵ\epsilon-differential privacy, one simply chooses α=eϵ\alpha=e^{-{\epsilon}}.

The range of the geometric mechanism is \mathbb{Z}. It may give nonsensical outputs such as negative integers for non-negative queries. The truncated α\alpha-geometric mechanism over {0,1,,n}\{0,1,\ldots,n\} outputs f(𝐝¯)+Zf(\overline{\mathbf{d}})+Z where ZZ is a random variable with the distribution:

Pr[Z=z]={0 if z<f(x)αf(x)1+α if z=f(x)1α1+αα|z| if f(x)<z<nf(x)αnf(x)1+α if z=nf(x)0 if z>nf(x)\Pr[Z=z]=\left\{\begin{array}[]{ll}0&\textmd{ if }z<-f(x)\\ \vskip 2.15277pt\frac{\alpha^{f(x)}}{1+\alpha}&\textmd{ if }z=-f(x)\\ \vskip 2.15277pt\frac{1-\alpha}{1+\alpha}\alpha^{|z|}&\textmd{ if }-f(x)<z<n-f(x)\\ \vskip 2.15277pt\frac{\alpha^{n-f(x)}}{1+\alpha}&\textmd{ if }z=n-f(x)\\ 0&\textmd{ if }z>n-f(x)\end{array}\right.

Note the range of the truncated α\alpha-geometric mechanism is {0,1,,n}\{0,1,\ldots,n\}. The truncated α\alpha-geometric mechanism is also lnα-\ln\alpha-differentially private for any counting query ff. We will study several examples of this mechanism to get a better understanding of Pufferfish privacy and how we use models to analyze it.

4.2 Differential Privacy Using Markov Chains

We present a simple example taking from [24], slightly adapted for analyzing different models, i.e., the Markov chain and the hidden Markov model.

output0~1~2~𝑖𝑛𝑝𝑢𝑡02/31/61/611/31/31/321/61/62/3\begin{array}[]{c|c|c|c|c|}\hfil\hfil\lx@intercol&\lx@intercol\hfil output\hfil\lx@intercol\\ \cline{2-5}\cr&&\tilde{0}&\tilde{1}&\tilde{2}\\ \cline{2-5}\cr\hbox{\multirowsetup\rotatebox{90.0}{$\mathit{input}$}}&0&{2}/{3}&{1}/{6}&{1}/{6}\\ \cline{2-5}\cr&1&{1}/{3}&{1}/{3}&{1}/{3}\\ \cline{2-5}\cr&2&{1}/{6}&{1}/{6}&{2}/{3}\\ \cline{2-5}\cr\end{array}
(a) 12\frac{1}{2}-Geometric Mechanism
00 11 22 0~{\tilde{0}} 1~{\tilde{1}} 2~{\tilde{2}} 16\frac{1}{6} 13\frac{1}{3} 23\frac{2}{3}
(b) Markov Chain
00 2/3:0~\tilde{0}1/6:1~\tilde{1}1/6:2~\tilde{2}11 1/3:0~\tilde{0}1/3:1~\tilde{1}1/3:2~\tilde{2}22 1/6:0~\tilde{0}1/6:1~\tilde{1}2/3:2~\tilde{2}
(c) Hidden Markov Model
Figure 1: Truncated 12\frac{1}{2}-Geometric Mechanism
Example 1

To see how differential privacy works, consider the truncated 12\frac{1}{2}-geometric mechanism (Fig. 1(a)). In the table, we consider a counting query f:𝒳2{0,1,2}f:\mathcal{X}^{2}\rightarrow\{0,1,2\}. For any data set 𝐝¯\overline{\mathbf{d}}, the mechanism outputs jj when f(𝐝¯)=if(\overline{\mathbf{d}})=i with probability indicated at the (i,j)(i,j)-entry in the table. For instance, the mechanism outputs 0~\tilde{0}, 1~\tilde{1}, and 2~\tilde{2} with probabilities 23\frac{2}{3}, 16\frac{1}{6}, and 16\frac{1}{6} respectively when f(𝐝¯)=0f(\overline{\mathbf{d}})=0.

Let ff be the query counting the number of individuals contracting a disease. Consider a data set 𝐝¯\overline{\mathbf{d}} whose two members (including John) have contracted the disease. The number of individuals contracting the disease is 22 and hence f(𝐝¯)=2f(\overline{\mathbf{d}})=2. From the table in Fig. 1(a), we see the mechanism answers 0~\tilde{0}, 1~\tilde{1}, and 2~\tilde{2} with probabilities 16\frac{1}{6}, 16\frac{1}{6}, and 23\frac{2}{3} respectively. Suppose we obtain another data set 𝐝¯\overline{\mathbf{d}}^{\prime} by replacing John with an individual who does not contract the disease. The number of individuals contracting the disease for the new data set is 11 and thus f(𝐝¯)=1f(\overline{\mathbf{d}}^{\prime})=1. Then, the mechanism answers 0~\tilde{0}, 1~\tilde{1}, and 2~\tilde{2} with the probability 13\frac{1}{3}.

The probabilities of observing 0~\tilde{0} on the data sets 𝐝¯\overline{\mathbf{d}} and 𝐝¯\overline{\mathbf{d}}^{\prime} are respectively 16\frac{1}{6} and 13\frac{1}{3}. They differ by the multiplicative factor 22. For other outputs, their observation probabilities are also bounded by the same factor. The truncated 12\frac{1}{2}-geometric mechanism is hence ln(2)\ln(2)-differentially private.

In order to formally analyze privacy mechanisms, we specify them as probabilistic models. Fig. 1(b) shows a Markov chain for the truncated 12\frac{1}{2}-geometric mechanism. We straightly turn inputs and outputs of the table in Fig. 1(a) into states of the Markov chain and output probabilities into transition probabilities. In the figure, thin arrows denote transitions with probability 16\frac{1}{6}; medium arrows denote transitions with probability 13\frac{1}{3}; thick arrows denote transitions with probability 23\frac{2}{3}. For instance, state 00 can transit to state 0~\tilde{0} with probability 23\frac{2}{3} while it can transit to the state 1~\tilde{1} with probability 16\frac{1}{6}. \blacksquare

The Markov chain model is straightforward but can become hazy for complicated privacy mechanism. We next discuss how to use an HMM to model the mechanism.

4.3 Pufferfish Privacy Using Hidden Markov Models

We denote data sets as states and possible outputs of the mechanism are denoted by observations. The transition distribution stimulates the randomized privacy mechanism performed on data sets. Distributions of data sets are denoted by initial information states. Privacy analysis can then be performed by comparing observation probabilities from the two initial information states. We illustrate the ideas in examples.

Example 2

Fig. 1(c) gives an HMM for the truncated 12\frac{1}{2}-geometric mechanism. For any counting query ff from 𝒳2\mathcal{X}^{2} to {0,1,2}\{0,1,2\}, it suffices to represent each 𝐝¯𝒳2\overline{\mathbf{d}}\in\mathcal{X}^{2} by f(𝐝¯)f(\overline{\mathbf{d}}) because the mechanism only depends on f(𝐝¯)f(\overline{\mathbf{d}}). The order of entries, for instance, is irrelevant to the mechanism. We hence have the states 00, 11 and 22 denoting the set {f(𝐝¯):𝐝¯𝒳2}\{f(\overline{\mathbf{d}}):\overline{\mathbf{d}}\in\mathcal{X}^{2}\} in the figure. Let {0~,1~,2~}\{\tilde{0},\tilde{1},\tilde{2}\} be the set of observations. We encode output probabilities into observation probabilities at states. At state 00, for instance, 0~\tilde{0}, 1~\tilde{1}, 2~\tilde{2} can all be observed with probability 23\frac{2}{3}, 16\frac{1}{6}, 16\frac{1}{6} respectively. It is obvious that the number of states are reduced by half compared with the Markov chain. Generally, HMMs allow multiple observations to show at one single state, which leads to smaller models.

Fix an order for states, say, 0,1,20,1,2. An information state can be represented by an element in [0,1]3[0,1]^{3}. In differential privacy, we would like to analyze probabilities of every observation from neighboring data sets. For counting queries, neighboring data sets can change query results by at most 11. Let 𝐝¯\overline{\mathbf{d}} be a data set. Consider the initial information state π=(0,0,1)\pi=(0,0,1) corresponding to f(𝐝¯)=2f(\overline{\mathbf{d}})=2. For any neighbor 𝐝¯\overline{\mathbf{d}}^{\prime} of 𝐝¯\overline{\mathbf{d}}, we have f(𝐝¯)=2f(\overline{\mathbf{d}}^{\prime})=2 or f(𝐝¯)=1f(\overline{\mathbf{d}}^{\prime})=1. It suffices to consider corresponding information states π\pi or τ=(0,1,0)\tau=(0,1,0). Let’s compare the probability of observing ω=1~\omega=\tilde{1} from information states π\pi and τ\tau. Starting from π\pi, we have α0=π\alpha_{0}=\pi and probabilities of 16\frac{1}{6}, 13\frac{1}{3} and 16\frac{1}{6} respectively observing 1~\tilde{1} at each state. So the probability of observing ω\omega is 16\frac{1}{6}. On the other hand, we have α0=τ\alpha_{0}=\tau and the probability of observing ω\omega is 13\frac{1}{3}. Similarly, one can easily check the probabilities of observing 0~\tilde{0} and 2~\tilde{2} on any neighboring data sets and the ratio of one probability over the other one under the same observation will not be more than 22. \hfill\blacksquare

Differential privacy provides a framework for quantitative privacy analysis. The framework ensures similar output distributions regardless of the information about an arbitrary individual. In other words, if an attacker gets certain prior knowledge about the data sets, chances are that differential privacy will underestimate privacy risks. Since all data entries are correlated, replacing one data entry does not yield feasible data sets with correlated entries. Consequently, it is questionable to compare output distributions on data sets differing in only one entry. Instead, this is the scenario where Pufferfish privacy should be applied.

Example 3

Consider a data set about contracting a highly contagious disease containing John and a family member he lives with. An attacker wishes to know if John has contracted the disease. Since the data set keeps information on the contagious disease about two family members, an attacker immediately deduces that the number of individuals contracting the disease can only be 00 or 22. The attacker hence can infer whether John has the disease by counting the number of individuals contracting the disease.

Suppose a data curator tries to protect John’s privacy by employing the truncated 12\frac{1}{2}-geometric mechanism (Fig. 1). We analyze this mechanism formally in the Pufferfish framework. Let the set of data entries 𝒳={0,1}\mathcal{X}=\{0,1\} and there are four possible data sets in 𝒳2\mathcal{X}^{2}. For any 0<p<10<p<1, define the data set distribution θp:𝒳2[0,1]\theta_{p}:\mathcal{X}^{2}\rightarrow[0,1] as follows. θp(0,0)=1p\theta_{p}(0,0)=1-p, θp(1,1)=p\theta_{p}(1,1)=p, and θp(0,1)=θp(1,0)=0\theta_{p}(0,1)=\theta_{p}(1,0)=0. Consider the distribution set 𝔻={θp:0<p<1}\mathbb{D}=\{\theta_{p}:0<p<1\}. Note that infeasible data sets are not in the support of θp\theta_{p}.

Assume John’s entry is in the data set. Define the set of secrets 𝕊={c,nc}\mathbb{S}=\{c,nc\} where cc denotes that John has contracted the disease and ncnc denotes otherwise. Our set of discriminative secret pairs 𝕊pairs\mathbb{S}_{\textmd{pairs}} is {(c,nc),(nc,c)}\{(c,nc),(nc,c)\}. That is, we would like to compare probabilities of all outcomes when John has the disease or not.

When John has not contracted the disease, the only possible data set is (0,0)(0,0) by the distribution θp\theta_{p}. The probability of observing 0~\tilde{0} therefore is 23\frac{2}{3} (Fig. 1(a)). When John has the disease, the data set (0,0)(0,0) is not possible under the condition of the secret and the distribution θp\theta_{p}. The only possible data set is (1,1)(1,1). The probability of observing 0~\tilde{0} is 16\frac{1}{6}. Now we have 23=Pr(𝒢f(𝐃¯)=0~|nc,θp)2×16=2×Pr(𝒢f(𝐃¯)=0~|c,θp).\frac{2}{3}=\Pr(\mathcal{G}_{f}(\overline{\mathbf{D}})=\tilde{0}|nc,\theta_{p})\not\leq 2\times\frac{1}{6}=2\times\Pr(\mathcal{G}_{f}(\overline{\mathbf{D}})=\tilde{0}|c,\theta_{p}). We conclude the truncated 12\frac{1}{2}-geometric mechanism does not conform to ln(2)\ln(2)-Pufferfish privacy. Instead, it satisfies ln(4)\ln(4)-Pufferfish privacy. \hfill\blacksquare

Table 1: Pufferfish Analysis of 12\frac{1}{2}-Geometric Mechanism
Data Sets\Observations0~1~2~without John’s recordp24p+462p2+2p+16p2+2p+16with John’s record43p126p43p126p263p\begin{array}[]{|c|c|c|c|}\hline\cr\textmd{Data Sets$\backslash$Observations}&\tilde{0}&\tilde{1}&\tilde{2}\\ \hline\cr\textmd{without John's record}&\frac{p^{2}-4p+4}{6}&\frac{-2p^{2}+2p+1}{6}&\frac{p^{2}+2p+1}{6}\\ \hline\cr\textmd{with John's record}&\frac{4-3p}{12-6p}&\frac{4-3p}{12-6p}&\frac{2}{6-3p}\\ \hline\cr\end{array}

With the formal model (Fig. 1(c)), it is easy to perform privacy analysis in the Pufferfish framework. More precisely, the underlying Markov chain along with observation distribution specify the privacy mechanism on input data sets. Prior knowledge about data sets is nothing but distributions of them. Since data sets are represented by various states, prior knowledge is naturally formalized as initial information states in HMMs. For Pufferfish privacy analysis, we again compare observation probabilities from initial information states conditioned on secret pairs. The standard algorithm for HMMs allows us to perform more refined privacy analysis. Besides, it is interesting to observe the striking similarity between the Pufferfish privacy framework and HMMs. In both cases, input data sets are unknown but specified by distributions. Information can only be released by observations because inputs and hence computation are hidden from external attackers or observers. Pufferfish privacy analysis with prior knowledge is hence closely related to observation probability analysis from information states. Such similarities can easily be identified in the examples.

Example 4

Consider a non-contagious disease. An attacker may know that contracting the disease is an independent event with probability pp. Even though the attacker does not know how many individuals have the disease exactly, he infers that the number of individuals contracting the disease is 00, 11, and 22 with probabilities (1p)2(1-p)^{2}, 2p(1p)2p(1-p), and p2p^{2} respectively. The prior knowledge corresponds to the initial information state π=((1p)2,2p(1p),p2)\pi=((1-p)^{2},2p(1-p),p^{2}) in Fig. 1(c). Assume John has contracted the disease. We would like to compare probabilities of observations 0~\tilde{0}, 1~\tilde{1}, and 2~\tilde{2} given the prior knowledge and the presence or absence of John’s record.

Suppose John’s record is indeed in the data set. Since John has the disease, the number of individuals contracting the disease cannot be 00. By the prior knowledge, one can easily obtain the initial information state π=(0CLOSE\pi=(0, 2p(1p)2p(1p)+p2\frac{2p(1-p)}{2p(1-p)+p^{2}}, p22p(1p)+p2\frac{p^{2}}{2p(1-p)+p^{2}}) = (00, 22p2p\frac{2-2p}{2-p}, OPENp2p)\frac{p}{2-p}). If John’s record is not in the data set, the initial information state remains as τ=((1p)2,2p(1p),p2)\tau=((1-p)^{2},2p(1-p),p^{2}). Then one can compute all the observation probabilities starting from π\pi and τ\tau respectively, which are summarized in Table 1:

For the observation 0~\tilde{0}, it is not hard to check 12×43p126pp24p+462×43p126p\frac{1}{2}\times\frac{4-3p}{12-6p}\leq\frac{p^{2}-4p+4}{6}\leq 2\times\frac{4-3p}{12-6p} for any 0<p<10<p<1. Similarly, we have 12×43p126p2p2+2p+162×43p126p\frac{1}{2}\times\frac{4-3p}{12-6p}\leq\frac{-2p^{2}+2p+1}{6}\leq 2\times\frac{4-3p}{12-6p} and 12×263pp2+2p+162×263p\frac{1}{2}\times\frac{2}{6-3p}\leq\frac{p^{2}+2p+1}{6}\leq 2\times\frac{2}{6-3p} for observations 1~\tilde{1} and 2~\tilde{2} respectively. Therefore, the truncated 12\frac{1}{2}-geometric mechanism satisfies ln(2)\ln(2)-Pufferfish privacy when contracting the disease is independent. \hfill\blacksquare

The above example demonstrates that certain prior knowledge, such as independence of data entries, is indeed not harmful to privacy under the Pufferfish framework. In [23], it is shown that differential privacy is subsumed by Pufferfish privacy (Theorem 6.1) under independence assumptions. The above example is also an instance of the general theorem but formalized in an HMM.

5 Pufferfish Privacy Verification

In this section, we formally define the verification problem for Pufferfish privacy and give the computation complexity results in Section 5.1. Then we propose an algorithm to solve the problem in Section 5.2.

5.1 Complexity of Pufferfish Privacy Problem

We model the general Pufferfish privacy problems into HMMs and the goal is to check whether the privacy is preserved. First, we define the Pufferfish verification problem:

Definition 3

Given a set of secrets 𝕊\mathbb{S}, a set of discriminative secret pairs 𝕊pairs\mathbb{S}_{\textmd{pairs}}, a set of data evolution scenarios 𝔻\mathbb{D} , ϵ>0\epsilon>0, along with mechanism \mathcal{M} in a hidden Markov model H=(K,Ω,o)H=(K,\Omega,o), where probability distributions are all discrete. Deciding whether \mathcal{M} satisfies ϵ\epsilon-Pufferfish privacy under (𝕊CLOSE(\mathbb{S}, 𝕊pairs\mathbb{S}_{\textmd{pairs}}, OPEN𝔻)\mathbb{D}) is the Pufferfish verification problem.

The modeling intuition for HH is to use states and transitions to model the data sets and operations in the mechanism \mathcal{M}, obtain initial distribution pairs according to prior knowledge 𝔻\mathbb{D} and discriminative secrets 𝕊pairs\mathbb{S}_{\textmd{pairs}}, and set outputs as observations in states. Then the goal turns into checking whether the probabilities under the same observation sequence are mathematically similar, i.e., differ by at most the multiplicative factor eϵe^{\epsilon}, for every distribution pair and every observation sequence. Therefore, our task is to find the observation sequence and distribution pair that make the observing probabilities differ the most. That is, in order to satisfy Pufferfish privacy, for every observation sequence ω¯=ω1ω2\overline{\omega}=\omega_{1}\omega_{2}\ldots, secret pair (si,sj)𝕊pairs(s_{i},s_{j})\in\mathbb{S}_{\textmd{pairs}} and θ𝔻\theta\in\mathbb{D}, one should have

maxω¯,(si,sj),θPr((𝐃¯)=ω¯|si,θ)eϵPr((𝐃¯)=ω¯|sj,θ)\max_{\overline{\omega},(s_{i},s_{j}),\theta}{\Pr(\mathcal{M}(\overline{\mathbf{D}})=\overline{\omega}|s_{i},\theta)-e^{\epsilon}\Pr(\mathcal{M}(\overline{\mathbf{D}})=\overline{\omega}|s_{j},\theta)} (4)
maxω¯,(si,sj),θPr((𝐃¯)=ω¯|sj,θ)eϵPr((𝐃¯)=ω¯|si,θ)\max_{\overline{\omega},(s_{i},s_{j}),\theta}{\Pr(\mathcal{M}(\overline{\mathbf{D}})=\overline{\omega}|s_{j},\theta)-e^{\epsilon}\Pr(\mathcal{M}(\overline{\mathbf{D}})=\overline{\omega}|s_{i},\theta)} (5)

no more than 00. However, by showing a reduction from the classic Boolean Satisfiability Problem [29], this problem is proved to be NP-hard (in Appendix 1 ):

Theorem 5.1

The Pufferfish verification problem is NP-hard.

To the best of our knowledge, this is the first complexity result for the Pufferfish verification problem. Note that differential privacy is subsumed by Pufferfish privacy. Barthe et al. [3] show undecidability results for differential privacy mechanisms with continuous noise. Instead, we focus on Pufferfish privacy with discrete state space in HMMs. The complexity bound is lower if more simple models such as Markov chains are used. However some discrete mechanisms in differential privacy, such as Above Threshold, can hardly be modeled in Markov chains [24].

5.2 Verifying Pufferfish Privacy

Given the complexity lower bound in the previous section, next goal is to develop an algorithm to verify ϵ\epsilon-Pufferfish privacy on any given HMM. We employ Satisfiability Modulo Theories (SMT) solvers in our algorithm. For all observation sequences of length kk, we will construct an SMT query to find a sequence violating ϵ\epsilon-Pufferfish privacy. If no such sequence can be found, the given HMM satisfies ϵ\epsilon-Pufferfish privacy for all observation sequences of length kk.

1: H=((S,p),Ω,o)H=((S,p),\Omega,o): a hidden Markov model; π,τ\pi,\tau: state distributions on SS; cc: a non-negative real number; kk: a positive integer
2: An SMT query qq such that qq is unsatisfiable iff Pr(ω¯|π,H)cPr(ω¯|τ,H)\Pr(\overline{\omega}|\pi,H)\leq c\cdot\Pr(\overline{\omega}|\tau,H) for every observation sequences ω¯\overline{\omega} of length kk
3: function PufferfishCheck(HH, π0\pi_{0}, π1\pi_{1}, cc, kk)
4:   for sSs\in S do
5:    α0(s)Product(π(s),Select(𝗐𝟢,Ω,o(s,)))\alpha_{0}(s)\leftarrow\textmd{{Product}}(\pi(s),\textmd{{Select}}(\mathsf{w_{0}},\Omega,o(s,\bullet)))
6:    β0(s)Product(τ(s),Select(𝗐𝟢,Ω,o(s,)))\beta_{0}(s)\leftarrow\textmd{{Product}}(\tau(s),\textmd{{Select}}(\mathsf{w_{0}},\Omega,o(s,\bullet)))   
7:   for t1t\leftarrow 1 to k1k-1 do
8:    for sSs^{\prime}\in S do
9:      αt(s)Product(Dot(αt1,p(,s)),Select(𝗐𝗍,Ω,o(s,)))\alpha_{t}(s^{\prime})\leftarrow\textmd{{Product}}(\textmd{{Dot}}(\alpha_{t-1},p(\bullet,s^{\prime})),\newline \indent\indent\textmd{{Select}}(\mathsf{w_{t}},\Omega,o(s^{\prime},\bullet)))
10:      βt(s)Product(Dot(βt1,p(,s)),Select(𝗐𝗍,Ω,o(s,)))\beta_{t}(s^{\prime})\leftarrow\textmd{{Product}}(\textmd{{Dot}}(\beta_{t-1},p(\bullet,s^{\prime})),\newline \indent\indent\textmd{{Select}}(\mathsf{w_{t}},\Omega,o(s^{\prime},\bullet)))      
11:   return Gt(Sum(αk1),Product(c,Sum(βk1)))t=0k1𝗐𝗍Ω\textmd{{Gt}}(\textmd{{Sum}}(\alpha_{k-1}),\textmd{{Product}}(c,\textmd{{Sum}}(\beta_{k-1})))\wedge\bigwedge_{t=0}^{k-1}\mathsf{w_{t}}\in\Omega
Algorithm 1 Pufferfish Check

Let H=((S,p),Ω,o)H=((S,p),\Omega,o) be an HMM, π,τ\pi,\tau two initial distributions on SS, c0c\geq 0 a real number, and kk a positive integer. With a fixed observation sequence ω¯\overline{\omega}, computing the probability Pr(ω¯|π,H)\Pr(\overline{\omega}|\pi,H) can be done in polynomial time [30]. To check if Pr(ω¯|π,H)>cPr(ω¯|τ,H)\Pr(\overline{\omega}|\pi,H)>c\cdot\Pr(\overline{\omega}|\tau,H) for any fixed observation sequence ω¯\overline{\omega}, one simply computes the respective probabilities and then checks the inequality.

Our algorithm exploits the efficient algorithm of HMMs for computing the probability of observation sequences. Rather than a fixed observation sequence, we declare kk SMT variables 𝗐𝟢,𝗐𝟣,,𝗐𝗄𝟣\mathsf{w_{0}},\mathsf{w_{1}},\ldots,\mathsf{w_{k-1}} for observations at each step. The observation at each step is determined by one of the kk variables. Let Ω={ω1\Omega=\{\omega_{1}, ω2\omega_{2}, \ldots, ωm}\omega_{m}\} be the set of observations. We define the SMT expression Select (𝗐\mathsf{w}, {ω1\{\omega_{1}, ω2\omega_{2}, \ldots, ωm}\omega_{m}\}, OPENo(s,))o(s,\bullet)) equal to o(s,ω)o(s,\omega) when the SMT variable 𝗐\mathsf{w} is ωΩ\omega\in\Omega. It is straightforward to formulate by the SMT 𝗂𝗍𝖾\mathsf{ite} (if-then-else) expression:

𝗂𝗍𝖾(𝗐=ω1,o(s,ω1)CLOSE,\displaystyle\mathsf{ite}(\mathsf{w}=\omega_{1},o(s,\omega_{1}), OPEN𝗂𝗍𝖾(𝗐=ω2,o(s,ω2),,𝗂𝗍𝖾(𝗐=ωm,o(s,ωm),𝗐)))\displaystyle\mathsf{ite}(\mathsf{w}=\omega_{2},o(s,\omega_{2}),\ldots,\mathsf{ite}(\mathsf{w}=\omega_{m},o(s,\omega_{m}),\mathsf{w})\ldots))

Using Select(𝗐,{ω1,ω2,,ωm},o(s,))\textmd{{Select}}(\mathsf{w},\{\omega_{1},\omega_{2},\ldots,\omega_{m}\},o(s,\bullet)), we construct an SMT expression to compute Pr(𝗐¯|π,H)\Pr(\overline{\mathsf{w}}|\pi,H) where 𝗐¯\overline{\mathsf{w}} is a sequence of SMT variables ranging over the observations Ω\Omega (Algorithm 1). Recall the equations (2) and (3). We simply replace the expression o(s,ω)o(s,\omega) with the new one Select(𝗐CLOSE(\mathsf{w},{ω1,,\{\omega_{1}, ω2,\omega_{2}, ,\ldots, ωm},\omega_{m}\}, oo (sCLOSE,(s, OPENOPEN))\bullet)) to leave the observation determined by the SMT variable 𝗐\mathsf{w}. In the algorithm, we also use auxiliary functions. Product(𝑠𝑚𝑡𝐸𝑥𝑝0,,𝑠𝑚𝑡𝐸𝑥𝑝m)\textmd{{Product}}(\mathit{smtExp}_{0},\ldots,\mathit{smtExp}_{m}) returns the SMT expression denoting the product of 𝑠𝑚𝑡𝐸𝑥𝑝0,,\mathit{smtExp}_{0},\ldots,𝑠𝑚𝑡𝐸𝑥𝑝m\mathit{smtExp}_{m}. Similarly, Sum(𝑠𝑚𝑡𝐸𝑥𝑝0,CLOSE,\textmd{{Sum}}(\mathit{smtExp}_{0},\ldots, OPEN𝑠𝑚𝑡𝐸𝑥𝑝m)\mathit{smtExp}_{m}) returns the SMT expression for the sum of 𝑠𝑚𝑡𝐸𝑥𝑝0,,\mathit{smtExp}_{0},\ldots, 𝑠𝑚𝑡𝐸𝑥𝑝m\mathit{smtExp}_{m}. Gt(𝑠𝑚𝑡𝐸𝑥𝑝0,𝑠𝑚𝑡𝐸CLOSE\textmd{{Gt}}(\mathit{smtExp}_{0},\mathit{smtE} OPEN𝑥𝑝1)\mathit{xp}_{1}) returns the SMT expression for 𝑠𝑚𝑡𝐸𝑥𝑝0\mathit{smtExp}_{0} greater than 𝑠𝑚𝑡𝐸𝑥𝑝1\mathit{smtExp}_{1}. Finally, Dot ([𝖺𝟢([\mathsf{a_{0}}, 𝖺𝟣\mathsf{a_{1}}, ,\ldots, 𝖺𝗇],[𝖻𝟢,𝖻𝟣,,𝖻𝗇])\mathsf{a_{n}}],[\mathsf{b_{0}},\mathsf{b_{1}},\ldots,\mathsf{b_{n}}]) returns the SMT expression for the inner product of the two lists of SMT expressions, namely, Sum(Product(𝖺𝟢,𝖻𝟢),,Product(𝖺𝗇,𝖻𝗇)).\textmd{{Sum}}(\textmd{{Product}}(\mathsf{a_{0}},\mathsf{b_{0}}),\ldots,\textmd{{Product}}(\mathsf{a_{n}},\mathsf{b_{n}})).

Algorithm 1 is summarized in the following theorem.

Theorem 5.2

Let H=((S,p),Ω,o)H=((S,p),\Omega,o) be a hidden Markov model, π,τ\pi,\tau state distributions on SS, c>0c>0 a real number, and k>0k>0 an integer. Algorithm 1 returns an SMT query such that the query is unsatisfiable iff Pr(ω¯|π,H)cPr(ω¯|τ,H)\Pr(\overline{\omega}|\pi,H)\leq c\cdot\Pr(\overline{\omega}|\tau,H) for every observation sequence ω¯\overline{\omega} of length kk.

In practice, the integer kk depends on the length of observation sequence we want to make sure to satisfy Pufferfish privacy. For instance, in the model of Fig. 1(c), the maximal length of observation sequence is 1 and thus k=1k=1. If there exist cycles in models such as Fig. 3, which implies loops in the mechanisms, kk should keep increasing (and stop before a set value) in order to examine outputs of different lengths.

6 Pufferfish Privacy Verifier: FAIER

We implement our verification tool and present experimental results in Subsection 6.1. For the well-known differential privacy mechanisms Noisy Max and Above Threshold, we provide modeling details in HMMs and verify the privacy wrt. several Pufferfish privacy scenarios in Subsection 6.2 and 6.3, accordingly.

6.1 Evaluation for FAIER

We implement our verification algorithm (Algorithm 1) into the tool FAIER, which is the pufferFish privAcy verifIER. It is implemented in C++ environment with the SMT solver Z3Z3 [28] and we performed all experiments on an Intel(R) Core i7-8750H @ 2.20GHz CPU machine with 4 GB memory and 4 cores in the virtual machine. All the examples in this paper have been verified.

The inputs for our tool include an HMM HH of the mechanism to be verified, distribution pair (π\pi,τ\tau) on states in HH, a non-negative real number cc indicating the privacy budget and an input kk specifying the length of observation sequences. Note that unknown parameters are also allowed in the SMT formulae, which can encode certain prior knowledge or data sets distributions.

Table 2: Experiment results:  indicates the property holds, and  not.
Mechanism Privacy scenario Result
Query answer Counterexample
Truncated 12\frac{1}{2} -geometric Mechanism ln(2)\ln(2)-differential privacy (Ex. 2)
ln(2)\ln(2)-pufferfish privacy (Ex. 3) 2~\tilde{2}
ln(2)\ln(2)-pufferfish privacy (Ex. 4)
Discrete Noisy Max (Algorithm 2) ln(2)\ln(2)-pufferfish privacy (Ex. 5)
ln(2)\ln(2)-pufferfish privacy (Ex. 6) ,3~\bot,\tilde{3}; pA=pB=pC=12p_{A}=p_{B}=p_{C}=\frac{1}{2}
Above Threshold Algorithm (Algorithm 3) 4ln(2)4\ln(2)-differential privacy ,01,,12,,12,\llcorner\!\!\lrcorner,01,\bot,12,\bot,12,\bot, 1212, \bot, 21,21,\top

We summarize the experiment results in this paper for pufferfish privacy, as well as differential privacy in Table 2. FAIER has the following outputs:

  • Counterexample: If the privacy condition does not hold (marked by ), FAIER will return a witnessing observation sequence leading to the violation.

  • Parameter Synthesis: If there exist unknown parameters in the model, such as the infection rate pp for some disease, a value will be synthesized for the counterexample. See Ex. 6 where counterexample is found when pA,pB,pCp_{A},p_{B},p_{C} are equal to 12\frac{1}{2}; Or, no value can be found if the privacy is always preserved. See Ex. 5.

  • is returned if the privacy is preserved.

Note that if there exists a loop in the model, the bound kk should continue to increase when an ’UNSAT’ is returned. Specially, the bound is set at a maximum of 1515 for Above Threshold. It may happen that FAIER does not terminate since some nonlinear constraints are too complicated for Z3Z3, such as Ex. 5, which cannot solved by Z3Z3 within 6060 min. Thus we encode them into a more powerful tool REDLOG for nonlinear constraints [15]. For every experiment in the table, the time to construct the HMM model and SMT queries is less than 1 second; the time for solving SMT queries are less than 2 seconds, except for Ex. 5.

Among the mechanisms in Table 2, Algorithm 2,3 need our further investigation. We examine these algorithms carefully in the following subsections.

6.2 Noisy Max

Noisy Max is a simple yet useful data publishing mechanism in differential privacy [16, 14]. Consider nn queries of the same range, say, the number of patients for nn different diseases in a hospital. We are interested in knowing which of the nn diseases has the maximal number of patients in the hospital. A simple privacy-respecting way to release the information is to add independent noises to every query result and then return the index of the maximal noisy results.

1: 0v1,v2,,vn20\leq v_{1},v_{2},\ldots,v_{n}\leq 2
2: The index rr with the maximal v~r\tilde{v}_{r} among v~1,v~2,,v~n\tilde{v}_{1},\tilde{v}_{2},\ldots,\tilde{v}_{n}
3: function DiscreteNoisyMax(v1,v2,,vnv_{1},v_{2},\ldots,v_{n})
4:   M,r,c1,0,0M,r,c\leftarrow-1,0,0
5:   for each viv_{i} do
6:    match viv_{i} with \triangleright apply 12\frac{1}{2}-geometric mechanism
7:       case 00: v~i0,1,2\tilde{v}_{i}\leftarrow 0,1,2 with probability 23,16,16\frac{2}{3},\frac{1}{6},\frac{1}{6}
8:       case 11: v~i0,1,2\tilde{v}_{i}\leftarrow 0,1,2 with probability 13,13,13\frac{1}{3},\frac{1}{3},\frac{1}{3}
9:       case 22: v~i0,1,2\tilde{v}_{i}\leftarrow 0,1,2 with probability 16,16,23\frac{1}{6},\frac{1}{6},\frac{2}{3}    
10:    if M=v~iM=\tilde{v}_{i} then
11:       cc+1c\leftarrow c+1
12:       rir\leftarrow i with probability 1c\frac{1}{c}    
13:    if M<v~iM<\tilde{v}_{i} then
14:       M,r,cv~i,i,1M,r,c\leftarrow\tilde{v}_{i},i,1      
15:   return rr
Algorithm 2 Discrete Noisy Max

In [16], Noisy Max algorithm adds continuous Laplacian noises to each query result. The continuous Noisy Max algorithm is proved to effectively protect privacy for neighboring data sets [14]. In practice continuous noises however are replaced by discrete noises using floating-point numbers. Technically, the distribution of discrete floating-point noises is different from the continuous distribution in mathematics. Differential privacy can be breached [27]. The proof for continuous Noisy Max algorithm does not immediately apply. Indeed, care must be taken to avoid privacy breach.

\cdots 011011 \llcorner\!\!\lrcorner\cdots 120120 \llcorner\!\!\lrcorner\cdots 202202 \llcorner\!\!\lrcorner\cdots \cdots 02¯2¯0\underline{2}\underline{2}
2~(12),3~(12)\tilde{2}(\frac{1}{2}),\tilde{3}(\frac{1}{2})
\cdots 231313\frac{2}{3}\cdot\frac{1}{3}\cdot\frac{1}{3} 132316\frac{1}{3}\cdot\frac{2}{3}\cdot\frac{1}{6} 161623\frac{1}{6}\cdot\frac{1}{6}\cdot\frac{2}{3}
Figure 2: Hidden Markov Model for Noisy Max

We introduce our algorithm and model. The standard algorithm is modified by adding discrete noises to query results (Algorithm 2). In the algorithm, the variables MM and rr contain the maximal noisy result and its index respectively. We apply the truncated 12\frac{1}{2}-geometric mechanism to each query with the corresponding discrete range. To avoid returning a fixed index when there are multiple noisy results with the same value, the discrete algorithm explicitly returns the index of the maximal noisy value with an equal probability (Line. 8148-14).

The HMM model with n=3n=3 queries is illustrated in Fig. 2. The top states labeled 011011 and 120120 correspond to three query results (on neighboring data sets) and \llcorner\!\!\lrcorner, i.e. nothing, is observed in the initial states. Both states have a transition to the state 02¯2¯0\underline{2}\underline{2}, representing the perturbed query results obtained with different probabilities. The index of the maximal result will be observed, which is 22 or 33 with probability 12\frac{1}{2}. Next we analyze Algorithm 2 under the Pufferfish framework.

Example 5

Consider three counting queries fAf_{A}, fBf_{B}, and fCf_{C} for the number of individuals contracting the diseases AA, BB, and CC respectively in the data set 𝒳2\mathcal{X}^{2} with 𝒳={(0,0,0),(0,0,1),,\mathcal{X}=\{(0,0,0),(0,0,1),\ldots,(1,1,1)}\}. An element (a,b,c)𝒳(a,b,c)\in\mathcal{X} denotes whether the data entry contracts the diseases AA, BB, and CC respectively. Assume that the contraction of each disease is independent among individuals and the probabilities of contracting the diseases AA, BB, and CC are pAp_{A}, pBp_{B}, and pCp_{C} respectively. The prior knowledge induces an information state for the model in Fig. 2. For example, the state 120120 has the probability 2pA(1pA)pB2(1pC)22p_{A}(1-p_{A})\cdot p_{B}^{2}\cdot(1-p_{C})^{2}.

Suppose John is in the data set and whether John contracts the disease AA is a secret. We would like to check if the discrete Noisy Max algorithm can protect the secret using the Pufferfish privacy framework. Let us compute the initial information state π\pi given that John has not contracted disease AA. For instance, the initial probability of the state 120120 is 2pA(1pA)(1pA)2+2pA(1pA)pB2(1pC)2\frac{2p_{A}(1-p_{A})}{(1-p_{A})^{2}+2p_{A}(1-p_{A})}\cdot p_{B}^{2}\cdot(1-p_{C})^{2}. The initial information state π\pi is obtained by computing the probabilities of each of the 333^{3} top states. Given that John has the disease AA, the initial information state τ\tau is computed similarly. In this case, the initial probability of the state 120120 becomes 2pA(1pA)2pA(1pA)+pA2pB2(1pC)2\frac{2p_{A}(1-p_{A})}{2p_{A}(1-p_{A})+p_{A}^{2}}\cdot p_{B}^{2}\cdot(1-p_{C})^{2}. Probabilities of the 333^{3} top states form the initial information state τ\tau. From the initial information state π\pi and τ\tau, we compute the probabilities of observing 1~\llcorner\!\!\lrcorner\tilde{1}, 2~\llcorner\!\!\lrcorner\tilde{2}, and 3~\llcorner\!\!\lrcorner\tilde{3} in the formal model (Fig. 2). The formulae for observation probabilities are easy to compute. However, the SMT solver Z3 cannot solve the non-linear formulae generated by our algorithm. In order to establish Pufferfish privacy automatically, we submit the non-linear formulae to the constraint solver REDLOG. This time, the solver successfully proves the HMM satisfying ln(2)\ln(2)-Pufferfish privacy. \hfill\blacksquare

Algorithm 2 is ln(2)\ln(2)-Pufferfish private when the contraction of diseases is independent for data entries. Our next step is to analyze the privacy mechanism model when the contraction of the disease AA is correlated among data entries.

Example 6

Assume that the data set consists of 22 family members, including John, and there are 55 queries which ask the number of patients of 55 diseases in the data set. To protect privacy, Algorithm 2 is applied to query results. Now assume an attacker has certain prior knowledge: 1. Disease 11 is so highly contagious that either none or both members infect the disease; 2. Disease 22 to Disease 55 are such diseases that every person has the probability of pkp_{k} to catch Disease kk; and 3. The attacker knows the values of probabilities: pk=k10p_{k}=\frac{k}{10} for k{3,4,5}k\in\{3,4,5\}, but does not know the value of p2p_{2}. Suppose the secret is whether John has contracted Disease 11 and we wonder whether there exists such a p2p_{2} that ln(2)\ln(2)-Pufferfish private is violated. We can compute the initial distribution pair π\pi and τ\tau given the above information. For instance, if John has contracted Disease 11, then the initial probability for state 2111021110 is p2(1p2)(310)(1310)(410)(1410)(1510)2p_{2}(1-p_{2})\cdot(\frac{3}{10})(1-\frac{3}{10})\cdot(\frac{4}{10})(1-\frac{4}{10})(1-\frac{5}{10})^{2}. Similarly, we obtain the initial information state given that John has not contracted the disease. Then FAIER verifies the mechanism does not satisfy ln(2)\ln(2)-Pufferfish private with the synthesized parameter p2=12p_{2}=\frac{1}{2}.\hfill\blacksquare

Provably correct privacy mechanisms can leak private information by seemingly harmless modification or assumed prior knowledge. Ideally, privacy guarantees of practical mechanisms need be re-established. Our verification tool can reveal ill-designed privacy protection mechanisms easily.

6.3 Above Threshold

Above threshold is a classical differentially private mechanism for releasing numerical information [16]. Consider a data set and an infinite sequence of counting queries f1,f2,f_{1},f_{2},\ldots. We would like to know the index of the first query whose result is above a given threshold. In order to protect privacy, the classical algorithm adds continuous noises on the threshold and each query result. If the noisy query result is less than the noisy threshold, the algorithm reports \bot and continues to the next counting query. Otherwise, the algorithm reports \top and stops.

We consider counting queries with range {0,1,2}\{0,1,2\} and apply the truncated geometric mechanism for discrete noises. The discrete above threshold algorithm is shown in Algorithm 3. The algorithm first obtains the noisy threshold t~\tilde{t} using the truncated 14\frac{1}{4}-geometric mechanism. For each query result rir_{i}, it computes a noisy result r~i\tilde{r}_{i} by applying the truncated 12\frac{1}{2}-geometric mechanism. If r~i<t~\tilde{r}_{i}<\tilde{t}, the algorithm outputs \bot and continues. Otherwise, it halts with the output \top.

Algorithm and Model

To ensure ϵ\epsilon-differential privacy, the classical algorithm applies the 2ϵ\frac{2}{\epsilon}- and 4ϵ\frac{4}{\epsilon}-Laplace mechanism to the threshold and each query result respectively. The continuous noisy threshold and query results are hence ϵ2\frac{\epsilon}{2}- and ϵ4\frac{\epsilon}{4}-differentially private. In Algorithm 3, the discrete noisy threshold and query results are 2ln(2){2\ln(2)}- and ln(2){\ln(2)}-differentially private. If the classical proof still applies, we expect the discrete above threshold algorithm is 4ln(2){4\ln(2)}-differentially private for ϵ2=2ln(2)\frac{\epsilon}{2}=2\ln(2).

Fig. 3 gives an HMM for Algorithm 3. In the model, the state tirjt_{i}r_{j} represents the input threshold t=it=i and the first query result r=f1(𝐝¯)=jr=f_{1}(\overline{\mathbf{d}})=j for an input data set 𝐝¯\overline{\mathbf{d}}. From the state tirjt_{i}r_{j}, we apply the truncated 14\frac{1}{4}-geometric mechanism. The state t~irj\tilde{t}_{i}r_{j} hence means the noisy threshold t~=i\tilde{t}=i with the query result r=jr=j. For instance, the state t0r1t_{0}r_{1} transits to t~1r1\tilde{t}_{1}r_{1} with probability 320\frac{3}{20}. After the noisy threshold is obtained, we compute a noisy query result by the truncated 12\frac{1}{2}-geometric mechanism. The state t~ir~j\tilde{t}_{i}\tilde{r}_{j} represents the noisy threshold t~=i\tilde{t}=i and the noisy query result r~=j\tilde{r}=j. In the figure, we see that the state t~1r0\tilde{t}_{1}r_{0} moves to t~1r~0\tilde{t}_{1}\tilde{r}_{0} with probability 23\frac{2}{3}. At the state t~ir~j\tilde{t}_{i}\tilde{r}_{j}, \top is observed if jij\geq i; otherwise, \bot is observed. From the state t~ir~j\tilde{t}_{i}\tilde{r}_{j}, the model transits to the states t~ir0\tilde{t}_{i}r_{0}, t~ir1\tilde{t}_{i}r_{1}, t~ir2\tilde{t}_{i}r_{2} with uniform distribution. This simulates the next query result in Algorithm 3. The model then continues to process the next query.

1: procedure AboveThreshold(𝐝¯\overline{\mathbf{d}}, {f1,f2,}\{f_{1},f_{2},\ldots\}, tt)
2:   match tt with \triangleright apply 14\frac{1}{4}-geometric mechanism
3:    case 00: t~0,1,2\tilde{t}\leftarrow 0,1,2 with probability 45,320,120\frac{4}{5},\frac{3}{20},\frac{1}{20}
4:    case 11: t~0,1,2\tilde{t}\leftarrow 0,1,2 with probability 15,35,15\frac{1}{5},\frac{3}{5},\frac{1}{5}
5:    case 22: t~0,1,2\tilde{t}\leftarrow 0,1,2 with probability 120,320,45\frac{1}{20},\frac{3}{20},\frac{4}{5}   
6:   for each query fif_{i} do
7:    rifi(𝐝¯)r_{i}\leftarrow f_{i}(\overline{\mathbf{d}})
8:    match rir_{i} with \triangleright apply 12\frac{1}{2}-geometric mechanism
9:      case 00: r~i0,1,2\tilde{r}_{i}\leftarrow 0,1,2 with probability 23,16,16\frac{2}{3},\frac{1}{6},\frac{1}{6}
10:      case 11: r~i0,1,2\tilde{r}_{i}\leftarrow 0,1,2 with probability 13,13,13\frac{1}{3},\frac{1}{3},\frac{1}{3}
11:      case 22: r~i0,1,2\tilde{r}_{i}\leftarrow 0,1,2 with probability 16,16,23\frac{1}{6},\frac{1}{6},\frac{2}{3}    
12:    if r~it~\tilde{r}_{i}\geq\tilde{t} then halt with ai=a_{i}=\top else ai=a_{i}=\bot   
Algorithm 3 Input: private database 𝐝¯\overline{\mathbf{d}}, counting queries fi:𝐝¯{0,1,2}f_{i}:\overline{\mathbf{d}}\rightarrow\{0,1,2\}, threshold t{0,1,2}t\in\{0,1,2\}; Output: a1,a2,a_{1},a_{2},\ldots

The bottom half of Fig. 3 is another copy of the model. All states in the second copy are underlined¯\underline{\textmd{underlined}}. For instance, the state t¯~2r¯0\tilde{\underline{t}}_{2}\underline{r}_{0} represents the noisy threshold is 22 and the query result is 00. Given an observation sequence, the two copies are used to simulate the mechanism conditioned on the prior knowledge with the two secrets. In the figure, we define the observation set Ω={,,,00,01,10,11,12,21,22\Omega=\{\llcorner\!\!\lrcorner,\bot,\top,00,01,10,11,12,21,22, \spadesuit, \heartsuit, \diamondsuit, }\clubsuit\}. At initial states tirjt_{i}r_{j} and t¯ir¯j\underline{t}_{i}\underline{r}_{j}, only \llcorner\!\!\lrcorner can be observed. When the noisy threshold is greater than the noisy query result (t~ir~j\tilde{t}_{i}\tilde{r}_{j} and t¯~ir¯~j\tilde{\underline{t}}_{i}\tilde{\underline{r}}_{j} with i>ji>j), \bot is observed. Otherwise, \top is observed at states t~ir~j\tilde{t}_{i}\tilde{r}_{j} and t¯~ir¯~j\tilde{\underline{t}}_{i}\tilde{\underline{r}}_{j} with iji\leq j. Other observations are used to “synchronize” query results for neighboring data sets. More details are explained in Appendix 2.

Differential Privacy Analysis

We can now perform differential privacy analysis using the HMM in Fig. 3. By construction, each observation corresponds to a sequence of queries on neighboring data sets and their results. If the proof of continuous above threshold mechanism could carry over to our discretized mechanism, we would expect differences of observation probabilities from neighboring data sets to be bounded by the multiplicative factor of e4ln(2)=16e^{4\ln(2)}=16. Surprisingly, our tool always reports larger differences as the number of queries increases. After generalizing finite observations found by Z3Z3, we obtain an observation sequence of an arbitrary length described below.

Fix n>0n>0. Consider a data set 𝐝¯\overline{\mathbf{d}} such that fi(𝐝¯)=1f_{i}(\overline{\mathbf{d}})=1 for 1in1\leq i\leq n and fn+1(𝐝¯)=2f_{n+1}(\overline{\mathbf{d}})=2. A neighbor 𝐝¯\overline{\mathbf{d}}^{\prime} of 𝐝¯\overline{\mathbf{d}} may have fi(𝐝¯)=2f_{i}(\overline{\mathbf{d}}^{\prime})=2 for 1in1\leq i\leq n and fn+1(𝐝¯)=1f_{n+1}(\overline{\mathbf{d}}^{\prime})=1. Note that |fi(𝐝¯)fi(𝐝¯)|1|f_{i}(\overline{\mathbf{d}})-f_{i}(\overline{\mathbf{d}}^{\prime})|\leq 1 for 1in+11\leq i\leq n+1. fif_{i}’s are counting queries. Suppose the threshold t=2t=2. Let us compute the probabilities of observing n\bot^{n}\top on 𝐝¯\overline{\mathbf{d}} and 𝐝¯\overline{\mathbf{d}}^{\prime}.

t0r1t_{0}r_{1} \llcorner\!\!\lrcorner\cdotst~0r1\tilde{t}_{0}r_{1} \cdotst~1r0\tilde{t}_{1}r_{0} 00,01,00,01,\heartsuitt~1r1\tilde{t}_{1}r_{1} 10,11,1210,11,12t~1r2\tilde{t}_{1}r_{2} ,21,22\spadesuit,21,22\vdots \vdots \cdots t~2r1\tilde{t}_{2}r_{1} \cdots t~1r~0\tilde{t}_{1}\tilde{r}_{0} \bott~1r~1\tilde{t}_{1}\tilde{r}_{1} \topt~1r~2\tilde{t}_{1}\tilde{r}_{2} \topt¯0r¯0\underline{t}_{0}\underline{r}_{0} \llcorner\!\!\lrcornert¯~0r¯0\tilde{\underline{t}}_{0}\underline{r}_{0} \cdots t¯~1r¯0\tilde{\underline{t}}_{1}\underline{r}_{0} \cdots t¯~2r¯0\tilde{\underline{t}}_{2}\underline{r}_{0} 00,10,00,10,\clubsuitt¯~2r¯1\tilde{\underline{t}}_{2}\underline{r}_{1} 01,11,2101,11,21t¯~2r¯2\tilde{\underline{t}}_{2}\underline{r}_{2} ,12,22\diamondsuit,12,22t¯~2r¯~0\tilde{\underline{t}}_{2}\tilde{\underline{r}}_{0} \bot\vdots t¯~2r¯~1\tilde{\underline{t}}_{2}\tilde{\underline{r}}_{1} \bot\vdots t¯~2r¯~2\tilde{\underline{t}}_{2}\tilde{\underline{r}}_{2} \top45\frac{4}{5} 320\frac{3}{20} 120\frac{1}{20} 45\frac{4}{5} 320\frac{3}{20} 120\frac{1}{20}
Figure 3: Hidden Markov Model for Above Threshold

If t~=0\tilde{t}=0, f~1t~\tilde{f}_{1}\geq\tilde{t}. The algorithm reports \top and stops. We cannot observe n\bot^{n}\top: recall the assumption that n>0n>0. It suffices to consider t~=1\tilde{t}=1 or 22. When t~=1\tilde{t}=1, f~i(𝐝¯)=0\tilde{f}_{i}(\overline{\mathbf{d}})=0 for 1in1\leq i\leq n and f~n+1(𝐝¯)1\tilde{f}_{n+1}(\overline{\mathbf{d}})\geq 1. Recall fi(𝐝¯)=1f_{i}(\overline{\mathbf{d}})=1 for 1in1\leq i\leq n and fn+1(𝐝¯)=2f_{n+1}(\overline{\mathbf{d}})=2. The probability of observing n\bot^{n}\top is (13)n56(\frac{1}{3})^{n}\cdot\frac{5}{6}. When t~=2\tilde{t}=2, f~1(𝐝¯)1\tilde{f}_{1}(\overline{\mathbf{d}})\leq 1 for 1in1\leq i\leq n and f~n+1(𝐝¯)=2\tilde{f}_{n+1}(\overline{\mathbf{d}})=2. The probability of observing n\bot^{n}\top is thus (23)n23(\frac{2}{3})^{n}\cdot\frac{2}{3}. In summary, the probability of observing n\bot^{n}\top with 𝐝¯\overline{\mathbf{d}} when t=2t=2 is 320(13)n56+45(23)n23\frac{3}{20}\cdot(\frac{1}{3})^{n}\cdot\frac{5}{6}+\frac{4}{5}\cdot(\frac{2}{3})^{n}\cdot\frac{2}{3}. The case for 𝐝¯\overline{\mathbf{d}}^{\prime} is similar. When t~=1\tilde{t}=1, the probability of observing n\bot^{n}\top is (16)n23(\frac{1}{6})^{n}\cdot\frac{2}{3}. When t~=2\tilde{t}=2, the probability of observing the same sequence is (13)n13(\frac{1}{3})^{n}\cdot\frac{1}{3}. Hence the probability of observing n\bot^{n}\top with 𝐝¯\overline{\mathbf{d}}^{\prime} when t=2t=2 is 320(16)n23+45(13)n13\frac{3}{20}\cdot(\frac{1}{6})^{n}\cdot\frac{2}{3}+\frac{4}{5}\cdot(\frac{1}{3})^{n}\cdot\frac{1}{3}. Now,

Pr(ω=n|𝐝¯,t=2)Pr(ω=n|𝐝¯,t=2)\displaystyle\frac{\Pr(\omega=\bot^{n}\top|\overline{\mathbf{d}},t=2)}{\Pr(\omega=\bot^{n}\top|\overline{\mathbf{d}}^{\prime},t=2)} =320(13)n56+45(23)n23320(16)n23+45(13)n13\displaystyle=\frac{\frac{3}{20}\cdot(\frac{1}{3})^{n}\cdot\frac{5}{6}+\frac{4}{5}\cdot(\frac{2}{3})^{n}\cdot\frac{2}{3}}{\frac{3}{20}\cdot(\frac{1}{6})^{n}\cdot\frac{2}{3}+\frac{4}{5}\cdot(\frac{1}{3})^{n}\cdot\frac{1}{3}}
>45(23)n23320(13)n23+45(13)n13=815(23)n1130(13)n=16112n.\displaystyle>\frac{\frac{4}{5}\cdot(\frac{2}{3})^{n}\cdot\frac{2}{3}}{\frac{3}{20}\cdot(\frac{1}{3})^{n}\cdot\frac{2}{3}+\frac{4}{5}\cdot(\frac{1}{3})^{n}\cdot\frac{1}{3}}=\frac{\frac{8}{15}(\frac{2}{3})^{n}}{\frac{11}{30}(\frac{1}{3})^{n}}=\frac{16}{11}\cdot 2^{n}.

We see that the ratio of Pr(ω=n|𝐝¯,t=2)\Pr(\omega=\bot^{n}\top|\overline{\mathbf{d}},t=2) and Pr(ω=n|𝐝¯,t=2)\Pr(\omega=\bot^{n}\top|\overline{\mathbf{d}}^{\prime},t=2) can be arbitrarily large. Unexpectedly, the discrete above threshold cannot be ϵ\epsilon-differentially private for any ϵ\epsilon. Replacing continuous noises with truncated discrete noises does not preserve any privacy at all. This case emphasizes the importance of applying verification technique to practical implementations.

7 Combining Techniques for Differential Privacy

In this section, we investigate into two state-of-the-art tools for detecting violations of differential privacy, namely StatDP [14] and DP-Sniper [10], to compare with our tool. We decide to choose these tools as baselines since they support programs with arbitrary loops and arbitrary sampling distributions. On the contrary, DiPC [3, 4], DP-Finder [9] and CheckDP [31] et al. do not support arbitrary loops or only synthesize proofs for privacy budget ϵ\epsilon when Laplace distributions are applied. In order to compare with our tool FAIER, the discrete mechanisms with truncated geometric distributions are implemented in these tools. We present comparisons in Subsection 7.1, and moreover, in Subsection 7.2, we discuss how testing and our verification technique can be combined to certify counterexamples and find the precise lower bound for privacy budget.

7.1 Comparison

Different problem statements

As all the tools can be used to find the privacy budget ϵ\epsilon for differential private mechanisms, the problem statements they address are different: I. With a fixed value of ϵ\epsilon, StatDP runs the mechanism repeatedly and tries to report the output event that makes the mechanism violate ϵ\epsilon-differential privacy, with a p-value as the confidence level. If the p-value is below 0.05, StatDP is of high confidence that ϵ\epsilon-differential privacy is violated; Otherwise the mechanism is very likely (depending on the p-value) to satisfy. II. On the other hand, DP-Sniper aims to learn for the optimal attack that maximizes the ratio of probabilities for certain outputs on all the neighboring inputs. Therefore it returns the corresponding “optimal” witness (neighboring inputs) along with a value ϵ\epsilon such that the counterexample violates ϵ\epsilon-differential privacy with ϵ\epsilon as large as possible. III. Differently, FAIER makes use of the HMM model and examines all the pairs of neighboring inputs and outputs to make sure that ϵ\epsilon-differential privacy is satisfied by all cases, or violated by an counterexample, with a fixed value of ϵ\epsilon. IV. Note that FAIER is aimed at Pufferfish privacy verification where prior knowledge can affect the data sets distributions and unknown parameters are allowed, which are not involved in the other tools. Meanwhile, the others support continuous noise while FAIER does not (unless an HMM with finite state space can be obtained).

Table 3: Heuristic input patterns used in StatDP and DP-Sniper, from  [14]
CategoryD1D2One Above[1,1,1,1,1][2,1,1,1,1]One Below[1,1,1,1,1][0,1,1,1,1]One Above Rest Below[1,1,1,1,1][2,0,0,0,0]One Below Rest Above[1,1,1,1,1][0,2,2,2,2]Half Half[1,1,1,1,1][0,0,2,2,2]All Above & All Below[1,1,1,1,1][2,2,2,2,2]X Shape[1,1,0,0,0][0,0,1,1,1]\begin{array}[]{c|cc}Category&D_{1}&D_{2}\\ \hline\cr\textmd{One Above}&[1,1,1,1,1]&[2,1,1,1,1]\\ \textmd{One Below}&[1,1,1,1,1]&[0,1,1,1,1]\\ \textmd{One Above Rest Below}&[1,1,1,1,1]&[2,0,0,0,0]\\ \textmd{One Below Rest Above}&[1,1,1,1,1]&[0,2,2,2,2]\\ \textmd{Half Half}&[1,1,1,1,1]&[0,0,2,2,2]\\ \textmd{All Above \& All Below}&[1,1,1,1,1]&[2,2,2,2,2]\\ \textmd{X Shape}&[1,1,0,0,0]&[0,0,1,1,1]\\ \end{array}

Efficiency and precision

We make comparison of the tools in terms of efficiency and precision by performing experiments on Discrete Noisy Max (Algorithm. 2) with n=5n=5 queries. The lower bound [9] of the privacy budget, i.e., the largest ϵ\epsilon that the mechanism is not ϵ\epsilon-differential privacy, is 1.3721.372 up to a precision of 0.001. I. Fix an ϵ\epsilon, StatDP takes 88 seconds on average to report an event 0 along with a p-value under the usual setting of 100k/500k100k/500k times for event selection/counterexample detection. However, there is a need for specifying the range of ϵ\epsilon in advance and more values of ϵ\epsilon to test will consume more time. We first select ϵ\epsilon increasingly with a step of 0.10.1 in the range of [0, 2]. Then the range is narrowed down according to the p-values and we select ϵ\epsilon in the range with a smaller step 0.010.01 and so on. The similar process also applies for FAIER. Altogether StatDP takes around 600600 seconds to get an overview of the results. Fast enough, though, it has the drawback of instability and the precision is lower than the other tools. It reports the mechanism satisfies 1.3441.344-differential privacy in the first execution, which is incorrect, and reports it violates 1.3531.353-differential privacy in the second execution.

II. DP-Sniper returns a witness [0,2,2,2,2] and [1,1,1,1,1] with ϵ=1.371\epsilon=1.371 for three times, which is correct, stable and the result is almost the true lower bound. However, it takes around 46004600 seconds on average to train a multi-layer perceptron with 10000k10000k samples and get this result. Unlike the evaluation in [10], DP-Sniper performs much slower than StatDP when it comes to discrete random noise. The reason is that DP-Sniper cannot use high-efficient sampling commands such as numpy.random.laplace to get all the samples at once. It has to calculate and sample different distributions according to different inputs. We’ve tried to use numpy.random.choice to sample different distributions, but it is inefficient for small vectors and wouldn’t terminate for more than 10 hours in our experiment. We’ve also tried to reduce the number of samples to 1000k1000k. This time it terminates with 308308 seconds with an imprecise ϵ=1.350\epsilon=1.350.

III. FAIER takes less than 1 second to build the HMM model and 160 seconds to compute SMT query for every data set (possible initial state), which will be later used to compute on neighboring data sets if an ϵ\epsilon is assigned. The results returned by FAIER are the most precise ones. It takes Z3 523523 seconds to verify that 1.3731.373-differential privacy is satisfied and 234234 seconds that 1.3721.372-differential privacy is violated witnessed by the input pair [0,2,2,2,2] and [1,1,1,1,1] and output event 1. It takes only 4040 seconds to verify when ϵ=1.34\epsilon=1.34, a little far away from the true lower bound. Altogether it takes around 16001600 seconds to assure the true bound, which is acceptable.

7.2 Combining Verification and Testing

The findings during experiments inspire us to combine verification (FAIER) and testing (DP-Sniper, StatDP) together to efficiently make use of each tool. First, we can see that the witnesses found by FAIER and DP-Sniper are the same one. Actually, if heuristic searching strategies for input pairs are used, i.e., Table. 3 used in DP-Sniper and StatDP, FAIER will quickly find the violation pairs, which saves huge time in the occasions of privacy violations. Second, since the witness returned by DP-Sniper is the optimal input pair that maximize the probability difference, FAIER can precisely verify whether the “optimal” witness satisfies ϵ\epsilon-differential privacy, whereby FAIER will more likely to find the true lower bound as ϵ\epsilon increase in short time. Third, since StatDP returns an imprecise result quickly given an ϵ\epsilon, we can combine StatDP and FAIER to efficiently get a precise lower bound. The pseudo-code is in Algorithm 4.

Algorithm 4 first feeds mechanism MM as input to the testing tool StatDP, to obtain an interval II whose left end point is ϵ\epsilon with p-value <0.05<0.05 and right end point with p-value =1=1. StatDP can conclude if p-value<0.05<0.05, the mechanism doesn’t satisfy ϵ\epsilon-differential privacy with high confidence and if p-value=1=1, the mechanism satisfies for sure. However, for other p-values, StatDP is not confident to give useful conclusions. Here is where our tool can work out — FAIER can determine whether MM satisfies ϵ\epsilon-differential privacy, given any ϵ\epsilon. As a result we can combine to efficiently get arbitrarily close to the lower bound ϵ\epsilon wrt. a given precision by binary search. For instance, we apply StatDP on Algorithm 2 to get an interval I=[1.34,1.38]I=[1.34,1.38] according to the p-value graph, and then apply our tool FAIER to verify ϵ\epsilon-differential privacy. Consequently, our tool reports the lower bound is 1.3721.372 (up to a precision of 0.001).

1: procedure Compute lower bound(Mechanism M)
2:    Use StatDP with input M to get an interval I \triangleright the left end point is an ϵ\epsilon with p-value<0.05<0.05 and the right one is one with p-value=1=1
3:    Apply binary search on I, in each iteration the value is ϵ\epsilon
4:    repeat
5:     Use FAIER with input M and ϵ\epsilon
6:     if result is SAT then \triangleright not satisfy ϵ\epsilon-differential privacy
7:       left end point = ϵ\epsilon
8:     else\triangleright satisfy ϵ\epsilon-differential privacy
9:       right end point = ϵ\epsilon     
10:    until reaching required precision
11:    return ϵ\epsilon
Algorithm 4 Pseudo-code to compute the lower bound

8 Related Work

Methods of proving/testing differential privacy.

Barthe et al. [7, 8] proposed to prove differential privacy at the beginning. Then a number of work [5, 6, 1] extended probabilistic relational Hoare logic and applied approximate probabilistic couplings between programs on adjacent inputs. They successfully proved differential privacy for several algorithms, but cannot disprove privacy. Zhang et al. [33, 32, 31] proposed to apply randomness alignment to evaluate privacy cost and implemented CheckDP that could rewrite classic privacy mechanisms involving Laplacian noise to verify differential privacy. Bichsel et.al [9], Ding et.al [14] and Zhang et.al [34] used testing and searching to find violations for differential privacy mechanisms, the results of which may be too coarse or imprecise. Liu et al. [24] chose Markov chains and Markov decision processes to model deferentially private mechanisms and verify privacy properties in extended probabilistic temporal logic. McIver et al. [26] applied Quantitative Information Flow to analyze Randomized response mechanism in differential privacy. We note that all the automated tools above for proving or testing differential privacy, plus ours, have not been well studied in privacy mechanisms with considerably large data sets.

Complexity in verifying differential privacy.

Gaboardi et al. [19] studied the problem of verifying differential privacy for probabilistic loop-free programs. They showed that to decide ϵ\epsilon-differential privacy is 𝐜𝐨𝐍𝐏#𝐏\mathbf{coNP^{\#P}}-complete and to approximate the level of differential privacy is both 𝐍𝐏\mathbf{NP}-hard and 𝐜𝐨𝐍𝐏\mathbf{coNP}-hard. Barthe et al. [3] first proved that checking differential privacy is undecidable. The difference with our work lies in that we study verification problems for mechanisms modeled in HMMs in Pufferfish privacy. Chistikov et al. [12] proved that the big-OO problem for labeled Markov chains (LMCs) is undecidable, which is similar to deciding the ratio of two probabilities in differential privacy. Though, their proof does not apply here since HMMs in our paper do not have the same non-deterministic power as LMCs.

Appendix 1

Proof

In order to satisfy Pufferfish privacy in hidden Markov model, we have to decide whether expressions (4) and (5) are no more than 00. Let’s just simplify the problem by only having one initial distribution pair to compare so that we only need to find the observation sequence. We will show the problem to find the maximal value is NP-hard by a reduction from the classic Boolean Satisfiability Problem (SAT), which is known to be NP-hard. To be specific, given an arbitrary formula in conjuncted normal form, we construct a corresponding hidden Markov model under Pufferfish privacy framework, such that the formula is satisfiable if and only if the expressions (4) and (5) both take the maximal value 00.

Assume we have a formula F(x1,,xn)F(x_{1},\ldots,x_{n}) in conjuncted normal form, with n(n>=3)n(n>=3) variables and mm clauses, C1,,CmC_{1},\ldots,C_{m}. We shall construct a hidden Markov model H=(K,Ω,o)H=(K,\Omega,o) such that with ϵ=ln(4)\epsilon=\ln(4), expressions (4) and (5) will take maximal value 00 if and only if the formula F(x1,,xn)F(x_{1},\ldots,x_{n}) is satisfiable.

Construction.

The construction of model is similar to that in [29]. We first describe the Markov Chain K=(S,p)K=(S,p). SS contains a state group AA with six states AijA_{ij}, AijA^{\prime}_{ij}, TAijT_{Aij}, TAijT^{\prime}_{Aij}, FAijF_{Aij}, FAijF^{\prime}_{Aij} and a state group BB with six states BijB_{ij}, BijB^{\prime}_{ij}, TBijT_{Bij}, TBijT^{\prime}_{Bij}, FBijF_{Bij}, FBijF^{\prime}_{Bij} for each clause CiC_{i} and variable xjx_{j}. Besides, there are 4m4m states Ai,n+1A_{i,n+1}, Ai,n+1A^{\prime}_{i,n+1}, Bi,n+1B_{i,n+1}, Bi,n+1B^{\prime}_{i,n+1} for each clause CiC_{i}. The transition distribution pp is as follows. For group AA, there are two transitions with same probability 12\frac{1}{2} leading from state AijA_{ij} to TAijT_{Aij} and FAijF_{Aij} respectively; similarly there are two transitions leading with probability 12\frac{1}{2} from AijA^{\prime}_{ij} to TAijT^{\prime}_{Aij} and FAijF^{\prime}_{Aij}. There’s only one transition leading with certainty from TAijT_{Aij}, FAijF_{Aij}, TAijT^{\prime}_{Aij}, FAijF^{\prime}_{Aij}, to Ai,j+1A_{i,j+1}, Ai,j+1A_{i,j+1}, Ai,j+1A^{\prime}_{i,j+1}, Ai,j+1A^{\prime}_{i,j+1} respectively with two exceptions: If xjx_{j} appears positively in CiC_{i}, the transition from TAijT^{\prime}_{Aij} is to Ai,j+1A_{i,j+1} instead of Ai,j+1A^{\prime}_{i,j+1}; and if xjx_{j} appears negatively, the transition from FAijF^{\prime}_{Aij} is to Ai,j+1A_{i,j+1}. For the state group BB, all the transitions imitate that in group AA only with different state names. For instance, there are two transitions leading with same probability 12\frac{1}{2} from state BijB_{ij} to TBijT_{Bij} and FBijF_{Bij} and so on.

Next we describe the observations Ω\Omega and the observation distribution. In state AijA_{ij}, AijA^{\prime}_{ij}, BijB_{ij}, BijB^{\prime}_{ij} with 1jn1\leq j\leq n, one can observe XjΩX_{j}\in\Omega with certainty. In state TAijT_{Aij}, TAijT^{\prime}_{Aij}, TBijT_{Bij}, TBijT^{\prime}_{Bij} with 1jn1\leq j\leq n, one can only observe TjΩT_{j}\in\Omega; similarly, the sole observation FjΩF_{j}\in\Omega can be observed in state FAijF_{Aij}, FAijF^{\prime}_{Aij}, FBijF_{Bij}, FBijF^{\prime}_{Bij} with 1jn1\leq j\leq n. In state Ai,n+1A_{i,n+1}, we have probability 45\frac{4}{5} to observe Ω\top\in\Omega and 15\frac{1}{5} to observe Ω\bot\in\Omega; while in state Bi,n+1B_{i,n+1}, we have probability 15\frac{1}{5} to observe \top and 45\frac{4}{5} to observe \bot. In state Ai,n+1A^{\prime}_{i,n+1} and Bi,n+1B^{\prime}_{i,n+1}, there are equal probabilities of 12\frac{1}{2} observing \top and \bot.

A11A^{\prime}_{11} X1X_{1}TA11T^{\prime}_{A11} T1T_{1}FA11F^{\prime}_{A11} F1F_{1}A12A^{\prime}_{12} X2X_{2}TA12T^{\prime}_{A12} T2T_{2}FA12F^{\prime}_{A12} F2F_{2}A13A^{\prime}_{13} (12),(12)\top(\frac{1}{2}),\bot(\frac{1}{2})A11A_{11} X1X_{1}TA11T_{A11} T1T_{1}FA11F_{A11} F1F_{1}A12A_{12} X2X_{2}TA12T_{A12} T2T_{2}FA12F_{A12} F2F_{2}A13A_{13} (45),(15)\top(\frac{4}{5}),\bot(\frac{1}{5})A21A^{\prime}_{21} X1X_{1}TA21T^{\prime}_{A21} T1T_{1}FA21F^{\prime}_{A21} F1F_{1}A22A^{\prime}_{22} X2X_{2}TA22T^{\prime}_{A22} T2T_{2}FA22F^{\prime}_{A22} F2F_{2}A23A^{\prime}_{23} (12),(12)\top(\frac{1}{2}),\bot(\frac{1}{2})A21A_{21} X1X_{1}TA21T_{A21} T1T_{1}FA21F_{A21} F1F_{1}A22A_{22} X2X_{2}TA22T_{A22} T2T_{2}FA22F_{A22} F2F_{2}A23A_{23} (45),(15)\top(\frac{4}{5}),\bot(\frac{1}{5})
Figure 4: Construction for (x1¬x2)¬x1(x_{1}\vee\neg x_{2})\wedge\neg x_{1}

Fig. 4 illustrates a part of the construction for the CNF formula (x1¬x2)¬x1(x_{1}\vee\neg x_{2})\wedge\neg x_{1}. State names are shown inside circles. Thin arrows represent transitions with probability 12\frac{1}{2}; thick arrows represent transitions with probability 11. Observation distributions are shown outside each states. For instance, X1X_{1} is observed with probability 11 at the state A11A^{\prime}_{11}. At the state A13A^{\prime}_{13}, \top and \bot are observed with probability 12\frac{1}{2} each.

In the figure, the left-hand side corresponds to the clause x1¬x2x_{1}\vee\neg x_{2}. Since the variable x1x_{1} appears positively in the clause, there is a transition from TA11T^{\prime}_{A11} to A12A_{12} with probability 11 according to the construction. Similarly, another transition from FA12F^{\prime}_{A12} to A13A_{13} with probability 11 is needed for the negative occurrence of the variable x2x_{2} in the clause. For the right-hand side corresponding to the clause ¬x1\neg x_{1}, a transition from FA21F^{\prime}_{A21} to A22A_{22} with probability 11 is added.

The construction for the state group BB is almost identical except the observation distributions on the states B13B_{13} and B23B_{23}. At the states B13B_{13} and B23B_{23}, \top and \bot can be observed with probabilities 15\frac{1}{5} and 45\frac{4}{5} respectively. The construction for the state group BB is not shown in the figure for brevity.

Then we describe the Pufferfish privacy scenario in this hidden Markov model. Assume that according to prior knowledge 𝔻\mathbb{D} and discriminative secrets 𝕊pairs\mathbb{S}_{\textmd{pairs}}, we only have one initial distribution pair D1D_{1} and D2D_{2} to compare. D1D_{1} induces a uniform distribution, to start from each member in the state set {Ai1}\{A^{\prime}_{i1}\} with 1im1\leq i\leq m, whose probability is 1m\frac{1}{m}. Similarly, in D2D_{2}, the probability starting from each member in the state set {Bi1}\{B^{\prime}_{i1}\} is also 1m\frac{1}{m} with 1im1\leq i\leq m. We set the parameter ϵ=ln(4)\epsilon=\ln(4).

Reduction.

The intuition is that starting from state Ai1A^{\prime}_{i1} or Bi1B^{\prime}_{i1}, the clause CiC_{i} is chosen and then the assignment of each variable will be considered one by one in this clause. Once the assignment of a variable xjx_{j} makes CiC_{i} satisfied, immediately state Ai,j+1A_{i,j+1} or Bi,j+1B_{i,j+1} is reached. So at last if state Ai,n+1A^{\prime}_{i,n+1} or Bi,n+1B^{\prime}_{i,n+1} is reached, it means that the clause CiC_{i} is not satisfied under this assignment. Now, we claim that Pr((D1)=ω¯)4×Pr((D2)=ω¯)\Pr(\mathcal{M}(D_{1})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{2})=\overline{\omega}) takes the maximal value 00 if and only if ω¯\overline{\omega} is the observation sequence X1A1X2AnX_{1}A_{1}X_{2}\ldots A_{n}\top such that formula F(x1,,xn)F(x_{1},\ldots,x_{n}) is satisfied under assignment with Ai{Ti,Fi}A_{i}\in\{T_{i},F_{i}\} for each variable xix_{i} (Similar analysis applies for Pr((D2)=ω¯)4×Pr((D1)=ω¯)\Pr(\mathcal{M}(D_{2})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{1})=\overline{\omega}) except that it takes the maximal value 00 with \bot as the last observation).

We argue that 00 is the maximal value. It’s easy to see that if we take an arbitrary observation sequence ω¯=X1A1X2\overline{\omega}=X_{1}A_{1}X_{2}\ldots, as long as \top or \bot hasn’t been observed, Pr((D1)=ω¯)4×Pr((D2)=ω¯)<0\Pr(\mathcal{M}(D_{1})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{2})=\overline{\omega})<0. That’s because the state group BB just imitate the state group AA before reaching the state Bi,n+1B_{i,n+1} and Bi,n+1B^{\prime}_{i,n+1}. Thus the maximal value must be less than 0 or be obtained after we observe \top or \bot.

Then we consider ω¯=X1A1X2An\overline{\omega}=X_{1}A_{1}X_{2}\ldots A_{n}\top. Note that if CiC_{i} is satisfied under observation ω¯\overline{\omega}, we start from Ai1A^{\prime}_{i1} and Bi1B^{\prime}_{i1} both with probability 1m\frac{1}{m}, finally reaching Ai,n+1A_{i,n+1} and Bi,n+1B_{i,n+1} with probabilities 2n×1m×452^{-n}\times\frac{1}{m}\times\frac{4}{5} and 2n×1m×152^{-n}\times\frac{1}{m}\times\frac{1}{5} respectively; if CiC_{i} is not satisfied, we finally reach Ai,n+1A^{\prime}_{i,n+1} and Bi,n+1B^{\prime}_{i,n+1} with equal probabilities of 2n×1m×122^{-n}\times\frac{1}{m}\times\frac{1}{2}. Thus a satisfied clause will contribute 2n×1m×454×2n×1m×15=02^{-n}\times\frac{1}{m}\times\frac{4}{5}-4\times 2^{-n}\times\frac{1}{m}\times\frac{1}{5}=0 to the result; while if some clause is not satisfied, Pr((D1)=ω¯)4×Pr((D2)=ω¯)\Pr(\mathcal{M}(D_{1})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{2})=\overline{\omega}) is strictly less than 00. Therefore, if we choose a observation sequence ended with \top such that all the clauses are satisfied, Pr((D1)=ω¯)4×Pr((D2)=ω¯)\Pr(\mathcal{M}(D_{1})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{2})=\overline{\omega}) will take the maximal value 0. If we consider ω¯=X1A1X2An\overline{\omega}=X_{1}A_{1}X_{2}\ldots A_{n}\bot, similar analysis concludes that Pr((D1)=ω¯)4×Pr((D2)=ω¯)\Pr(\mathcal{M}(D_{1})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{2})=\overline{\omega}) will be strictly less than 00. This indicates that 00 is the maximal value of Pr((D1)=ω¯)4×Pr((D2)=ω¯)\Pr(\mathcal{M}(D_{1})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{2})=\overline{\omega}) among all the observation sequences.

Finally from the process above, it’s easy to see that Pr((D1)=ω¯)4×Pr((D2)=ω¯)\Pr(\mathcal{M}(D_{1})=\overline{\omega})-4\times\Pr(\mathcal{M}(D_{2})=\overline{\omega}) takes the maximal value 00 if and only if F(x1,,xn)F(x_{1},\ldots,x_{n}) is satisfied under observation sequence ω¯=X1A1X2An\overline{\omega}=X_{1}A_{1}X_{2}\ldots A_{n}\top with assignment Ai{Ti,Fi}A_{i}\in\{T_{i},F_{i}\} for each variable xix_{i}. Since determining whether Pufferfish privacy is preserved is equivalent to determining whether the maximal value is above 00, we prove that the general problem for ϵ\epsilon-Pufferfish privacy is NP-hard.

Appendix 2

In the literature, if the perturbed query result is smaller than the perturbed threshold, noise will be added into next query, the result of which is uncertain. Thus, nondeterminism is required here to choose the next query and  [24] uses a Markov decision process to model the algorithm. In order to model nondeterminism in an HMM, we assign equal probabilities to return to all the possible queries. For instance, from the state t~1r~0\tilde{t}_{1}\tilde{r}_{0}, the probabilities of going to states t~1r~0\tilde{t}_{1}\tilde{r}_{0}, t~1r~1\tilde{t}_{1}\tilde{r}_{1} and t~1r~2\tilde{t}_{1}\tilde{r}_{2} are all 13\frac{1}{3}. Although this is slightly different from Algorithm 3, we will prove using this model to avoid nondeterministic choices, whether Algorithm 3 satisfies ϵ\epsilon-differential privacy can still be verified. Before that, we first state the consistency of the outputs executed in the algorithm and the observation sequences in the model.

Lemma 1

Assume that there are two neighboring databases, 𝐝¯1\overline{\mathbf{d}}_{1} and 𝐝¯2\overline{\mathbf{d}}_{2}, along with queries fif_{i} and threshold tt given as input of Algorithm 3 and the output is An=a1a2an=A_{n}=a_{1}a_{2}...a_{n}=\bot\bot...\top with n1n\geq 1. Then there is an initial distribution pair d1d_{1} and d2d_{2} and an one-to-one mapping observation sequence oko_{k} such that (13)2n+1Pra(An|𝐝¯1)=Prm(on|d1)(\frac{1}{3})^{2n+1}\Pr_{a}(A_{n}|\overline{\mathbf{d}}_{1})=\Pr_{m}(o_{n}|d_{1}) and (13)2n+1Pra(An|𝐝¯2)=Prm(on|d2)(\frac{1}{3})^{2n+1}\Pr_{a}(A_{n}|\overline{\mathbf{d}}_{2})=\Pr_{m}(o_{n}|d_{2}), where Pra\Pr_{a} denotes the probability of getting the outputs in Algorithm 3 and Prm\Pr_{m} denotes the probability of getting the observation sequence in the hmm model in Fig. 3.

Proof

We prove by induction on the length of the output An=A_{n}=\bot\bot...\top with nn symbols. Assume the query results of neighboring databases 𝐝¯1\overline{\mathbf{d}}_{1} and 𝐝¯2\overline{\mathbf{d}}_{2} are i1,i2,i_{1},i_{2},... and j1,j2,j_{1},j_{2},..., with |ikjk|<=1|i_{k}-j_{k}|<=1 for any fixed kk.

Base case: n=1n=1. If A1=A_{1}=\top, the algorithm halts after comparing the first perturbed query with the perturbed threshold. Naturally, there’s only one state ttri1t_{t}r_{i_{1}} with probability 11 and the others with probability 00 in the distribution d1d_{1}, and only one state ttrj1t_{t}r_{j_{1}} with probability 11 and the others with 00 in d2d_{2}. Starting from these initial distributions, we first observe a \llcorner\!\!\lrcorner and then transit to the distribution with states t~tri1\tilde{t}_{t^{\prime}}r_{i_{1}} and t~trj1\tilde{t}_{t^{\prime}}r_{j_{1}} having non-zero probabilities, where tt^{\prime} can be all possible values of perturbed threshold. The only observation shared by theses states is i1j1i_{1}j_{1}, with observing probability 13\frac{1}{3}. Then queries are then added by noise and we come to a new distribution of perturbed query results and threshold t~tr~k\tilde{t}_{t^{\prime}}\tilde{r}_{k^{\prime}}, where kk^{\prime} can be all possible values of perturbed query result. This time we only choose states where perturbed query results are higher than the perturbed threshold and all these states share an observation of \top with observing probability 11. Thus, under the observation sequence o1=,i1j1,o_{1}=\llcorner\!\!\lrcorner,i_{1}j_{1},\top, we follow the steps of Algorithm 3 to make transitions in the model and considering the observation probabilities, we can directly get 13Pra(A1|𝐝¯1)=Prm(o1|d1)\frac{1}{3}\Pr_{a}(A_{1}|\overline{\mathbf{d}}_{1})=\Pr_{m}(o_{1}|d_{1}) and 13Pra(A1|𝐝¯2)=Prm(o1|d2)\frac{1}{3}\Pr_{a}(A_{1}|\overline{\mathbf{d}}_{2})=\Pr_{m}(o_{1}|d_{2}). Note that if A1=A_{1}=\bot, then under the observation sequence o1=,i1j1,o_{1}=\llcorner\!\!\lrcorner,i_{1}j_{1},\bot, we can still conclude in a similar way that 13Pra(A1|𝐝¯1)=Prm(o1|d1)\frac{1}{3}\Pr_{a}(A_{1}|\overline{\mathbf{d}}_{1})=\Pr_{m}(o_{1}|d_{1}) and 13Pra(A1|𝐝¯2)=Prm(o1|d2)\frac{1}{3}\Pr_{a}(A_{1}|\overline{\mathbf{d}}_{2})=\Pr_{m}(o_{1}|d_{2}).

Induction step: Assume we have (13)2n+1Pra(An|𝐝¯1)=Prm(on|d1)(\frac{1}{3})^{2n+1}\Pr_{a}(A_{n}|\overline{\mathbf{d}}_{1})=\Pr_{m}(o_{n}|d_{1}) and (13)2n+1(\frac{1}{3})^{2n+1} Pra(An|𝐝¯2)\Pr_{a}(A_{n}|\overline{\mathbf{d}}_{2}) =Prm=\Pr_{m}((ono_{n}||OPENd2)d_{2}) with nn symbols in An=A_{n}=\bot\bot...\bot. If we observe An+1=A_{n+1}=\bot\bot...\top with n+1n+1 symbols in the algorithm, by induction hypothesis, we can immediately conclude that with on=,i1j1,,i2j2,,,injn,o_{n}=\llcorner\!\!\lrcorner,i_{1}j_{1},\bot,i_{2}j_{2},\bot,...,i_{n}j_{n},\bot, (13)2n+1Pra(An|𝐝¯1)=Prm(on|d1)(\frac{1}{3})^{2n+1}\Pr_{a}(A_{n}|\overline{\mathbf{d}}_{1})=\Pr_{m}(o_{n}|d_{1}) and (13)2n+1Pra(An|𝐝¯2)=Prm(on|d2)(\frac{1}{3})^{2n+1}\Pr_{a}(A_{n}|\overline{\mathbf{d}}_{2})=\Pr_{m}(o_{n}|d_{2}). Since the last symbol in AnA_{n} is \bot, new query fn+1f_{n+1} must be posed in the algorithm and the new query results in+1i_{n+1}, jn+1j_{n+1} are going to be perturbed and compared with the perturbed threshold. In the hmm model, after observing the nnth \bot in the current distribution, transition to the new distribution occurs where states t~trin+1\tilde{t}_{t^{\prime}}r_{i_{n+1}} and t~trjn+1\tilde{t}_{t^{\prime}}r_{j_{n+1}} having non-zero probabilities, with transition probability 13\frac{1}{3}. And the common observation in theses states is in+1jn+1i_{n+1}j_{n+1} with observing probability 13\frac{1}{3}. Then queries are further perturbed and we only filter the states t~tr~k\tilde{t}_{t^{\prime}}\tilde{r}_{k^{\prime}} where the perturbed query results are above the perturbed threshold, with the common observation \top. Since we follow the steps of the algorithm to make transitions and add two multipliers of 13\frac{1}{3} , we can conclude that under the sequence on+1=on,in+1jn+1,o_{n+1}=o_{n},i_{n+1}j_{n+1},\top, (13)2(n+1)+1Pra(An+1|𝐝¯1)=Prm(on+1|d1)(\frac{1}{3})^{2(n+1)+1}\Pr_{a}(A_{n+1}|\overline{\mathbf{d}}_{1})=\Pr_{m}(o_{n+1}|d_{1}) and (13)2(n+1)+1Pra(An+1|𝐝¯2)=Prm(on+1|d2)(\frac{1}{3})^{2(n+1)+1}\Pr_{a}(A_{n+1}|\overline{\mathbf{d}}_{2})=\Pr_{m}(o_{n+1}|d_{2}).

Note that the above mapping process is one-to-one correspondence. Thus the proof is finished.

Then we can prove the differential privacy results.

Theorem 8.1

The model used in Fig. 3 satisfies ϵ\epsilon-differential privacy, i.e, Algorithm 1 returns “unsat” for all the feasible observation sequences of lengths kk, if and only if Algorithm 3 satisfies ϵ\epsilon-differential privacy.

Proof

Feasible observation sequences of lengths kk mean that Algorithm 1 only checks paths that could represent complete execution paths of the Algorithm 3. For instance kk can’t be 11, which only represents the initial distributions of two databases in Fig. 3. Moreover, the observation sequences can’t contain any of symbols \spadesuit, \heartsuit, \diamondsuit, \clubsuit: paths contain these symbols don’t represent practical executions in the Algorithm 3. Since one of the neighboring data distributions must have probability 00 for the unique appearance of these symbols in the half part of Fig. 3, to filter out these observation paths, one just needs to add constraints that the observation probabilities can’t be strictly equal to 00.

“If” direction: If the algorithm satisfies ϵ\epsilon-differential privacy, the probabilities of observing any length of outputs A=A=\bot\bot...\top are mathematically similar starting from neighboring databases, 𝐝¯1\overline{\mathbf{d}}_{1} and 𝐝¯2\overline{\mathbf{d}}_{2}. That is,

eϵPra(A|𝐝¯2)Pra(A|𝐝¯1)eϵPra(A|𝐝¯2).e^{-\epsilon}\Pr_{a}(A|\overline{\mathbf{d}}_{2})\leq\Pr_{a}(A|\overline{\mathbf{d}}_{1})\leq e^{\epsilon}\Pr_{a}(A|\overline{\mathbf{d}}_{2}). (6)

Using Lemma 1, we can directly conclude that

eϵPrm(o|d2)Prm(o|d1)eϵPrm(o|d2).e^{-\epsilon}\Pr_{m}(o|d_{2})\leq\Pr_{m}(o|d_{1})\leq e^{\epsilon}\Pr_{m}(o|d_{2}). (7)

Here d1d_{1}, d2d_{2} and oo correspond to 𝐝¯1\overline{\mathbf{d}}_{1}, 𝐝¯2\overline{\mathbf{d}}_{2} and AA in Lemma 1. Since AA can be any possible output, each can be mapped into an observation sequence , which makes up all the feasible observation sequences in the model. This actually verifies that our model satisfies ϵ\epsilon-differential privacy.

“Only if” direction: If the algorithm doesn’t satisfy ϵ\epsilon-differential privacy, there’s a sequence A=A=\bot\bot...\top with observing probabilities differing too much from initial distribution 𝐝¯1\overline{\mathbf{d}}_{1} and 𝐝¯2\overline{\mathbf{d}}_{2}. By applying the similar analysis procedure, we can prove that the model in Fig. 3 doesn’t satisfy ϵ\epsilon-differential privacy.

References

  • [1] Albarghouthi, A., Hsu, J.: Synthesizing coupling proofs of differential privacy. Proceedings of the ACM on Programming Languages 2(POPL), 1–30 (2017)
  • [2] Apple: About privacy and location services in ios and ipados. https://support.apple.com/en-us/HT203033/ (2020), [Online; accessed 9-September-2021]
  • [3] Barthe, G., Chadha, R., Jagannath, V., Sistla, A., Viswanathan, M.: Deciding differential privacy for programs with finite inputs and outputs. pp. 141–154 (07 2020). https://doi.org/10.1145/3373718.3394796
  • [4] Barthe, G., Chadha, R., Jagannath, V., Sistla, A.P., Viswanathan, M.: Automated methods for checking differential privacy. CoRR abs/1910.04137 (2019), http://arxiv.org/abs/1910.04137
  • [5] Barthe, G., Gaboardi, M., Grégoire, B., Hsu, J., Strub, P.Y.: Proving differential privacy via probabilistic couplings (01 2016)
  • [6] Barthe, G., Gaboardi, M., Hsu, J., Pierce, B.: Programming language techniques for differential privacy. ACM SIGLOG News 3(1), 34–53 (Feb 2016). https://doi.org/10.1145/2893582.2893591
  • [7] Barthe, G., Köpf, B., Olmedo, F., Zanella Béguelin, S.: Probabilistic relational reasoning for differential privacy. p. 97–110. POPL ’12 (2012). https://doi.org/10.1145/2103656.2103670
  • [8] Barthe, G., Köpf, B., Olmedo, F., Zanella Béguelin, S.: Probabilistic relational reasoning for differential privacy. SIGPLAN Not. 47(1), 97–110 (Jan 2012). https://doi.org/10.1145/2103621.2103670
  • [9] Bichsel, B., Gehr, T., Drachsler-Cohen, D., Tsankov, P., Vechev, M.: Dp-finder: Finding differential privacy violations by sampling and optimization. pp. 508–524 (10 2018). https://doi.org/10.1145/3243734.3243863
  • [10] Bichsel, B., Steffen, S., Bogunovic, I., Vechev, M.: Dp-sniper: Black-box discovery of differential privacy violations using classifiers. In: SP’21). pp. 391–409 (2021). https://doi.org/10.1109/SP40001.2021.00081
  • [11] Chen, Y., Machanavajjhala, A.: On the privacy properties of variants on the sparse vector technique. CoRR abs/1508.07306 (2015), http://arxiv.org/abs/1508.07306
  • [12] Chistikov, D., Kiefer, S., Murawski, A.S., Purser, D.: The Big-O Problem for Labelled Markov Chains and Weighted Automata. In: CONCUR 2020. Leibniz International Proceedings in Informatics (LIPIcs), vol. 171, pp. 41:1–41:19 (2020). https://doi.org/10.4230/LIPIcs.CONCUR.2020.41
  • [13] Ding, B., Kulkarni, J., Yekhanin, S.: Collecting telemetry data privately. p. 3574–3583. NIPS’17 (2017)
  • [14] Ding, Z., Wang, Y., Wang, G., Zhang, D., Kifer, D.: Detecting violations of differential privacy. In: Backes, M., Wang, X. (eds.) CCS. pp. 475–489 (2018)
  • [15] Dolzmann, A., Sturm, T.: Redlog: Computer algebra meets computer logic. SIGSAM Bull. 31(2), 2–9 (Jun 1997). https://doi.org/10.1145/261320.261324
  • [16] Dwork, C., Roth, A.: The algorithmic foundations of differential privacy. Foundations and Trends in Theoretical Computer Science 9(3–4), 211–407 (2014)
  • [17] Dwork, C.: Differential privacy. In: ICALP. LNCS, vol. 4052, pp. 1–12 (2006)
  • [18] Farina, G.P., Chong, S., Gaboardi, M.: Coupled relational symbolic execution for differential privacy. In: Programming Languages and Systems. pp. 207–233 (2021)
  • [19] Gaboardi, M., Nissim, K., Purser, D.: The Complexity of Verifying Loop-Free Programs as Differentially Private. In: ICALP 2020. Leibniz International Proceedings in Informatics (LIPIcs), vol. 168, pp. 129:1–129:17 (2020). https://doi.org/10.4230/LIPIcs.ICALP.2020.129
  • [20] Ghosh, A., Roughgarden, T., Sundararajan, M.: Universally utility-maximizing privacy mechanisms. In: STOC. pp. 351–360. ACM, New York, NY, USA (2009)
  • [21] Ghosh, A., Roughgarden, T., Sundararajan, M.: Universally utility-maximizing privacy mechanisms. SIAM Journal of Computing 41(6), 1673–1693 (2012)
  • [22] Kifer, D., Machanavajjhala, A.: No free lunch in data privacy. In: SIGMOD. pp. 193–204 (2011)
  • [23] Kifer, D., Machanavajjhala, A.: Pufferfish: A framework for mathematical privacy definitions. ACM Trans. Database Syst. 39(1), 3:1–3:36 (2014)
  • [24] Liu, D., Wang, B., Zhang, L.: Model checking differentially private properties. In: APLAS. LNCS, vol. 11275, pp. 394–414 (2018)
  • [25] Lyu, M., Su, D., Li, N.: Understanding the sparse vector technique for differential privacy. Proc. VLDB Endow. 10(6), 637–648 (Feb 2017). https://doi.org/10.14778/3055330.3055331
  • [26] McIver, A., Morgan, C.: Proving that programs are differentially private. In: Programming Languages and Systems. pp. 3–18 (2019)
  • [27] Mironov, I.: On significance of the least significant bits for differential privacy. In: CCS’12. pp. 650–661 (2012)
  • [28] de Moura, L., Bjørner, N.: Z3: An efficient smt solver. In: Tools and Algorithms for the Construction and Analysis of Systems. pp. 337–340 (2008)
  • [29] Papadimitriou, C.H., Tsitsiklis, J.N.: The complexity of markov decision processes. Mathematics of Operations Research 12(3), 441–450 (1987)
  • [30] Rabiner, L.R.: A tutorial on hidden markov models and selected applications in speech recognition. Proc. of IEEE 77(2), 257–286 (1989)
  • [31] Wang, Y., Ding, Z., Kifer, D., Zhang, D.: Checkdp: An automated and integrated approach for proving differential privacy or finding precise counterexamples. p. 919–938. CCS ’20 (2020). https://doi.org/10.1145/3372297.3417282
  • [32] Wang, Y., Ding, Z., Wang, G., Kifer, D., Zhang, D.: Proving differential privacy with shadow execution. In: PLDI’19. pp. 655–669 (2019)
  • [33] Zhang, D., Kifer, D.: Lightdp: towards automating differential privacy proofs. In: POPL’17. vol. 52, pp. 888–901 (2017)
  • [34] Zhang, H., Roth, E., Haeberlen, A., Pierce, B.C., Roth, A.: Testing differential privacy with dual interpreters. Proc. ACM Program. Lang. 4(OOPSLA) (2020). https://doi.org/10.1145/3428233