Quiz 2

Privacy Mechanisms — k-Anonymity, l-Diversity, Differential Privacy

709 words
4 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Privacy Mechanisms — k-Anonymity, l-Diversity, Differential Privacy ## 🎯 Learning Objectives - Define k-anonymity and identify attacks on anonymized data - Explain differential privacy and its properties - Apply Laplace mechanism for numerical queries - Compare privacy guarantees of different mechanisms * * * ##...

Privacy Mechanisms — k-Anonymity, l-Diversity, Differential Privacy

🎯 Learning Objectives

  • Define k-anonymity and identify attacks on anonymized data
  • Explain differential privacy and its properties
  • Apply Laplace mechanism for numerical queries
  • Compare privacy guarantees of different mechanisms

1. k-Anonymity

1.1 Intuition

A dataset is k-anonymous if each record is indistinguishable from at least k-1 other records with respect to quasi-identifiers. This prevents linking attacks where an adversary re-identifies individuals by joining quasi-identifier values with public databases.

1.2 Example

Original data:
NameZIPAgeDisease
Alice5371529Flu
Bob5371532Diabetes
Carol5371530Flu
Dave5371043Cancer
Eve5371041Flu
After 3-anonymization (generalize ZIP and Age):
ZIPAgeDisease
5371*30-35Flu
5371*30-35Diabetes
5371*30-35Flu
5371*41-45Cancer
5371*41-45Flu
Limitations:
  • Homogeneity attack: If all k records have the same sensitive value, the value is known.
  • Background knowledge: If the adversary knows something about the individual, they can narrow possibilities.

2. l-Diversity

Extends k-anonymity: each equivalence class must have at least l "well-represented" sensitive values. Example: 3-diversity requires each group to have at least 3 different disease values, or 3 different types of diseases.

3. Differential Privacy

3.1 Intuition

Differential privacy guarantees that the output of a query changes very little whether any single individual is in the dataset or not. This means an adversary cannot infer much about any individual, even with arbitrary background knowledge.

3.2 Formal Definition

A randomized mechanism M\mathcal{M} satisfies ε\varepsilon-differential privacy if for all datasets DD and DD' differing in at most one row (neighbors):
Pr[M(D)S]eε×Pr[M(D)S]\Pr[\mathcal{M}(D) \in S] \leq e^\varepsilon \times \Pr[\mathcal{M}(D') \in S]
Smaller ε\varepsilon = stronger privacy.
ε\varepsilonPrivacy LevelTypical Use
0.01 - 0.1Very strongCensus data
0.1 - 1.0ModerateResearch data
1.0 - 10WeakPublic statistics

3.3 Laplace Mechanism

For a numeric query f:DRf: D \to \mathbb{R}, add Laplace noise:
M(D)=f(D)+Lap(Δfε)\mathcal{M}(D) = f(D) + \text{Lap}\left(\frac{\Delta f}{\varepsilon}\right)
Where Δf\Delta f is the global sensitivity — maximum change in f when one record changes. Example: Count query (how many people have cancer?) Δf=1\Delta f = 1 (one person changes the count by at most 1) Count = 500. Add noise: Lap(1/0.1) = Lap(10). Output ≈ 500 ± ~7 (std dev = √2 × 10 ≈ 14).

3.4 Exponential Mechanism

For non-numeric queries (e.g., "what is the most common disease?"), the exponential mechanism selects an output with probability proportional to its quality score.

4. 📝 Practice Questions

Q1: What attack does k-anonymity fail to prevent when all k records in a group have the same sensitive value?
Answer: Homogeneity attack. If all k individuals in an equivalence class have HIV, an adversary who identifies the class knows the sensitive value with certainty, regardless of k. Q2: Calculate the Laplace noise scale for a SUM query with ε=0.5, where salaries range from 0 to $500,000.
Answer: Global sensitivity of SUM = max(salary) = 500,000(removingthehighestearnerchangessumbyatmost500,000 (removing the highest earner changes sum by at most500K). Noise scale = Δf/ε = 500,000/0.5 = 1,000,000. Laplace(1,000,000) has standard deviation ≈ 1,414,000 — very noisy! Q3: What is the key difference between k-anonymity and differential privacy?
Answer: k-anonymity is a syntactic property of the output (every group has k records). Differential privacy is a property of the mechanism (output distribution changes little when one record changes). Differential privacy provides a formal worst-case guarantee against any adversary, while k-anonymity can be broken by homogeneity and background knowledge attacks. Q4: If ε=0 and the mechanism satisfies ε-differential privacy, what does this imply?
Answer: ε=0 implies the output distribution is identical whether any individual is in the dataset or not. The mechanism reveals absolutely nothing about any individual. The only way to achieve this is to output a constant independent of the data (like a random coin flip), making the query useless. Q5: What is the composition property of differential privacy?
Answer: If mechanism M₁ satisfies ε₁-DP and M₂ satisfies ε₂-DP, then running both on the same data satisfies (ε₁+ε₂)-DP. This allows modular design but means privacy budget accumulates with multiple queries.

5. 🔗 Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.