Documentation

CslibFrontier.Privacy.DifferentialPrivacy.Reconstruction

Reconstruction attacks #

A database holds one secret bit per person, d : ι → Bool. A subset-count query asks for the number of ones among the rows in a set S (subsetCount d S). Answers r S have distortion at most E when |r S - subsetCount d S| ≤ E for every S (SubsetCountsWithin r d E).

Theorem ([DworkRoth2014, Theorem 8.1]). Answers to all subset-count queries with distortion at most E let an adversary reconstruct the database in all but 4 E positions. The adversary (reconstruct) outputs any database whose subset counts are all within E of the answers; the true database is a candidate, so one exists. Two databases consistent with the same answers differ in at most 4 E rows (hammingDist_le_of_subsetCountsWithin). Dwork and Roth credit this attack to Dinur and Nissim [DworkRoth2014, §8.3].

The consequence for differential privacy is a standard derivation, following Dwork and Roth's remark that lower bounds for preventing blatant non-privacy apply to every differentially private mechanism [DworkRoth2014, §8.1]. Let G be (ε, δ)-private for Hamming adjacency with outputs in ι → Bool. Flipping the secret bit of row i gives an adjacent database, so G guesses that bit correctly with probability at most (exp ε + δ) / (1 + exp ε) on average over a uniformly random database. Summed over the rows, the expected number of correct bits is at most n (exp ε + δ) / (1 + exp ε) on average (DifferentiallyPrivate.mul_sum_sum_toOuterMeasure_le), for n rows. If G lands within Hamming distance t of the truth with probability at least q on every database, then (1 + exp ε) (n - t) q ≤ n (exp ε + δ) (DifferentiallyPrivate.mul_card_sub_mul_le).

Applied to the reconstruction adversary: if an (ε, δ)-private mechanism answers all 2 ^ n subset-count queries with distortion at most E with probability at least q on every database, then (1 + exp ε) (n - 4 E) q ≤ n (exp ε + δ) (DifferentiallyPrivate.mul_card_sub_mul_le_of_subsetCountsWithin). If the answers have distortion at most E with probability one on every database, then E ≥ n (1 - δ) / (4 (1 + exp ε)) (DifferentiallyPrivate.card_mul_one_sub_le_of_subsetCountsWithin), which is linear in n. This bounds the distortion that can be guaranteed uniformly over all databases, not the distortion on a particular one: a constant mechanism is (0, 0)-private and answers exactly on the database it was built from. In particular, exact answers on every database are not (ε, δ)-private for any δ < 1 once n ≥ 1.

Main definitions #

Main results #

References #

def Cslib.Privacy.subsetCount {ι : Type u_1} (d : ι → Bool) (S : Finset ι) :

The answer to the subset-count query S on the database d: the number of rows in S whose secret bit is set [DworkRoth2014, §8.1].

theorem Cslib.Privacy.subsetCount_apply {ι : Type u_1} (d : ι → Bool) (S : Finset ι) :
subsetCount d S = {i ∈ S | d i = true}.card

Unfolding subsetCount.

def Cslib.Privacy.SubsetCountsWithin {ι : Type u_1} (r : Finset ι → ℝ) (d : ι → Bool) (E : ℝ) :

The answers r give every subset count of d with distortion at most E.

theorem Cslib.Privacy.subsetCountsWithin_iff {ι : Type u_1} {r : Finset ι → ℝ} {d : ι → Bool} {E : ℝ} :
SubsetCountsWithin r d E ↔ ∀ (S : Finset ι), |r S - ↑(subsetCount d S)| ≤ E

Unfolding SubsetCountsWithin.

theorem Cslib.Privacy.subsetCountsWithin_subsetCount {ι : Type u_1} (d : ι → Bool) :
SubsetCountsWithin (fun (S : Finset ι) => ↑(subsetCount d S)) d 0

Exact answers have distortion 0.

theorem Cslib.Privacy.SubsetCountsWithin.nonneg {ι : Type u_1} {r : Finset ι → ℝ} {d : ι → Bool} {E : ℝ} (h : SubsetCountsWithin r d E) :
0 ≤ E

Distortion bounds are nonnegative.

theorem Cslib.Privacy.hammingDist_le_of_subsetCountsWithin {ι : Type u_1} [Fintype ι] {r : Finset ι → ℝ} {c d : ι → Bool} {E : ℝ} (hc : SubsetCountsWithin r c E) (hd : SubsetCountsWithin r d E) :
↑(hammingDist c d) ≤ 4 * E

[DworkRoth2014, Theorem 8.1]. Two databases whose subset counts are both within E of the same answers differ in at most 4 E rows.

noncomputable def Cslib.Privacy.reconstruct {ι : Type u_1} [Fintype ι] (E : ℝ) (r : Finset ι → ℝ) :
ι → Bool

The reconstruction adversary of [DworkRoth2014, Theorem 8.1]: given answers r to all subset-count queries, output a database whose subset counts are all within E of r, if there is one (and the all-false database otherwise). It is not efficient: it searches all databases.

theorem Cslib.Privacy.hammingDist_reconstruct_le {ι : Type u_1} [Fintype ι] {r : Finset ι → ℝ} {d : ι → Bool} {E : ℝ} (hd : SubsetCountsWithin r d E) :
↑(hammingDist (reconstruct E r) d) ≤ 4 * E

The reconstruction adversary errs in at most 4 E positions when the answers have distortion at most E [DworkRoth2014, Theorem 8.1].

theorem Cslib.Privacy.DifferentiallyPrivate.mul_sum_toOuterMeasure_apply_eq_le {ι : Type u_1} [Fintype ι] {G : (ι → Bool) → PMF (ι → Bool)} {ε : ℝ} {δ : ENNReal} [DecidableEq ι] (h : DifferentiallyPrivate HammingAdjacent G ε δ) (i : ι) :
(1 + ENNReal.ofReal (Real.exp ε)) * ∑ d : ι → Bool, (G d).toOuterMeasure {c : ι → Bool | c i = d i} ≤ 2 ^ Fintype.card ι * (ENNReal.ofReal (Real.exp ε) + δ)

A private mechanism guesses few secret bits. If G is (ε, δ)-private for Hamming adjacency, then summed over all databases d, the probability that G d guesses the bit of row i correctly is at most 2 ^ n (exp ε + δ) / (1 + exp ε), n being the number of rows. The proof pairs each database with the one whose bit i is flipped.

theorem Cslib.Privacy.DifferentiallyPrivate.mul_sum_sum_toOuterMeasure_le {ι : Type u_1} [Fintype ι] {G : (ι → Bool) → PMF (ι → Bool)} {ε : ℝ} {δ : ENNReal} [DecidableEq ι] (h : DifferentiallyPrivate HammingAdjacent G ε δ) :
(1 + ENNReal.ofReal (Real.exp ε)) * ∑ d : ι → Bool, ∑ i : ι, (G d).toOuterMeasure {c : ι → Bool | c i = d i} ≤ 2 ^ Fintype.card ι * ↑(Fintype.card ι) * (ENNReal.ofReal (Real.exp ε) + δ)

A private mechanism guesses few secret bits on average. If G is (ε, δ)-private for Hamming adjacency on databases of n rows, then over a uniformly random database the expected number of rows whose bit G guesses correctly is at most n (exp ε + δ) / (1 + exp ε); in unnormalized form, (1 + exp ε) ∑ d ∑ i Pr[(G d) i = d i] ≤ 2 ^ n n (exp ε + δ).

theorem Cslib.Privacy.DifferentiallyPrivate.mul_card_sub_mul_le {ι : Type u_1} [Fintype ι] {G : (ι → Bool) → PMF (ι → Bool)} {ε : ℝ} {δ : ENNReal} (h : DifferentiallyPrivate HammingAdjacent G ε δ) {t : ℕ} {q : ENNReal} (hq : ∀ (d : ι → Bool), q ≤ (G d).toOuterMeasure {c : ι → Bool | hammingDist c d ≤ t}) :

A private mechanism cannot reconstruct. If G is (ε, δ)-private for Hamming adjacency on databases of n rows and, on every database d, G d is within Hamming distance t of d with probability at least q, then (1 + exp ε) (n - t) q ≤ n (exp ε + δ).

theorem Cslib.Privacy.DifferentiallyPrivate.mul_card_sub_mul_le_real {ι : Type u_1} [Fintype ι] {G : (ι → Bool) → PMF (ι → Bool)} {ε : ℝ} {δ : ENNReal} (h : DifferentiallyPrivate HammingAdjacent G ε δ) (hδ : δ ≠ ⊤) {r q : ℝ} (hq0 : 0 ≤ q) (hq : ∀ (d : ι → Bool), ENNReal.ofReal q ≤ (G d).toOuterMeasure {c : ι → Bool | ↑(hammingDist c d) ≤ r}) :
(1 + Real.exp ε) * (↑(Fintype.card ι) - r) * q ≤ ↑(Fintype.card ι) * (Real.exp ε + δ.toReal)

A private mechanism cannot reconstruct, in real numbers: if G is (ε, δ)-private for Hamming adjacency on databases of n rows with δ ≠ ⊤ and, on every database d, G d is within Hamming distance r of d with probability at least q ≥ 0, then (1 + exp ε) (n - r) q ≤ n (exp ε + δ). This is DifferentiallyPrivate.mul_card_sub_mul_le for t = ⌊r⌋₊, moved to ℝ.

theorem Cslib.Privacy.DifferentiallyPrivate.mul_card_sub_mul_le_of_subsetCountsWithin {ι : Type u_1} [Fintype ι] {ε : ℝ} {δ : ENNReal} {R : Type v} {M : (ι → Bool) → PMF R} (h : DifferentiallyPrivate HammingAdjacent M ε δ) (hδ : δ ≠ ⊤) (ans : R → Finset ι → ℝ) {E q : ℝ} (hq0 : 0 ≤ q) (hq : ∀ (d : ι → Bool), ENNReal.ofReal q ≤ (M d).toOuterMeasure {o : R | SubsetCountsWithin (ans o) d E}) :
(1 + Real.exp ε) * (↑(Fintype.card ι) - 4 * E) * q ≤ ↑(Fintype.card ι) * (Real.exp ε + δ.toReal)

Private answers to all subset-count queries are inaccurate. Let M be (ε, δ)-private for Hamming adjacency on databases of n rows, with outputs from which ans reads answers to all subset-count queries. If on every database the answers have distortion at most E with probability at least q, then (1 + exp ε) (n - 4 E) q ≤ n (exp ε + δ). This combines the reconstruction attack [DworkRoth2014, Theorem 8.1] with DifferentiallyPrivate.mul_card_sub_mul_le (a standard derivation; see [DworkRoth2014, §8.1]).

theorem Cslib.Privacy.DifferentiallyPrivate.card_mul_one_sub_le_of_subsetCountsWithin {ι : Type u_1} [Fintype ι] {ε : ℝ} {δ : ENNReal} {R : Type v} {M : (ι → Bool) → PMF R} (h : DifferentiallyPrivate HammingAdjacent M ε δ) (hδ : δ ≠ ⊤) (ans : R → Finset ι → ℝ) {E : ℝ} (hE : ∀ (d : ι → Bool), (M d).toOuterMeasure {o : R | SubsetCountsWithin (ans o) d E} = 1) :
↑(Fintype.card ι) * (1 - δ.toReal) ≤ 4 * E * (1 + Real.exp ε)

Private answers to all subset-count queries have linear distortion. If an (ε, δ)-private mechanism for Hamming adjacency on databases of n rows answers all subset-count queries with distortion at most E with probability one on every database, then n (1 - δ) ≤ 4 E (1 + exp ε), that is, E ≥ n (1 - δ) / (4 (1 + exp ε)). For ε = δ = 0 this forces E ≥ n / 8. The bound is on a distortion guaranteed uniformly over all databases: on a single database a constant mechanism, which is (0, 0)-private, can answer exactly. Exact answers on every database (E = 0) are not (ε, δ)-private for δ < 1 once n ≥ 1.