CS 1261: Fairness, Privacy, and Cryptography
Lecture Notes
Spring 2026
Three Flavors of Indistinguishability
Statistical Indistinguishability
The course opens by comparing two coins:
Coin 1:
Coin 2:
Distinguishing Biased Coins
Let . Then: By Chernoff bounds,
Sample Complexity of Bias Detection To distinguish a coin of bias from a fair coin with constant confidence, samples are necessary and sufficient.
Insight: Statistical indistinguishability is governed by variance scaling as .
Differential Privacy and Adjacent Datasets
Two datasets are adjacent if they differ in exactly one individual’s record. Concretely: might be everyone in the room, and might be everyone in the room plus one additional person. Only that one record differs; everything else is identical.
Why adjacency?
The goal of differential privacy is to protect individuals: to ensure that no single person’s decision to contribute their data can meaningfully change what an observer learns. Defining privacy with respect to adjacent datasets captures this precisely.
Why randomized mechanisms?
Differential privacy necessarily involves randomized algorithms. For a given input, a randomized mechanism does not produce the same output every time — it produces a probability distribution over outputs. Privacy is then a statement about these distributions: the distributions on adjacent inputs must be nearly identical.
-Differential Privacy A randomized mechanism satisfies -differential privacy if for all adjacent datasets and all measurable output sets :
Interpretation.
Every possible transcript of an interaction with is essentially equally likely whether or not any given individual is present in the dataset. An observer who sees the output of cannot reliably infer whether a specific person’s data was included.
Statistical vs. computational protection.
DP is a statistical guarantee: it is indistinguishability in the face of unlimited computational power. Unlike cryptographic notions, DP does not rely on hardness assumptions. The protection comes from how many observations the adversary gets — running the mechanism more times leaks more — not from the adversary’s computational limitations. Even an adversary with infinite computing power who knows every other person’s data cannot determine whether a target individual participated.
Real-world motivation.
US Census. The Census Bureau must release aggregate statistics about the population while protecting respondents’ individual records.
Medical research. Studies on shared datasets (e.g., the Framingham Heart Study) require guarantees that individual patient data remains private even as the data is used for research by many groups over many years.
Industry. Google applied DP to mobility data analysis in a Scandinavian country so that engineers could analyze aggregate trajectories without being exposed to individual movement histories — making the analysis both privacy-preserving and more comfortable for the analysts themselves.
Computational Indistinguishability
In cryptography, indistinguishability is restricted to polynomial-time adversaries. The key definitions below are from Barak’s lecture notes (§2.4).
Concrete Indistinguishability (Barak Def. 2.9) Random variables over are -indistinguishable, written , if for every algorithm (circuit) of size at most : is called a distinguisher. bounds its running time; bounds its advantage.
The indistinguishability game.
An adversary Eve tries to tell from . A challenger flips a hidden bit , samples from if or if , and gives the sample to Eve. Eve outputs a guess . The scheme is secure if equivalently, Eve’s advantage .
Asymptotic (Ensemble) Indistinguishability (Barak Def. 2.10) Ensembles and are computationally indistinguishable, written , if for every polynomial and all sufficiently large : Equivalently, no PPT adversary can distinguish from with non-negligible advantage.
Properties. Computational indistinguishability () satisfies:
Symmetry: .
Transitivity: and (proved by a hybrid argument).
Closure under efficient computation: if and is poly-time, then .
Unlike DP, computational indistinguishability:
quantifies over efficient algorithms only;
relies on hardness assumptions (not information-theoretic).
Pseudorandom Generators: A Concrete Example
The canonical application of computational indistinguishability is the pseudorandom generator (PRG).
Setup.
A PRG takes an -bit seed and deterministically produces a -bit output string. (The stretch factor of 2 is for concreteness; any polynomial stretch works.) The machinery of is completely deterministic — the only randomness is in the choice of the seed.
How many pseudorandom strings are there?
There are possible seeds, so there are at most possible outputs — a tiny fraction of all strings of length . A truly random string of length almost certainly falls outside the image of , because .
The indistinguishability requirement.
An exponential-time distinguisher could enumerate all outputs of , check membership, and distinguish pseudorandom from truly random strings easily. The requirement is therefore restricted to polynomial-time distinguishers:
Pseudorandom Generator (PRG) A deterministic function is a PRG if the ensemble is computationally indistinguishable from : where denotes the uniform distribution on . No polynomial-time algorithm can distinguish a pseudorandom string from a truly random string with non-negligible advantage.
PRGs are the building block for stream ciphers and are studied in depth in Chapter 14.
The Third Flavor: Outcome Indistinguishability (Preview)
The chapter title promises three flavors. The third arises in the context of prediction algorithms and algorithmic fairness.
The problem of evaluating prediction algorithms.
Prediction algorithms assign probabilities to events: the probability that it will rain tomorrow, that a patient’s tumor will metastasize, that a person will repay a loan. Evaluating such algorithms is fundamentally difficult because these are non-repeatable events — we cannot rewind the future, re-run it many times, and measure the frequency of outcomes. There is no universally agreed mathematical definition of the probability of a non-repeatable event.
Calibration: necessary but not sufficient.
One natural criterion is calibration (Dawid, 1982): a forecaster is calibrated if, among all instances on which it predicted probability , the fraction of true outcomes is approximately . For example, among all days on which the forecaster said “70% chance of rain,” it should have actually rained on approximately 70% of those days.
Calibration is clearly desirable. Alarmingly, however, it is achievable by a complete charlatan who knows nothing about the phenomenon being predicted — one can construct a perfectly calibrated forecaster that is entirely uninformative. This shows that calibration alone is not a meaningful guarantee of accuracy or fairness.
The outcome indistinguishability framework.
Inspired by Feynman’s account of how physics validates a new law — build an experiment to test whether the law’s computed consequences match reality, and if they don’t, the law is wrong regardless of its elegance — we want a richer notion of what it means for a model’s predictions to be valid.
A model is outcome indistinguishable with respect to a class of distinguishers if no test can tell the difference between:
outcomes drawn from the real world (true distribution), and
outcomes drawn from the model’s distribution .
The class of distinguishers encodes what kinds of tests we care about. By varying , one recovers:
simple calibration (distinguishers that only see the predicted probability and the outcome);
group-conditional calibration (distinguishers that also see demographic attributes);
complex fairness criteria (distinguishers with access to richer features).
This gives a hierarchy of fairness notions ordered by distinguisher power, and connects algorithmic fairness directly to the indistinguishability framework used throughout the course. The full theory is developed in Chapter 4.
Summary: three flavors.
| Flavor | Limitation on distinguisher | Application |
|---|---|---|
| Statistical | Number of samples | Differential Privacy |
| Computational | Polynomial time | Cryptography, PRGs |
| Outcome | Specified test class | Algorithmic Fairness |
Algorithmic Fairness
Representation and Bias
Algorithms never operate on individuals directly. Instead, each individual is mapped through a representation function that extracts a finite set of features. The algorithm sees only , not the full person . This compression is a fundamental source of bias.
Choice of features matters.
Consider a cancer study. Two research groups each study whether a particular treatment causes metastasis. Group A examines positions in a tumor’s DNA and finds a 30% metastasis rate among patients who look like you in those positions. Group B examines positions and finds a 5% rate. What can we conclude about your prognosis? Nothing — because the two groups studied different projections of your tumor. Only a study examining both sets of features simultaneously would be informative. Whenever the representation matters this much, it is a vector for the introduction of bias.
Sources of Bias
Non-representative training data.
A classifier trained to minimize error on a distribution only generalizes to that distribution. If a minority group constitutes a small fraction of , near-zero error overall can be achieved by performing arbitrarily badly on the minority while doing well on the majority. The algorithm has no incentive to be accurate on groups that barely affect aggregate loss.
Biased labels.
Labels themselves may encode historical discrimination. If the same behavior by a child of color is systematically coded as “defiant” while an identical behavior by a white child is coded as “spirited,” the training data absorbs this bias. The algorithm then learns to replicate it. Similarly, rearrest is used as a proxy for recidivism in criminal justice tools, but rearrest rates reflect policing intensity and systemic inequality, not solely individual behavior. People who commit crimes may not be rearrested; people who are arrested may not have committed a crime.
Differentially expressive features.
The same feature value can mean different things for different populations. The Allegheny County Child Protective Services screening tool (Virginia Eubanks, Automating Inequality, 2014) accessed Medicaid records to flag prior drug treatment. A poor family on Medicaid has a visible treatment history; a wealthy family that paid privately at a clinic has none. The feature “no drug treatment history” means different things depending on socioeconomic status. Other examples: income of $100,000/year has different implications for men and women given structural wage inequality; number of children is positively correlated with career success for men and negatively for women.
Principled criteria for feature selection.
The question of which features to include in a predictor is under-studied but critical. Several principled objections arise:
Subjective assessment. Features that are subjectively coded (e.g., “kempt vs. unkempt” in early risk instruments) introduce the assessor’s bias directly into the model, while appearing to be objective data.
Autonomy. Features outside an individual’s control — immutable characteristics like race or biological sex — make predictions that cannot be acted upon. They also raise serious concerns about accountability for outcomes.
Private sphere. Marital status, family composition, and similar features may belong to a domain where prediction is simply inappropriate, regardless of predictive accuracy.
Correlation vs. causation. A feature may be predictive today only because it correlates with a causal factor. If social norms shift (e.g., if men’s smoking rates converge with women’s), the feature loses its predictive value — and any policies built on it become wrong. Example: women’s greater longevity correlates with biological sex but is partly explained by proximal factors (risk-taking behavior, occupational stress, smoking rates) that are socially contingent.
The “New York Times” test. A practical heuristic: if you would be embarrassed to explain in a news article that you used feature to make prediction , you should reconsider the feature. This does not replace formal analysis, but it is a useful sanity check on whether your modeling choices are defensible to a non-specialist audience.
Measurement and hardware bias.
Bias can be embedded in the hardware itself. Camera lenses are historically optimized for white skin tones; microphones and broadcast frequencies were calibrated for male vocal ranges, leading to the perception that women’s voices are “shrill” — a perception produced by the technology, not by the voices. These are not labeling errors; they are biases in the measurement apparatus.
Label inflation and denominator problems.
When labels reflect reporting rates rather than ground truth, populations that are surveilled more will appear to have higher rates of the labeled behavior. CPS receives more calls about families in dense urban neighborhoods (where neighbors can hear a crying baby) than about identical situations in rural areas. “Number of prior calls” is not “prior abuse” — it is a function of surveillance density, which correlates with poverty and race.
Group Fairness
Group fairness properties are statistical requirements imposed on a classifier’s behavior across demographic groups.
The Confusion Matrix
For a binary classifier with true label and predicted label , all outcomes fall into four cells:
| Predicted positive | Predicted negative | |
|---|---|---|
| Truly positive | True Positive (TP) | False Negative (FN) |
| Truly negative | False Positive (FP) | True Negative (TN) |
Error Rates and Positive Predictive Value For a group : The base rate of group is , the fraction of truly positive individuals in . It is a property of the population, not the classifier.
Chouldechova’s Impossibility Theorem
Impossibility of Simultaneous Fairness (Chouldechova, 2017) For any imperfect classifier and two groups with unequal base rates , it is impossible to simultaneously achieve:
Equal false positive rates: ,
Equal false negative rates: ,
Equal positive predictive value: .
Proof sketch.
There is a mathematical identity linking these four quantities for any group : This identity holds independently within each group. Requiring equal FPR and equal FNR across and pins two of the three varying quantities; the identity then forces if and only if . If base rates differ, at least one of the three conditions must be violated.
Real-world instantiation: COMPAS.
In 2016, ProPublica (Julia Angwin) reported that Northpointe’s COMPAS recidivism risk tool exhibited higher false positive rates for Black defendants and higher false negative rates for white defendants. Northpointe responded that their tool was calibrated — equal positive predictive value across racial groups. Both claims were correct. Chouldechova’s theorem explains why: differential base rates in rearrest (themselves a product of differential policing) make it mathematically impossible to equalize all three criteria simultaneously.
Statistical Parity and Its Limits
Statistical Parity A classifier satisfies statistical parity with respect to groups and if the acceptance (positive prediction) rates are equal:
Statistical parity is meaningful in the breach: a large violation is a warning sign worth investigating. But it is not a solution concept. A discriminatory actor can satisfy statistical parity while circumventing its intent: if a steakhouse owner wishes to exclude group and is required to show equal advertising rates across and , they can target the ads at the vegetarians within — people who will not come regardless. The statistical parity requirement is met; the discriminatory intent is achieved.
Scoring Functions: Analogous Impossibility
For scoring functions (rather than binary classifiers):
Fairness Criteria for Scores
Calibration: within each bin of predicted score , the fraction of positive outcomes is , independently within each group.
Balance for the positive class: (positive individuals receive the same average score across groups).
Balance for the negative class: .
Impossibility for Scores (Kleinberg–Mullainathan–Raghavan, 2016) For two groups with unequal base rates, no imperfect predictor can simultaneously satisfy calibration, balance for the positive class, and balance for the negative class.
Proof sketch.
Calibration implies that the total score assigned to group equals the number of positive individuals in : where is the number of positives in group . The balance conditions fix (average score for negatives) and (average score for positives) to be group-independent. Expanding the sum: which simplifies to for groups of equal size . This gives a pair of lines (one per group) in the plane; they coincide only when base rates are equal. Otherwise, the lines intersect only at (perfect prediction).
Takeaway.
Group fairness desiderata are not merely in political tension — they are algebraically incompatible for imperfect classifiers when base rates differ.
Individual Fairness
Individual Fairness For task metric :
This is a Lipschitz constraint over distributions.
Fairness Linear Program
The individually fair classification problem can be cast as a linear program: Fairness is a hard constraint; utility is the soft objective. Linear programs are solvable in polynomial time.
Limitations.
Three practical obstacles limit this approach:
Scale. The universe may contain billions of individuals. A polynomial running time in is infeasible in practice (e.g., constraints is already a trillion for a billion-person universe). One needs something closer to linear time.
Generalization. The LP is built on the individuals observed during training. It provides no fairness guarantee for individuals outside the training set.
Metric access. The LP requires the task metric as input. Where does come from? This is the metric-learning problem, addressed in Chapter [chap:metric].
PAC learning (probably approximately correct learning) offers a partial remedy to the first two problems by working on a small sample rather than the full universe — producing a classifier that is likely to be approximately fair on the population.
Task-Competitive Composition
Motivation.
Consider an online advertising setting where multiple advertisers compete for each user’s attention in a real-time auction. When you visit a news website, an instantaneous auction determines which ad you see. Higher bidders displace lower bidders. Can fairness be guaranteed across this system?
A concrete example.
A grocery delivery service bids $1 for the attention of expectant parents (high lifetime value; subscription retention is strong). A tech company bids $0.50 for qualified undergraduate candidates. Both advertisers design their classifiers to be individually fair for their own task — the grocery service advertises equally to similarly-situated expectant households; the tech company advertises equally to similarly-qualified candidates.
The grocery service outbids the tech company whenever both want the same user. The effective result: the tech company can only reach users the grocery service passed on. Expectant parents — disproportionately on parental leave or career transitions, disproportionately female — are systematically excluded from tech job ads, not by any intentional discrimination, but by the financial dynamics of the auction. Neither advertiser violated its own fairness condition.
Historical instantiation. A 2010 Wall Street Journal investigation reported that a major ad network categorized users into demographic bins with names like “White Picket Fence” and “Double Income, No Kids.” Credit card companies using this network were accused of steering minority users toward credit products with less favorable terms — a serious concern given federal anti-discrimination law in credit. The steering emerged from the composition of individually-designed targeting strategies, not from any single actor’s misconduct.
Formal setup.
A randomized classifier is a map assigning each individual a distribution over outcomes. For binary outcomes , define . Individual (metric) fairness requires ; for binary outcomes this becomes .
Naive task-competitive composition.
Consider tasks (grocery) and (tech), with task-specific metrics and and individually fair classifiers and respectively. Ties go to .
User receives the ad only if did not bid on them.
.
The difference in -exposure between two individuals :
Key observation. Even if is Lipschitz with respect to and is Lipschitz with respect to , the product need not be Lipschitz under either metric. The multiplicative interaction introduced by outbidding breaks both fairness conditions.
Proof of violation.
Choose with (task favors ) and (task favors ), with maximized. The gap in -exposure is: Setting and choosing probabilities so that (achievable because can be pushed to exceed this ratio without violating ’s fairness), the violation term is strictly positive. The system as a whole violates individual fairness for task , even though each classifier is individually fair in isolation.
Naive Composition Fails Let and be non-trivial task metrics (i.e., some pair of individuals has ). Then there exist individually fair classifiers for and for such that their naive task-competitive composition violates individual fairness for .
Implication: coordination is necessary.
Fairness of the whole system does not follow automatically from fairness of its parts. An advertising network that wants to guarantee multi-task individual fairness must actively coordinate across advertisers — it is insufficient for each advertiser to independently satisfy its own fairness criterion. This is not merely a theoretical concern: when the structure of a market (auctions, outbidding, priority rules) causes tasks to interact, the platform bears responsibility for the emergent aggregate behavior.
The Denominator Problem in Auditing
Auditing a classifier for fairness requires a benchmark: a reference quantity against which to compare observed rates. The choice of benchmark determines the conclusion.
Population-based benchmark.
Compare the stop rate for group against the stop rate for group , using total population as the denominator: In hypothetical data (Neil and Winship, Annals of Criminology): has 15,000 criminals out of 100,000; has 10,000 out of 100,000. If 10% of are stopped vs. 5% of , the population benchmark concludes a 2:1 disparity — strong evidence of discrimination against .
Usage-based benchmark.
Now suppose every person in a public space is stopped independently with probability , uniformly, with no consideration of race. Approximately 25% of and 25% of in the space are stopped. This is by construction non-discriminatory. Yet if uses the space at twice the rate of (for socioeconomic or geographic reasons), the population-based ratio of stops will be 2:1, exactly matching the earlier “evidence of discrimination” — even though the stopping rule is blind to race.
The denominator reflects an assumption about what the police are doing and who is exposed to police contact. Different assumptions — total population, at-risk population, population using a specific space, criminally active population — yield different ratios from identical data and can support opposite conclusions.
Implications.
When evaluating claims based on benchmark tests:
Is the denominator justified by the mechanism being studied?
Do stop rates vary by time of day, location, or type of crime in ways that interact with demography?
Are the police targeting specific behaviors or areas, and does that targeting confound the comparison?
Different defensible answers produce different conclusions from the same data. This does not mean fairness auditing is impossible, but it means conclusions require explicit assumptions that should be stated and scrutinized.
Structural limits: a summary.
Taken together, the results of this chapter suggest that group fairness is not a well-posed solution concept:
Natural desiderata (FPR, FNR, PPV) are mutually exclusive when base rates differ.
Statistical parity is gameable by a sophisticated bad actor.
Auditing via benchmarks is highly sensitive to unstated denominator assumptions.
None of the above is resolved by introducing a human into the decision loop — a human decision-maker is still an algorithm, just one with flesh rather than silicon.
The appropriate response to a group fairness failure is investigation, not automatic remediation. The mathematical impossibility results explain the failure; they do not prescribe a solution.
Paper Readings
Chouldechova (2017) — Fair Prediction with Disparate Impact.
When base rates differ across demographic groups, no classifier can simultaneously satisfy calibration within each group, equal false positive rates, and equal false negative rates. The argument is purely algebraic: once calibration fixes the conditional expectations, the error rates are fully determined by the base rates, leaving no freedom to equalize them. This result is the mathematical backbone of the COMPAS controversy and demonstrates that apparent fairness trade-offs can be structural impossibilities rather than design failures.
Dwork, Hardt, Pitassi, Reingold, Zemel (2012) — Fairness Through Awareness.
Introduces individual fairness as a Lipschitz condition: a randomized classifier is fair if similar individuals (under a task-specific metric ) receive outcome distributions within of each other. The fairness-constrained classification problem can be expressed as a linear program, and the central open question — where the metric comes from — motivates Chapter 3. This paper established the individual-vs.-group distinction that now structures most of the algorithmic fairness literature.
Learning the Metric: Human Arbiter
Individual Fairness: Treat Similar People Similarly
The most intuitive articulation of fairness is also one of the hardest to formalize: similar individuals should be treated similarly. This is the principle of individual fairness, introduced by Dwork, Hardt, Pitassi, Reingold, and Zemel (2012) as a formal counterpart to informal notions of non-discrimination.
The central challenge: “similar” is not a property of individuals in isolation — it is task-specific and context-dependent. Two candidates might be similar for the purpose of hiring engineers but dissimilar for the purpose of assessing surgical risk. There is no universal similarity function; the metric must be chosen by someone who understands the task.
Individual Fairness (Lipschitz Condition) Let be a metric space on individuals and a metric space on distributions over outcomes. A randomized classifier satisfies individual fairness if it is -Lipschitz: That is: the distance between the outcome distributions assigned to two individuals is bounded by their task-specific similarity distance.
Why a metric?
The Lipschitz condition requires to be a true metric (symmetric, satisfies triangle inequality, ). The triangle inequality is not just a technical convenience: it prevents the situation where and are each deemed “similar” to but treated very differently.
The metric on outcomes.
A natural choice for is total variation distance between the outcome distributions. If outcomes are binary (e.g., loan approved/denied), total variation between two Bernoulli distributions simplifies to — the absolute difference in approval probabilities.
The Metric Problem
Individual fairness does not say which metric to use. This is intentional: the choice of is a normative decision, not a mathematical one. The question “are these two people similar for this task?” is a policy question, not a data question.
Why the metric cannot be learned from the data.
A natural thought: learn from historical outcomes. If the historical data comes from a biased process (discriminatory hiring, unequal access to credit), then distances learned from those outcomes will encode the bias. Using biased historical data to define “similarity” and then requiring the algorithm to respect that similarity perpetuates the original discrimination under the guise of mathematical fairness.
The metric must be an external normative input that reflects what we believe people ought to be judged on — not what they have historically been judged on.
Who specifies the metric?
Several approaches have been proposed:
Domain experts. A hiring committee, a medical board, or a panel of legal experts specifies which features are task-relevant and how differences in those features should be weighted.
Regulatory requirements. Anti-discrimination law may mandate that certain features (race, sex, religion) be ignored, implicitly defining a metric that is insensitive to those coordinates.
Human arbiter / oracle. A designated human (or panel) answers queries about specific pairs or triplets of individuals. This externalizes the normative question: the math defers to human judgment.
The Human Arbiter Model
The human arbiter approach treats the task-specific metric as accessible only through a human oracle that can answer comparison queries. We do not assume the oracle reveals exact distances; it only answers ordinal questions.
Triplet Oracle A triplet oracle for metric takes as input three individuals and returns the identity of the closer one: The oracle answers: “Is or closer to ?”
Why triplets?
Exact distances are hard for humans to provide: asking “how similar are these two candidates on a scale of 0 to 1?” yields inconsistent, poorly calibrated answers. Comparative judgments — “which of these two candidates is more similar to a third?” — are more reliable and cognitively natural. Triplet queries have been validated empirically as a basis for metric learning from human feedback.
Learning an Ordering via Triplet Queries
From comparisons to orderings.
Fix a representative individual . The triplet oracle can answer queries of the form “which of is closer to ?” This is exactly the comparison oracle needed to run any comparison-based sorting algorithm.
MergeSort Query Complexity Given individuals and access to a triplet oracle anchored at , MergeSort recovers a total ordering of all individuals by using oracle queries.
Proof.
MergeSort makes comparisons. Each comparison is one triplet query. The sort returns individuals in non-decreasing order of , which is a valid total ordering because is a real-valued function.
From an ordering to distances.
A total ordering gives us the ranks for each , but not the actual distances . To estimate , we use the gaps between adjacent elements in the sorted order. This requires stronger oracle access (e.g., asking for approximate ratios of distances, not just ordinal comparisons), and recovery is only approximate.
Approximate Metric Recovery: -Submetrics
Exact metric recovery from ordinal queries is information-theoretically impossible in general: many metrics are consistent with the same set of triplet answers. We therefore aim for approximate recovery.
-Submetric A function is an -approximation to metric if: An -submetric satisfies (additive approximation).
Representative-based distance.
Fix a representative . Define: By the reverse triangle inequality, for all (it is a 1-Lipschitz projection of ). It is a pseudometric: it satisfies all metric axioms except it may assign zero distance to distinct points (if but ).
Using multiple representatives.
Choose a set of representatives . Define: This is always a lower bound: . If is chosen such that for every pair there exists with and differing by close to , then approximates well.
For doubling-dimension metric spaces (where every ball of radius can be covered by a bounded number of balls of radius ), a random sample of size is sufficient for a good approximation with high probability.
The Mahalanobis Distance: A Canonical Parametric Form
When individuals are represented as vectors in , the most expressive linear metric is the Mahalanobis distance:
Mahalanobis Distance For a positive semi-definite matrix :
Special cases: gives Euclidean distance; (inverse covariance) gives the classical Mahalanobis distance that whitens the feature space. The matrix encodes which features matter and how much: a large diagonal entry for feature means differences in are penalized heavily.
Metric learning as semidefinite programming.
Given a set of “must-link” pairs (similar individuals) and “cannot-link” pairs (dissimilar individuals), one can find the best-fit by solving: This is a semidefinite program (SDP): the constraint (positive semi-definiteness) is convex, so the problem can be solved in polynomial time. The constraint set and can be populated from human arbiter responses to pairwise queries.
Historical context.
The Mahalanobis distance was introduced by P.C. Mahalanobis in 1936, originally to measure anthropometric distances between population groups in British India — arguing that intra-caste variation exceeds inter-caste variation, and that geographic proximity is a more principled basis for social classification than caste hierarchy. The original application was explicitly political; the tool it introduced is genuinely powerful and now ubiquitous in statistics and machine learning. This history is a reminder that mathematical tools are not neutral: they are invented to answer specific questions, those questions carry normative assumptions, and the tools can be repurposed in both better and worse directions.
Limitations and Critiques
Who is the arbiter?
The human arbiter model defers the normative question to a human — but does not resolve it. If the designated arbiter is not representative (e.g., drawn from a homogeneous population), the metric will reflect their perspective, not the affected community’s. Diversity of the arbiter pool matters as much as the mathematical formalism.
Whose similarity?
The metric is task-specific: similar for hiring engineers is not the same as similar for bail decisions. In practice, the same features (education, neighborhood) are used across many tasks, creating de facto cross-task conflation of similarity.
Tension with group fairness.
Individual fairness and group fairness (e.g., equalized odds, demographic parity) are not equivalent, and can conflict. A metric that treats individuals as similar when they have the same qualifications may still produce racially disparate outcomes if qualifications are unequally distributed across groups as a result of historical inequality. Individual fairness is silent on this; it only asks that the algorithm respect the metric, not that the metric itself be equitable.
The bootstrapping problem.
Validating a fairness metric requires knowing what the fair outcomes are — but knowing fair outcomes is equivalent to having the metric. There is no ground truth to check against: the arbiter’s responses are constitutive, not descriptive, of the fairness standard.
Paper Readings
Dwork, Hardt, Pitassi, Reingold, Zemel (2012) — Fairness Through Awareness.
The foundational paper for this chapter: proposes the human arbiter model in which a designated oracle answers comparison queries about individual similarity, externalizing the normative question of who counts as similar for a given task. The paper proves that the resulting metric can be used to formulate fair classification as a linear program, and explicitly frames the open problem — how to elicit or learn the metric in practice — that the rest of this chapter addresses.
Mukherjee, Yao, Gaboardi, Learned-Miller, Agarwal (2020) — Two Simple Ways to Learn Individual Fairness Metrics from Data.
Shows that a Mahalanobis distance encoding task-specific similarity can be learned from human-provided pairwise labels (similar/dissimilar) or triplet comparisons without requiring full expert specification. Both approaches reduce to convex optimization: the pairwise-constraint version is a semidefinite program; the triplet version uses gradient descent. The resulting metric is interpretable as a feature reweighting, but the quality of the metric depends entirely on the raters’ judgments — the method systematizes elicitation without validating whether the elicited standard is itself equitable.
Outcome Indistinguishability & the Multi- Framework
Motivation: the meaning of a single probability
Richard Feynman famously asked: what does it mean to say there is a 12% chance of rain tomorrow? For a repeatable experiment we can check the prediction by running many trials; but tomorrow is a unique event. The same question applies to recidivism prediction, loan approval, or medical diagnosis: the ground truth for individual is never directly observable.
The Outcome Indistinguishability framework sidesteps this epistemological problem by asking a behavioral question: can a downstream observer—using whatever statistical tests they care about—distinguish behavior under the model from behavior under the true distribution? If not, the model is, in every practical sense, as good as the truth.
Outcome indistinguishability: A model is good relative to a collection of distinguishers if no distinguisher can tell whether outcomes were drawn from real life or from the model.
This mirrors the scientific method: propose a model, derive observable consequences, and test whether those consequences match reality. Passing the tests does not prove the model is universally correct; it only says the model is good for the uses captured by the tests in .
Connection to computational indistinguishability.
The OI framework was inspired in part by the polynomial-time indistinguishability definitions from cryptography (Chapter 14). Both use the same template: fix a class of efficient tests; require that two distributions (real-world outcomes vs. model outcomes, or truly random bits vs. pseudorandom bits) cannot be told apart by any test in that class. OI is the fairness-flavored instantiation of the same core idea.
Formal setup
Universe of individuals/features: .
Individuals are drawn from a population distribution:
Ground-truth per-individual success probability: The real-life outcome is:
Model / predictor: The model-generated outcome is:
Distinguishers: The distinguisher receives information about an individual, possibly the model’s prediction, and an outcome, and outputs a bounded real value.
The goal is that should behave nearly the same whether the outcome is drawn from real life or from the model.
Distinguisher hierarchy
Different real-world observers have different amounts of information. We organize them into a four-level hierarchy of increasing power:
No-access distinguisher: sees only the raw input and the binary outcome ; receives no prediction .
Sample-access distinguisher: sees but only for finitely many sampled individuals. Cannot query the model on arbitrary inputs.
Oracle-access distinguisher: can query the model on any , receiving , then observe the outcome .
Full-access distinguisher: knows the model in full; can compute for every without querying.
Demanding OI against a stronger class is a strictly stronger requirement. In the algorithm we will work with real-valued distinguishers: , mapping (individual, prediction, outcome) to a score in . The distinguishing gap becomes where is the per-individual contrast (how much changes when the outcome flips).
Real world versus model world
Fix a distinguisher .
Define the expected behavior of in the real world:
Define the expected behavior of in the model world:
The distinguishing gap is:
The model is -outcome-indistinguishable with respect to if
Decomposition of the distinguishing gap
Gap decomposition For any distinguisher and any model , where .
Proof. Write and similarly for the ground-truth term (replacing with for the Bernoulli draw while keeping as the prediction fed to ). Subtracting and simplifying: Taking expectations over and absolute values gives the result. ◻
Interpretation. The gap is an inner product between the error vector and the sensitivity vector . A distinguisher can detect the model’s flaws exactly when its sensitivity is aligned with those flaws.
Algorithm: iterative -nudging
Start with the trivial predictor:
Repeat:
If for every , stop.
Otherwise, choose a distinguisher with .
Update:
Here is projection back into the interval .
If , then on average the model is underpredicting in directions where . So we nudge upward for such individuals.
If , the same update nudges downward.
Thus the update is a gradient-like correction against the distinguisher that currently detects the largest systematic error.
Circuit interpretation
The algorithm can be viewed as gradually building a predictor circuit.
Initially, the circuit outputs for every individual.
Each failed distinguisher contributes one additional correction layer.
After updates, the predictor is the result of composing these nudges.
The computationally hard part is often finding a distinguisher with large . This is related to agnostic learning. But once such a distinguisher is found, the update itself is simple.
Convergence: potential function argument
Define the mean-squared error potential
Lemma 4.1 (Descent per update). Suppose at step we pick a violating with and apply the update Then
Proof sketch. Let and . Ignoring projection (which only helps), the new squared error at individual is Taking expectations and using and (since ): ◻
Iteration bound Starting from , after at most updates every distinguisher in has gap . The algorithm terminates in rounds.
Proof. Each violating step drops by at least . Since and , there can be at most such steps before no violating remains. ◻
The nudge update is exactly a projected gradient step on the potential , where serves as the gradient direction. The algorithm is therefore an instance of projected gradient descent, and the bound matches the standard convergence rate for gradient descent with step-size proportional to the gradient norm.
Multi-: accuracy, calibration, and validity
Definition 4.1 (Multi-accuracy). A predictor is -multi-accurate if for every set : Equivalently, choosing , multi-accuracy says the model has no systematic over- or under-prediction on any group in .
Multi-accuracy is a special case of OI: it corresponds to taking to be the class of indicator-function distinguishers . The iterative algorithm above therefore produces a multi-accurate predictor in rounds whenever is finite (or efficiently enumerable).
Connection to group fairness.
Multi-accuracy is stronger than requiring average calibration per group: it bounds the signed error, preventing the model from simultaneously over-predicting for one demographic subgroup while under-predicting for another. By choosing to contain all protected groups and their pairwise (and higher-order) intersections, we approach intersectional fairness.
Multi-calibration.
Strengthening multi-accuracy to require calibration within each score bucket of each group yields multi-calibration (Hébert-Johnson, Kim, Reingold, Rothblum, 2018): The same nudge-and-project algorithm achieves this; it is a strictly stronger guarantee than multi-accuracy.
Limitations
Small groups. When a group is small, the empirical estimate of has high variance. Meaningful multi-accuracy guarantees require sample sizes that grow with and shrink with group size.
Intersectionality at scale. Requiring accuracy on all intersections causes to grow exponentially in the number of protected attributes, making the bound vacuous without additional structure (e.g., computationally efficient distinguisher classes).
Gameable accuracy definitions. A model can achieve multi-accuracy while still making badly miscalibrated predictions within fine-grained subgroups, motivating the stronger multi-calibration guarantee.
Connection to fairness
Multi-accuracy protects against systematic group-level prediction errors. If a predictor systematically overpredicts loan repayment for one group, multi-accuracy pushes those predictions down. If it systematically underpredicts for another group, multi-accuracy pushes those predictions up.
By choosing to include protected groups and intersections of protected groups, one obtains a form of intersectional fairness.
However, small groups are difficult:
If is tiny, the training sample may contain too few examples from .
Then the algorithm may not be able to detect or correct systematic error on .
Thus Multi- helps with intersectionality only for groups explicitly included in and sufficiently represented in the data.
Paper Readings
Hébert-Johnson, Kim, Reingold, Rothblum (2018) — Multicalibration: Calibration for the Computationally Identifiable Masses.
Introduces multicalibration: the requirement that a predictor be calibrated not just globally but on every subgroup that a polynomial-time algorithm can identify. The main result is an efficient boosting-style algorithm that iterates through subgroups, applies a small nudge wherever calibration fails, and halts after rounds — the same structure as the OI algorithm in this chapter. Multicalibration implies multi-accuracy and is implied by outcome indistinguishability against oracle-access distinguishers, making it a key waypoint in the OI hierarchy.
Dwork, Kim, Reingold, Rothblum, Yona (2021) — Outcome Indistinguishability.
Formally defines the OI framework: a predictor is outcome indistinguishable with respect to a class of distinguishers if no can tell real-world outcomes from model-generated ones. The paper proves the equivalences between OI, multi-accuracy, and multicalibration at each level of the distinguisher hierarchy, and shows that the nudge-and-project algorithm achieves -OI in rounds. It is the primary reference for the material in this chapter.
Trevisan, Tulsiani, Vadhan (2009) — Regularity, Boosting, and Efficiently Simulating Every High-Entropy Distribution.
Proves that any distribution with high Shannon entropy can be efficiently simulated by a distribution that is computationally indistinguishable from it, by iteratively correcting the simulator against the best-fitting distinguisher from a fixed class. The boosting-style argument and the potential function that bounds the number of correction steps are structurally identical to those in the OI convergence proof, providing the complexity-theoretic underpinning for the algorithm analyzed in this chapter.
Differential Privacy and Reconstruction
Fundamental Law of Information Recovery
Dinur–Nissim If too many queries are answered too accurately, database reconstruction is possible.
Specifically: error implies blatant non-privacy; even error fails under many random queries.
Database Reconstruction Model
Let the database be . A query corresponds to a subset : , mechanism response: We assume a uniform accuracy guarantee:
Blatant Non-Privacy
An algorithm is blatantly non-private if an adversary can reconstruct all but entries.
Reconstruction from Accurate Answers
If all subset queries are answered with error at most , then the Hamming distance between any consistent database and the real database satisfies
Proof Sketch.
Both and any consistent satisfy and . By triangle inequality, for all . Setting and : If then : almost the entire database is reconstructable.
Reconstruction from Linearly Many Random Queries
Take drawn uniformly at random; true answer ; noise
Signal from Distant Databases
If , then is a sum of independent variables. By anti-concentration, for some constant .
After independent queries, by union bound: Choosing drives this to , eliminating all distant databases with high probability.
If random queries are answered with noise , then database reconstruction is possible with high probability.
Concentration vs. Anti-Concentration
Let , i.i.d.
Concentration (Chernoff): . Most mass lies near 0.
Anti-Concentration: (from CLT: ).
If noise , then with constant probability each random query produces a signal larger than the noise. After queries, all distant databases are eliminated.
Connection to Differential Privacy
Noise must scale at least to prevent reconstruction. Differential privacy prevents catastrophic reconstruction even under adaptive querying.
Paper Readings
Dinur and Nissim (2003) — Revealing Information While Preserving Privacy.
Proves that any mechanism answering all subset-sum queries on an -bit database with error allows efficient reconstruction of almost the entire database. The attack issues random queries, forming an overdetermined linear system whose solution approximates the private bits; the error threshold is tight. This result is the formal justification for differential privacy: it establishes that useful statistical answers and full individual-level privacy cannot coexist, so any practically private mechanism must inject noise of order at least .
Laplace and Exponential Mechanisms
Global Sensitivity
Global Sensitivity For a function :
Sensitivity measures how much one individual’s data can change the output.
Laplace Mechanism
Laplace Mechanism The mechanism satisfies -differential privacy.
Proof idea. For adjacent , the ratio of output densities is bounded:
Noise scale is: Stronger privacy () means more noise.
Accuracy for a Single Query
Let . We want . Using the Laplace tail bound: Set , giving:
Laplace Accuracy (Single Query)
High-Dimensional Laplace Mechanism
For vector-valued queries , define the sensitivity: For instance, if we ask simultaneously how many people are over six feet tall and how many prefer vanilla to strawberry, one person can change both counts by 1, giving sensitivity 2. In general, for arbitrary counting queries, one person can affect all counts, so in the worst case.
The mechanism draws independent noise terms and adds one to each coordinate: The privacy proof is identical to the one-dimensional case, applied coordinate by coordinate.
Privacy depends on sensitivity, not on the dimension .
Accuracy for Queries
We want . By a union bound: Setting and solving via the Laplace tail:
Laplace Accuracy ( Queries)
Accuracy degrades only logarithmically in the number of queries.
Histogram Queries: Sensitivity Is Always 1
A histogram query partitions the population into disjoint cells and counts how many individuals fall into each cell. Examples include:
Country of birth (each person is born in exactly one country).
City of residence (to a first approximation, each person lives in one city).
Any attribute that takes a unique value per individual.
Histogram Sensitivity No matter how many cells a histogram has, its sensitivity is 1. Adding or removing one individual changes exactly one cell count by and leaves all other cells unchanged, because the partition ensures each individual belongs to exactly one cell.
For a histogram with cells: The Laplace mechanism adds noise to each cell, independent of .
This is one of the foremost practical advantages of DP for administrative statistics. Most government statistics — population counts by region, age, income bracket, and so on — are histograms or contingency tables (multi-dimensional histograms). All have sensitivity 1.
Choosing the right algorithm.
For a given , there are often many -DP algorithms for the same task with different accuracy. Exploiting histogram structure yields dramatically better accuracy at no privacy cost. The comparison between algorithms is always on utility, never on privacy.
Privacy Budget Interpretation
Differential privacy can be viewed as having a total budget .
Answer one query: use full .
Answer many queries: split the budget.
Naively splitting gives per query, forcing noise .
Naive composition leads to noise growing linearly in the number of queries. Advanced composition (Chapter 8) and the Gaussian mechanism (Chapter 9) reduce this to .
Differential Privacy vs. Cryptographic Privacy
The cryptographic setting.
A sender transmits an encrypted message. The legitimate receiver learns the plaintext; the eavesdropper learns nothing useful. These two parties are different. Modern cryptography — under standard hardness assumptions — achieves this.
The DP setting.
The data analyst is both the legitimate user and the potential adversary. We cannot simultaneously let the analyst learn something useful and prevent them from learning anything.
If a data analysis algorithm teaches the analyst anything useful about the population, then some information about the individuals in the dataset is necessarily leaked. This is unavoidable. The goal of DP is not to prevent leakage entirely, but to ensure it is small, calibrated, and formally bounded.
An additional subtlety: even a well-intentioned analyst who publishes results enables a later party to combine them with other analyses from the same dataset. Privacy loss accumulates over time across all users, which is why composition theorems matter.
The Exponential Mechanism
The Laplace mechanism works for real-valued outputs. But many natural outputs are discrete or categorical — the most common search query string, the best expert among a panel, the optimal auction price. Adding noise to these does not make sense.
Exponential Mechanism Let be a finite set of possible outputs, and let be a utility function with sensitivity The exponential mechanism outputs with probability proportional to
Exponential Mechanism Is -DP satisfies -differential privacy.
Proof sketch. Fix adjacent and any . Let . The first factor is at most by definition of . For the second, each term in is at most times the corresponding term in , so . Multiplying: ratio . ◻
Why the factor of 2?
Adding one individual can increase the utility of some outcomes and decrease the utility of others simultaneously. The denominator accounts for this: the numerator contributes at most , and the ratio of normalizing constants contributes another .
Exponential Mechanism Accuracy Let and . For any :
Proof sketch. Bound the numerator by the total unnormalized weight of all bad outputs, and the denominator by the weight of the optimal outputs alone: ◻
Outputs far below the optimum are exponentially unlikely. This bound is a template: plug in , , and the gap for each application.
Limitations of Independent Noise
Laplace answers queries independently, with noise uncorrelated across queries. It cannot exploit structure shared between queries.
Better mechanisms (e.g., SmallDB, Chapter 7) introduce correlated noise to answer many queries more efficiently.
SmallDB: Nets, Exponential Mechanism, Accuracy
Motivation: Answering Exponentially Many Queries
With data points and Laplace noise, we can accurately answer roughly adaptive queries. Can we do better? Remarkably, yes: with the exponential mechanism we can answer exponentially many counting queries by releasing a synthetic database.
Setup.
We have a real database of rows and a large collection of counting queries. Instead of answering each query directly, we release a synthetic database that approximates the fractional answers to all queries in . The fractional query is . We want such that for all :
The SmallDB Algorithm
Outcome space.
The exponential mechanism chooses from the set of all small databases of size drawn from the same universe as . Crucially, depends only on and , not on .
Utility function.
For a candidate small database : All utilities are ; a utility close to 0 means agrees well with on all queries.
Sensitivity.
Under the swap adjacency (replace one row of ), each fractional query changes by at most , so .
Privacy and accuracy.
The exponential mechanism with parameter is -DP, and with high probability outputs within of on all queries.
The Histogram Representation
Fix the universe of all possible data rows with types
Histogram Representation The histogram of a database of size is the vector where is the number of rows in of type . Every database corresponds to a unique histogram (up to row order), and vice versa.
A small database of size corresponds to a histogram with entries summing to . Even if the universe has types, a small database of size has at most nonzero histogram entries.
The Net Theorem and the Probabilistic Method
-Net (w.r.t. ) A set of databases is an -net for if for every database there exists with
Small Databases Form a Net Let be any finite collection of counting queries. The set of all databases of size is an -net for : every large database is within of some element of .
Proof via the probabilistic method. Fix any database of size . Construct a random small database of size by drawing independently, each equal to type with probability .
Step 1. For any : . So is an average of i.i.d. -valued variables with mean .
Step 2 (Chernoff bound). .
Step 3 (Union bound). for .
Step 4 (Probabilistic method). Since the probability of being bad is strictly less than 1, a good must exist. That lies in , so is an -net. ◻
To prove that a good object exists: construct a random object, show the probability of it being bad is strictly less than 1, and conclude a good one must exist. The argument does not find the object explicitly, only guarantees its existence. This technique, popularized by Erdős, appears throughout combinatorics and theoretical CS.
Why this is surprising.
The size depends only on and , completely independent of . No matter how large the original database, a tiny synthetic database of size can approximate all queries.
Accuracy of SmallDB
From the exponential mechanism accuracy theorem: where is the net approximation error, the second term is the privacy penalty, and the third is a confidence correction.
Size of the Net
Each database in has rows drawn from , so , giving:
Optimizing the Error
Plugging into the accuracy bound and balancing against the privacy term: The absolute error satisfies .
SmallDB Accuracy
Why This Does Not Break Privacy Lower Bounds
Reconstruction theorems say: too many queries answered too accurately reconstruction of the database. SmallDB avoids this because the error is large enough to prevent reconstruction — the noise is not too small.
Feature Dimension Warning
The accuracy bound depends on . If individuals have many features, grows exponentially and the error grows accordingly.
DP works best when:
is large (many individuals), and
is small (relatively few features per individual).
Comparison with Laplace
Laplace: answers each query independently with noise ; no structure across queries is exploited.
SmallDB: releases one synthetic dataset; answers are correlated; supports query classes of exponential size.
SmallDB uses correlated noise implicit in the synthetic database to answer exponentially many queries at error , far better than Laplace’s for large .
Advanced Composition and Privacy Loss
Motivation: Going Beyond Simple Composition
Simple composition says that applications of an -DP mechanism cost in privacy. For large this bound is too pessimistic. Advanced composition shows the true cost scales like — an exponential improvement for high-query regimes.
The key insight is that privacy loss is a random variable, not a fixed constant. It can be negative, and the positive and negative losses partially cancel. The cumulative loss behaves like a biased random walk.
The Adaptive Composition Game
Advanced composition is proved via a general game that captures cumulative privacy loss across different databases and mechanisms, not just repeated queries to one database.
The game.
The challenger fixes a secret bit at the start.
In each round :
The adversary chooses a pair of adjacent databases and an -DP mechanism (adaptively, based on all prior outputs).
The challenger returns .
After rounds, the adversary guesses .
The adversary may use a different pair of databases and a different mechanism each round. This models your cumulative privacy loss across all databases you participate in throughout your life, not just one interaction.
Privacy Loss Random Variables
Privacy Loss Random Variable For mechanism run on database , compared against adjacent database , the privacy loss random variable for output is: We sample this random variable by running and observing the output .
For an -DP mechanism: almost surely (this is exactly the bounded log-ratio condition).
Negative Privacy Loss and the Random Walk Intuition
When is privacy loss negative?
The loss is negative when : the observed output is more likely under the adjacent database than under the true database . Instead of giving a hint toward , the output points away from it, giving the adversary a false read.
The random walk picture.
Imagine your database is . Each mechanism output shifts the adversary’s belief slightly toward (positive loss) or away from it (negative loss). Since is the true database, outputs are somewhat more likely under , so the walk has a slight positive drift. But many steps go in the negative direction, partially canceling the drift. The cumulative loss after steps behaves like rather than , just as a random walk with drift has standard deviation after steps.
Expected loss is , not .
A technical lemma (proved using KL divergence properties) shows: (The improved bound without the factor of 2 was established in later work.) Since , the expected loss per step is — the positive and negative losses cancel to a much smaller residual than the worst case.
Adversary Views and Bad Views
Two parallel worlds.
Define the adversary’s view as everything it observes: its own randomness and all outputs . There are two parallel versions:
: the view when the secret bit is (challenger always runs ).
: the view when the secret bit is (challenger always runs ).
Privacy fails if these two views are distinguishable.
By the chain rule of probability and the DP bound at each step: where is the privacy loss at step , conditioned on the shared history.
Bad views.
A view is bad if for some target . Privacy fails only when the adversary lands in a bad view. We decompose: for any set . If the probability of a bad view is at most , the mechanism is -DP.
Applying Azuma–Hoeffding
The privacy losses form a martingale difference sequence: each is bounded , and . The Azuma–Hoeffding inequality applies to exactly this setting:
Setting gives the right-hand side equal to , and:
Advanced Composition for Pure DP For every , the adaptive composition of mechanisms each satisfying -DP satisfies -DP, where: For small , the dominant term is , compared to the naive of simple composition.
Optimal privacy budget.
Equating the two terms and solving for as a function of : choosing minimizes the total privacy loss for a fixed number of queries.
Approximate Differential Privacy and the Gaussian Mechanism
Motivation: The Limits of Pure DP
All the mechanisms we have seen so far satisfy pure -differential privacy: for all adjacent and all events , . This is a worst-case, information-theoretic guarantee.
The ubiquitous Gaussian distribution — beloved in statistics for its tail concentration and its connection to least-squares estimation — cannot satisfy this guarantee. Accommodating Gaussian noise requires a relaxed definition.
Why Gaussian Noise Does Not Give Pure DP
The natural question is: why use Laplace noise rather than Gaussian noise? Gaussian noise is familiar, analytically convenient, and has lighter tails. The answer is that Gaussian noise cannot satisfy pure -DP.
The log-ratio argument.
Pure -DP requires the log-ratio to be bounded by for all outputs and all adjacent . For the Laplace distribution, this ratio is bounded everywhere because the PDF decays exponentially and the ratio of two shifted Laplace PDFs converges to a fixed constant. For the Gaussian vs. : This is linear in and grows without bound as . No finite can bound the log-ratio over all outputs.
Gaussian noise gives -DP (approximate DP) for appropriate parameters, but never pure -DP for any finite .
Sensitivity
Sensitivity The sensitivity of a function is:
Comparison to sensitivity.
For counting queries (each output coordinate is a fraction in ):
sensitivity: (each query can change by per person, and one person can affect all queries, giving total change ; scaling to sensitivity-1 queries gives ).
sensitivity: (Cauchy–Schwarz: ).
Since for large , the Gaussian mechanism can add far less noise than Laplace for high-dimensional queries — at the cost of the pure-DP guarantee.
Approximate -Differential Privacy
We relax the pure DP guarantee by allowing a small additive failure probability .
-Differential Privacy (Approximate DP) A randomized mechanism satisfies -differential privacy if for all pairs of adjacent databases and all measurable events : The special case recovers pure -DP.
Interpretation.
With probability at most , the mechanism may “fail” — the ratio of output probabilities on adjacent databases may exceed . On the remaining probability mass, the standard bound holds.
Quantifier order: pure vs. approximate.
There is a subtle but important difference:
Pure DP. Fix ; simultaneously for all adjacent and all , the ratio condition holds with probability 1.
Approximate DP. Fix and ; a priori the probability of a “bad” event is at most . But an adaptive adversary who chooses after seeing the output might be able to find an adjacent pair that violates the ratio for that particular output.
Pure DP is strictly stronger. In practice, approximate DP is widely used because it enables the Gaussian mechanism and better composition bounds.
How Small Must Be?
Consider the following “mechanism” on a database of size : select one uniformly random individual and publish their complete record. This satisfies -DP, yet it explicitly exposes one person’s data with probability .
From any single person’s perspective, their chance of exposure is small. But consider an insurer covering the database operator against privacy-loss claims: this mechanism generates a privacy breach every single time it is run, and the insurer must pay damages on every run.
Rule of thumb. should be cryptographically small: decaying faster than the inverse of any polynomial in . Values like or smaller are considered acceptable in practice.
Sensitivity
The Gaussian mechanism adds noise calibrated to the sensitivity, which can be substantially smaller than the sensitivity used by Laplace.
Sensitivity For , the sensitivity is
Comparison for counting queries.
For arbitrary counting queries, adding or removing one individual can change each count by at most 1, so has at most nonzero entries each in .
sensitivity: (worst case: one individual affects all counts).
sensitivity: (since and each coordinate is at most 1).
For arbitrary counting queries: The sensitivity is smaller by a factor of .
The Gaussian Mechanism
Gaussian Mechanism Let . For privacy parameters , the Gaussian mechanism releases where
Gaussian Mechanism Privacy With as defined above, the Gaussian mechanism satisfies -differential privacy.
Why sensitivity?
The mechanism adds independent Gaussian noise of the same variance to each coordinate. The privacy loss depends on : the distance between the outputs on adjacent databases. Calibrating to ensures coverage of the worst-case pair.
Accuracy of the Gaussian Mechanism
For a single coordinate , standard Gaussian tail bounds give Applying a union bound over all coordinates:
Gaussian Accuracy ( Queries) With probability at least , the Gaussian mechanism satisfies
Laplace vs. Gaussian: A Comparison
For arbitrary counting queries (so , ):
| Laplace | Gaussian | |
|---|---|---|
| Privacy guarantee | Pure -DP | -DP |
| Noise scale | ||
| Savings for queries | — | factor |
| Queries must be fixed? | No (online) | No (online) |
Gaussian noise scales like instead of , matching the improvement from advanced composition — but at the cost of approximate rather than pure DP.
Connection to Advanced Composition
Advanced composition and the Gaussian mechanism both exploit the same phenomenon: with high probability, privacy loss accumulates like , not .
Advanced composition (pure DP): Run mechanisms each -DP. Cumulative loss is with probability .
Gaussian mechanism (approximate DP): Answer queries with -calibrated noise. Error per query scales like .
Both results pay a small failure probability in exchange for a improvement over the naive bound. In both cases should be cryptographically small.
Sparse Vector and Private Multiplicative Weights
Motivation: Answering Many Queries Cheaply
So far every mechanism we have studied pays a privacy cost proportional to the number of queries answered. Sequential composition says queries each at privacy level costs total. Can we do better when most queries have values that fall below a threshold?
The key observation: reporting that an answer is below a threshold is cheap. If a verifier only needs to know which queries are above a threshold , we can inspect many queries privately while paying full privacy cost only for the ones we actually reveal.
The Sparse Vector Technique
Above-Threshold (Sparse Vector) Given a sequence of sensitivity-1 queries on dataset , a threshold , a count limit , and privacy parameter :
Sample a noisy threshold .
For each query :
Sample .
If : output , decrement .
Else: output .
Halt when .
SVT Privacy Above-Threshold satisfies -differential privacy.
Proof sketch.
The crucial insight is that outputs reveal essentially nothing about : saying “this query is below the noisy threshold” is a statement about noise, not data. The formal argument proceeds by noting that:
The noisy threshold is sampled once and depends on only through the fixed ; adjacent datasets shift the threshold by at most (sensitivity of ).
Each output involves comparing to . Changing one person shifts by at most 1, absorbed by noise of scale .
outputs are never re-sampled, so they leak nothing about beyond the already-noisy comparison.
A coupling argument over adjacent bounds the log-likelihood ratio by .
We may privately inspect arbitrarily many candidate queries but pay full privacy cost only for the (at most ) queries that cross the threshold. Rejections are “free” in the privacy budget. This mirrors the logic of Report Noisy Max: the mechanism compresses its output, and the privacy analysis exploits that compression.
Accuracy.
If a query satisfies (well above threshold), it is reported with high probability; if (well below), it is reported with high probability. The error probability for a single query is , so for and queries, the overall error is small when .
Application: private query release.
If an analyst submits queries one at a time and only cares which ones are significant (above threshold), SVT answers all of them at the same privacy cost as answering individually. This is useful when the “interesting” queries are sparse among a large pool of candidates.
Private Multiplicative Weights (PMW)
Sparse vector tells us which queries are significant; Private Multiplicative Weights uses those answers to build a synthetic database that answers future queries accurately.
Setting.
We have a true dataset over a universe of records, and we want to maintain a candidate distribution over such that for any future linear query , .
Algorithm.
Initialize to the uniform distribution over . At each round :
The analyst submits query .
If (small error): output the noisy answer and do not update ().
Otherwise (significant mistake): update via multiplicative weights: where is a learning rate. This multiplicatively downweights records that contribute to the mistake.
Potential function analysis.
Define the potential Two facts drive the analysis:
Upper bound: (uniform initialization maximizes entropy).
Descent: each significant update decreases by at least .
PMW Convergence The number of significant updates (rounds in which the algorithm updates ) is at most
Proof.
Each significant mistake means , which causes to drop by at least (by a Taylor expansion of after the multiplicative update, setting ). Since and , there can be at most such drops.
Privacy.
Each significant round uses one noisy answer (via the Laplace mechanism at scale ) to decide whether to update. By the convergence theorem, only such answers are ever used, so the total privacy cost is for a per-query budget . Choosing gives -DP overall.
Accuracy.
After the synthetic database stabilizes (no more significant updates), it answers any query in the query class to within error . Setting and the noise scale accordingly gives:
PMW Accuracy For any class of linear queries, PMW with appropriate parameters outputs a synthetic database such that with high probability, under -differential privacy.
Sparse Vector and PMW are complementary. SVT identifies which queries the current hypothesis answers badly (using privacy budget only for those). PMW uses those bad queries to update the hypothesis. Together they implement a private boosting loop: repeatedly find a hard query, update the synthetic data, repeat — until no hard query remains. This is the essence of the SmallDB algorithm (Chapter 7).
Paper Readings
Dwork, Naor, Reingold, Rothblum, Vadhan (2009) — On the Complexity of Differentially Private Data Release.
Introduces the Sparse Vector Technique as a tool for answering many queries while charging privacy cost only for those whose answers cross a significance threshold. The main result characterizes when private data release with low error is computationally feasible, and shows that restricting to above-threshold queries dramatically reduces the effective privacy cost relative to answering everything. The SVT mechanism analyzed in this chapter is a direct instantiation of these ideas.
Hardt and Rothblum (2010) — A Multiplicative Weights Mechanism for Privacy-Preserving Data Analysis.
Shows that the private multiplicative weights algorithm achieves near-optimal accuracy for releasing all linear queries over a data universe under differential privacy. The key insight is a potential function argument: the KL divergence from the true data distribution to the current synthetic hypothesis decreases by a fixed amount per significant update, bounding the total number of corrective rounds by . This gives the first efficient differentially private synthetic data generator with provable accuracy guarantees for an exponentially large query class.
The US Census, Reconstruction, and Why DP Was Needed
Origin Story
When Cynthia Dwork and colleagues began thinking about privacy for statistical analysis of large datasets around 2001, the model they had in mind was the US Census. The Census is a great cause: it counts the population, determines political representation, and allocates hundreds of billions of dollars in federal funds—with no commercial interest involved. Crucially, unlike most data holders, the Census Bureau is legally mandated to protect confidentiality, providing a genuine customer for rigorous mathematical privacy guarantees.
The connection between differential privacy and the Census developed over several years. Adam Smith (later a co-inventor of DP) was among the early collaborators who recognized that the Bureau’s existing confidentiality methods—while well-intentioned—could not withstand the kind of reconstruction attacks that were becoming computationally feasible. In 2017, the Bureau carried out internal reconstruction tests, confirmed that their prior methods were insufficient, and decided to modernize using differential privacy. The 2020 decennial census was the result.
Why the Census Matters
The decennial census is a constitutionally mandated enumeration of all people—not just citizens—living in the United States. Its outputs drive:
Congressional apportionment. The 435 seats in the House of Representatives are allocated among states by the Huntington–Hill algorithm based on state population totals. When one state loses population and another gains, a seat transfers.
Electoral college. Each state’s electoral votes equal its House seats plus two senators—directly derived from Census counts.
Redistricting. Within each state, congressional and legislative district boundaries are drawn to equalize population ( variation is the judicial standard). These numbers also feature in Voting Rights Act lawsuits about minority representation.
Federal funding. Hundreds of billions of dollars in formula-driven programs (education, infrastructure, housing) flow to states and localities based on population counts.
Policy research. Researchers and policymakers use fine-grained demographic data to measure disparities, plan school resources, and target public services.
Marginalized populations—undocumented immigrants, people experiencing homelessness, communities with historical distrust of government—are systematically harder to enumerate. States that invest more in outreach get more accurate (and advantageous) counts.
What the Census Collects
The 2020 decennial census form collected, for each person in each household:
Name and whether the person normally lives elsewhere (college students, incarcerated individuals, and rehab residents are counted at their current location).
Relationship to person 1 (spouse/partner, biological/adopted child, parent-in-law, roommate, foster child, etc.).
Sex (two options in 2020).
Age and date of birth.
Ethnicity: Hispanic/Latino origin (Mexican, Puerto Rican, Cuban, etc.) or not. In Census terminology “ethnicity” always means Hispanic or non-Hispanic.
Race: checkboxes for White (with origin detail), Black or African American, American Indian or Alaska Native (with tribal affiliation), Chinese, Filipino, Asian Indian, Vietnamese, Korean, Japanese, other Asian, Native Hawaiian, Samoan, Chamorro, other Pacific Islander, or some other race. Multiple boxes may be checked, yielding 63 possible combinations.
What counts as a “race” on the Census form is explicitly political and has changed dramatically over time—Jews and Italians have at various points been proposed as separate races. Race is always self-identification; people change their declared race between censuses, and the Bureau does not challenge such changes.
Legal Confidentiality Requirements
The Census is governed by Title 13 of the US Code, which imposes strict confidentiality obligations:
Every Census Bureau employee takes a lifetime oath of confidentiality—binding even after leaving the Bureau.
Penalties: disclosing any personal information carries up to five years in prison, a $250,000 fine, or both.
Census data may not be shared with any other part of government for law enforcement or any non-statistical purpose. (This was enacted after the WWII internment of Japanese Americans, in part enabled by Census data.)
The Secretary of Commerce may publish statistics (tabulations) but not anything that “discloses the information reported by or on behalf of any particular respondent.”
“In no case shall information furnished be used to the detriment of any respondent.”
Because responding to the Census is legally required, confidentiality protections are essential for encouraging accurate responses, especially from people who fear the government. The Bureau does not do law enforcement; even people who are breaking the law should feel safe in reporting their true situation.
Why Privacy Harms Are Real
Section 8 housing eviction. Federal housing leases specify maximum household occupancy. If Census data reveals that a household has more occupants than their lease permits, the family could be evicted and become homeless—a direct, concrete harm from privacy compromise.
Legal prosecution. A family reports a 13-year-old girl where a prior census recorded a 3-year-old boy. In states where supporting gender re-identification is illegal, this could result in prosecution.
Doxing and harassment. Even if your neighbors know your household is a same-sex couple, a compiled national list of gay households is qualitatively different from distributed local knowledge. Information known in a distributed fashion has different safety implications than information in a centralized, searchable list that could be weaponized.
The Bureau’s own rules: responses cannot be used to the detriment of any respondent. Each example above is a case where published statistics could, via reconstruction, be used to harm the very people who trusted the Bureau with their data.
Census Geography
The Bureau’s fundamental geographic unit is the census block—the smallest unit, ranging from zero to roughly 2,000 inhabitants (the density of a city block). The Bureau uses the analogy of pixels: it is acceptable to blur the pixels a little, as in an Impressionist painting—when you step back, you still see the correct picture.
Blocks aggregate upward in a hierarchy: Additional overlapping geographic entities—zip code tabulation areas, school districts, voting districts—are also constructed from block-level data. American Indian, Alaska Native, and Native Hawaiian areas have their own separate spine because these communities cross state boundaries and have very small populations that require special handling.
The Old Method: Record Swapping
Before differential privacy, the 2010, 2000, and 1990 censuses used a method called record swapping:
Identify “at-risk” households—those that stand out in their neighborhood (racial minorities in a non-diverse block, unusually large households, same-sex couples in an area without others like them, etc.).
Find a “match” household elsewhere in the country that agrees on total population and voting-age population.
Swap all the detailed records between the two households.
The exact algorithm was secret, may not have been fully algorithmic, and was not applied uniformly across demographic groups. The swapped dataset—the “100% data file”—was treated as the Bureau’s official reference, and all tabulations were computed from it.
The problem.
The swapping rate was low (typically a small fraction of households), which means the 100% data file was very close to the original Census Edited File (CEF). And as we will see next, no amount of swapping could protect against reconstruction from the sheer volume of statistics released.
Scale of the 2010 Census Release
From the 2010 census, the Bureau published:
150 billion statistics in total.
86 billion linearly independent statistics at the block level.
241 million linearly independent statistics at the tract level.
This is a massive collection of accurate, fine-grained aggregate counts with essentially no noise added for privacy.
The Reconstruction Attack
The Bureau’s internal team (later published in 2025 after security clearance) showed that published statistics could reconstruct the 100% data file.
BEARS fields.
The attack focused on five fields (the acronym BEARS): Block, Ethnicity, Age, Race, Sex. Each individual can be characterized by their combination of BEARS values—their “person type.”
The reconstruction procedure.
From the published tabulations, extract the count of each BEARS person-type in each block. This yields a large system of linear/integer constraints that any consistent microdata set must satisfy.
Feed the constraints to a commercial integer program solver to reconstruct a candidate dataset consistent with the published statistics.
The reconstructed dataset is called the Reconstructed 100% Data File (RHDF).
Solution variability.
The solver may find multiple solutions. The attackers exploited this by solving a second integer program: given the published solution, find the dataset maximizing distance from it—but the true dataset is also a valid solution. If this maximum distance is small, the true dataset cannot be far from the reconstruction. The attacker can certify how accurate the attack was using only public information.
In practice, most blocks had only one solution consistent with the published statistics, meaning the published data uniquely determined individual-level BEARS information for most people.
Re-identification.
Once BEARS fields are reconstructed, the attacker links the reconstructed dataset to commercial databases (voter rolls, credit records, etc.) that share block, age, race, and sex. Reconstruction followed by re-identification is then trivial.
This attack is exactly the Fundamental Law of Information Recovery (Chapter 5) in action. The Bureau released overly accurate answers to far too many statistics—86 billion at the block level alone. By the Dinur–Nissim reconstruction theorem, this was blatantly non-private, regardless of the swapping applied beforehand. The Bureau knew about the 2003 reconstruction theorem before the 2010 census; the techniques to exploit it had simply become faster and cheaper.
The lawyers’ reaction.
When the Bureau’s statisticians and computer scientists presented these findings, the lawyers asked: “Can we retract the 2010 Census publications?” The data were already on the public web and could not be clawed back. The lawyers concluded: “We can’t do this again.” The Bureau’s argument to itself: the distinction between publishing microdata (protected by subsampling) and publishing tabular statistics (no explicit protection) is not justified. From enough accurate tabulations, one can reconstruct microdata without any sampling secrecy.
Why Swapping Was Not Enough
The Bureau’s own argument: since the RHDF closely reproduced the 100% data file (post-swapping), and the 100% data file was already very close to the original CEF (swapping was low-rate), the reconstruction was essentially recovering the true census microdata. The Bureau decided this violated its own confidentiality mandate.
No amount of swapping can protect against reconstruction when the number of published statistics exceeds the effective entropy of the dataset.
Concentrated Differential Privacy
The scale of the Census—billions of statistics, millions of geographic units, tight accuracy requirements for redistricting—motivated a variant of differential privacy called concentrated differential privacy.
Motivation.
Recall from advanced composition (Chapter 8): to achieve -DP over mechanisms, each individual mechanism must use noise of order . The factor is annoying: when must be cryptographically small, this factor can be as large as 10, forcing 10 more noise.
The key insight: the guarantee is itself probabilistic. Why require each building block to never exceed ? If in expectation each step contributes , and the excess cancels out, we get the same asymptotic behavior without the penalty.
Definition.
Informally, concentrated differential privacy (CDP) requires that the privacy loss random variable behaves like a Gaussian: This is exactly the tail behavior of a Gaussian distribution—hence “concentrated.”
Adding noise from makes the privacy loss random variable itself sub-Gaussian with mean proportional to . This is why the Gaussian mechanism naturally fits the CDP framework.
Zero-concentrated DP (zCDP).
Dwork and Rothblum introduced an initial version of CDP. Bun and Steinke later introduced zero-concentrated differential privacy (zCDP), using a slightly different characterization of sub-Gaussian random variables that achieves exact closure under post-processing. zCDP is the variant used in the 2020 Census.
Practical benefit.
Under zCDP, composing mechanisms eliminates the overhead entirely. For the Census, where must be extremely small, this represents a factor of up to reduction in the noise that must be added—a massive accuracy gain for redistricting.
The Lawsuits: Why 16 States Sued
Following the Census Bureau’s adoption of differential privacy for the 2020 decennial census, sixteen states—predominantly Republican-led—brought suit, arguing that DP produced unreliable data. The stated technical argument:
“Because differential privacy creates false information by design, it prevents the states from accessing municipal-level information crucial to performing this essential government function.”
A few observations on this argument:
State-level counts are preserved.
Differential privacy in the 2020 Census (the TopDown algorithm) preserves exact state-level population totals, which are the constitutional basis for House apportionment and electoral college votes. DP noise is applied only at finer geographic levels. Any accuracy concerns about redistricting must be weighed against the accuracy gains from having a mathematically rigorous, auditable guarantee, versus the old swapping method whose error was uncharacterized and secret.
Paper Readings
Abowd et al. (2025) — The 2010 Census Confidentiality Protection Evaluation.
Using only publicly released 2010 Census tabulations, the authors reconstructed the BEARS fields (block, ethnicity, age, race, sex) for essentially all individuals in the 100% data file, then linked the reconstruction to commercial databases to re-identify a large fraction of the population. The paper was classified for years due to its sensitivity and released only after the 2020 Census was finalized; it provided the definitive technical justification for the Bureau’s adoption of differential privacy.
Abowd et al. (2022) — The 2020 Census Disclosure Avoidance System.
Full specification of the TopDown algorithm used in the 2020 Census: a hierarchical allocation of a global zCDP privacy budget that processes the geographic hierarchy from nation down to census block, using integer programming at each level to ensure consistency of counts across geographic units. The algorithm and its code are publicly available on GitHub, and it was tested against 2010 data during an extended public comment period — allowing affected communities, including Native American tribes whose geographic units cross state lines, to advocate for changes in budget allocation before the 2020 enumeration.
DP Protects Against Overfitting
Friedman’s Paradox
Consider a standard regression setting. We have a design matrix where each row is an observation (a person) and each column is a feature. We observe an outcome vector and believe it satisfies for some true weight vector and small noise . A natural data-analysis workflow is:
Fit by minimizing .
Inspect the coefficients: drop features whose fitted weight is near zero (“clearly irrelevant”).
Refit the equation on the remaining features and report a clean model.
This seems entirely reasonable. Friedman’s paradox shows it is catastrophically wrong.
The setup.
Let every entry of be an independent draw from , and let also be a vector of independent draws. There is no real relationship between and whatsoever.
The problem.
Even so, the procedure above finds “significant” predictive features. The reason is anti-concentration: by ordinary sampling variation, some features will, purely by accident, be slightly further from their expected value than others. The procedure selects those accidentally-extreme features and then declares victory — but the relationship is a statistical fluke, not a real signal.
Formally: we are implicitly taking the maximum over many random variables. The maximum of i.i.d. mean-zero variables is not mean-zero; it is . By keeping only the features with large fitted weights, we are conditioning on a high-probability event of the noise, then treating the conditioned noise as signal.
The methodological error is adaptive feature selection: the decision of which features to keep is made by looking at the data, and then the same data are used to evaluate the selected features. This is a form of double-dipping.
Exploratory vs. Adaptive Data Analysis
In statistics, the general practice of “looking around in the data for a signal before deciding what to ask” is called exploratory data analysis (EDA). It is ubiquitous and has no universally accepted principled remedy.
In computer science the same phenomenon goes by a different name: adaptive data analysis. The analyst adapts the next question to the answers received so far. This dependence between queries and the data set is the root cause of overfitting.
Why naivety and malice are indistinguishable.
Friedman’s paradox shows that a completely well-intentioned analyst using a standard procedure can produce results indistinguishable from deliberate data manipulation. We therefore cannot rely on the good intentions of analysts when designing statistical methodology: we must build defenses that are robust even against the worst case.
Overfitting, formally.
Overfitting A predictor, classifier, or hypothesis overfits if it identifies a pattern that is specific to the data set used to find it and does not generalize to the distribution from which that data set was drawn.
Concretely: if a trained classifier achieves 95% accuracy on the training set but only 55% accuracy on fresh draws from the same distribution, it has overfit. The training effort was wasted; the model learned noise, not signal.
The Accuracy Adversary
We formalize the problem by defining an adversary whose sole goal is to cause overfitting.
Setup.
Fix a universe , a distribution on , a data set drawn i.i.d. from , and a class of counting queries: functions .
For a query define:
Accuracy Adversary The accuracy adversary is a computationally unbounded algorithm that interacts adaptively with a mechanism operating on . Its goal is to find a query such that i.e., to find a query for which the data set is not -representative of the population. The threshold is a parameter chosen by the analyst (e.g., corresponds to a polling accuracy of ).
The adversary is modeled as purely malicious for the same reason cryptographic security definitions assume the worst-case attacker: it makes the guarantee unconditional. An honest-but-naive analyst is captured as a special case.
Non-Adaptive Baseline: Chernoff Bound
If the queries are fixed before the data set is collected (non-adaptive), standard concentration bounds already give strong guarantees.
Non-Adaptive Accuracy (Chernoff Bound) For any fixed query and data set of size drawn i.i.d. from : By a union bound over fixed queries, to ensure that all queries are simultaneously -accurate with probability , it suffices to have This grows only logarithmically in the number of queries.
The key word is “fixed in advance.” This guarantee fails completely if queries are chosen adaptively based on answers to previous queries.
The Killer Query
To see why adaptivity destroys non-adaptive accuracy guarantees, suppose the adversary has somehow learned the data set exactly. Define:
Then:
The gap is , which exceeds any reasonable . The killer query is trivial to construct once the data set is known.
How might an adversary learn ? Via a coding query: define (treating elements as integers), then is a binary encoding of . Alternatively, the adversary could launch a database reconstruction attack (as studied in Chapter 11). Either way: if the adversary learns , the game is over.
This motivates our goal: answer queries in a way that prevents the adversary from learning too much about , even adaptively.
Formal Model of Adaptive Data Analysis
The adaptive interaction.
The adversary proceeds in rounds:
Choose query (with no access to ; this round is trivially non-adaptive).
Receive answer from mechanism .
Choose based on . Receive .
Choose based on . Receive .
The adversary wins if any is bad for (i.e., ).
Why the first query is safe.
At round 1, has not seen any answer from . Therefore is completely independent of . By the Chernoff bound, , regardless of the adversary’s strategy.
Simple solution: data splitting.
Reserve fresh samples for each query. Answer using its own reserved subsample (then discard those samples). This handles queries but wastes data linearly. We want exponentially better.
Max-Information
The key to proving that differential privacy prevents overfitting is a new information-theoretic quantity introduced by Dwork et al.
Max-Information Let be jointly distributed random variables, where is a random data set and is a random query (or more generally, any random variable correlated with via adaptive interaction). The max-information is the smallest such that for all in the support of and all in the support of :
Intuition.
: and are completely independent. Observing the query tells you nothing about the data set.
: observing can increase the probability of any particular data set by at most a factor of . As grows, the query leaks more about the data set (and vice versa).
Connection to mutual information.
Max-information is a worst-case variant of mutual information from information theory. Standard mutual information measures the average reduction in uncertainty; max-information measures the worst-case increase in log-probability. The symmetry follows from Bayes’ theorem: the condition is equivalent to (up to the same constant ), by a Bayes’ theorem rearrangement.
Differential Privacy Bounds Max-Information
DP Bounds Max-Information
Let be an -differentially private mechanism operating on data sets of size . Let be the random query produced by any adaptive adversary interacting with , and let be the random data set. Then:
Proof. We show for all , which gives after taking .
Step 1 (Averaging argument). By definition of conditional probability: This is an average of over . Therefore there exists some achieving at most the average:
Step 2 (Group privacy). Any two data sets and of size differ on at most entries. By group privacy of -DP applied times:
Combining (1) and (2). By Bayes’ theorem (symmetry of max-information), this is equivalent to ◻
The proof uses exactly two properties of differential privacy: post-processing (the adversary’s query choice is a post-processing of the DP outputs) and group privacy (all data sets are within substitutions of each other).
DP Protects Against Overfitting
We now combine the max-information bound with the standard Chernoff sampling assumption to prove the main result.
Assumption.
For a fixed query , the probability over a randomly drawn data set that is bad for (i.e., not -representative) is at most for some constant (this follows from the Chernoff bound with ). Let denote the set of data sets that are bad for .
DP Protects Against Overfitting
Let be -differentially private with . Let be the random adaptive query produced by any adversary interacting with . Then: which is exponentially small in .
Proof. Setting gives , which is exponentially small. ◻
The key intellectual leap.
Overfitting is reframed as a win for the accuracy adversary. Once we define the adversary formally, standard tools from differential privacy — post-processing, group privacy, and composition — give a complete, quantitative, and mechanistic explanation of why DP prevents overfitting.
The Reusable Holdout
Standard holdout (and its failure mode).
The classical defense against overfitting is to reserve a holdout set that is never used during training. The analyst works freely on the training set , derives a hypothesis, and evaluates it once on . If gives a good result, the hypothesis is accepted.
The problem: if the hypothesis fails on , the analyst wants to try again. But now the choice of what to try next has been influenced by ’s answer. The holdout set is tainted and cannot be safely reused. In practice, analysts use holdout sets many times, invalidating the statistical guarantees.
The fix: wrap in a DP mechanism.
Train freely on (no privacy restrictions). But access the holdout set only through a differentially private mechanism. Because DP prevents the adversary from learning too much about , the holdout set can be queried repeatedly while maintaining valid statistical guarantees.
Conceptually: the accuracy adversary has the training set hardwired into its strategy. Its only access to is through the private mechanism. Theorem [th:dp-overfit] then guarantees that no adaptive sequence of queries can overfit .
The Algorithm: Numeric Sparse Vector
The reusable holdout has a concrete algorithmic instantiation. Given:
A training set and holdout set ,
A privacy budget (total number of DP queries to ),
An overfitting budget (number of detected overfits allowed),
Parameters (accuracy threshold) and (noise level),
the algorithm handles each incoming statistical query as follows:
Draw a random sample (from the training set).
Compare the holdout answer against the training estimate .
If the two estimates are close (within a threshold ): output the training estimate and continue. No privacy budget is spent.
If the two estimates are far apart (the training answer is overfit): output the holdout estimate, decrement the overfitting budget, and continue.
If the overfitting budget is exhausted: halt.
Numeric Sparse Vector Achieves Exponential Improvement The reusable holdout algorithm can answer exponentially many queries in total, as long as at most of them trigger the “overfit detected” branch. Only those holdout accesses spend privacy budget; the rest are answered from the training set for free.
The connection to Sparse Vector.
This algorithm is precisely Numeric Sparse Vector (a variant of the Sparse Vector Technique from Chapter 11), applied with the holdout mechanism as the private database and the analyst’s queries as the input stream. Sparse Vector was introduced as an abstract privacy tool; here it reappears as the heart of a practically motivated reusable holdout mechanism.
Paper Readings
Dwork et al. (2015) — Preserving Statistical Validity in Adaptive Data Analysis.
Shows that running adaptive statistical queries under differential privacy bounds the max-information between the dataset and the sequence of query answers, which in turn implies that all reported p-values and confidence intervals remain honest. Classical statistical practice assumes queries are chosen independently of the data; this paper formalizes what goes wrong when they are not, and proves that DP is a sufficient condition for validity even under arbitrary adaptivity. The result reframes differential privacy as a tool for statistical integrity rather than purely for individual privacy, connecting the two halves of this course.
Foundations of Modern Cryptography
What is Cryptography?
Cryptography: building secure systems
Cryptanalysis: breaking them
Cryptology: both together
Modern cryptography studies how to achieve secrecy, authenticity, proof, randomness, privacy, and computation even in adversarial environments. Cryptography makes the impossible possible.
What Problems Does Cryptography Solve?
Secure communication: secrecy (confidentiality), integrity (no tampering), authentication (know the sender).
Digital signatures: authenticity + transferable proof of origin (not just convincing the receiver, but any third party).
Pseudorandom generators: “stretch” a random seed to a longer string that “looks” random.
Collision-resistant hash functions: hard to find with . In practice, signatures are applied to a hash of the message, not the full message.
Commitment schemes: commit to a secret value by publishing that is hiding (reveals nothing about ) and binding (hard to open as a different value). Analogy: write a prediction on paper, seal it in an envelope. Neither party can alter it, but nobody can read it until the envelope is opened.
Private Information Retrieval (PIR): librarian can’t determine which book you read / which data you downloaded.
Homomorphic encryption: “compute” on encrypted values.
Non-malleable encryption: given and function , can’t find .
Zero-knowledge proofs: prove a statement without revealing why it is true.
Two Innovations of Modern Cryptography
Innovation 1: Base security on complexity theory
Instead of requiring information-theoretic impossibility, require only that breaking the scheme is computationally infeasible. The central primitive is a one-way function.
One-way function, informal is one-way if: given , easy to compute ; given , computationally hard to find any with .
Hardness is computational, not information-theoretic.
A trapdoor function is a one-way function that becomes easy to invert given secret auxiliary information (the “trapdoor”). This is essential for public-key encryption: everyone can encrypt; only the receiver can decrypt.
Innovation 2: Security by reduction
If the underlying problem is believed hard, the primitive is secure. “Science wins either way”: either we get a secure scheme, or a supposedly hard problem turns out to be easy.
Complexity-Theoretic Background
Asymptotic notation
An algorithm has running time if there exist constants and such that for all , the running time is at most . This captures the growth rate but hides constants and small- behavior. Example: sorting numbers requires comparisons (both upper and lower bound).
Polynomial time and negligible functions
A problem is efficiently solvable if there exists a polynomial-time algorithm for it. In cryptography we want to argue the opposite: that no efficient algorithm can break a scheme. This requires care, since asserting “no polynomial-time algorithm exists” is an unproven conjecture for most problems of interest (and proving it would resolve P vs. NP).
We capture hardness probabilistically: a function is negligible if it decreases faster than the inverse of any polynomial—for every polynomial , there exists such that for all .
What does it mean for an algorithm to fail?
Saying an algorithm does not factor integers requires precision. Options:
Fails on all inputs of each size—too strong; easy inputs (even numbers) are trivially factorable.
Fails on all but a negligible fraction of inputs of each size—the right notion. For every polynomial and all sufficiently large , fails to factor a randomly chosen -bit number with probability at least .
The second formulation correctly captures that factoring a random integer is hard even if a constant fraction of inputs are easy.
Uniform vs. non-uniform computation
A Turing machine (or equivalently, a fixed program in C) is a uniform model: one program of fixed length works for all input sizes. A circuit family is a non-uniform model: one circuit per input size, and each circuit can be different (and can have hard-coded solutions for specific instances). Non-uniform circuits are strictly more powerful; in cryptography we usually work with uniform (Turing machine) adversaries, though the distinction matters in some proofs.
One-Way Functions
One-Way Function (informal) A function is one-way if:
Easy to compute: can be computed in polynomial time.
Hard to invert: for any polynomial-time algorithm , the probability is negligible in .
Security parameter. The string (a sequence of ones) is fed to to ensure it can run in time polynomial in . Without this, might not have enough time to read the implicit security level.
Valid inversions. Note that wins if it produces any pre-image of , not necessarily itself (since need not be injective).
Candidate: integer factoring.
Let for -bit primes . Computing is easy (multiplication); inverting (factoring the product into its prime factors) is believed to be hard. RSA is built on this conjecture. Note: the naive formulation “given a random -bit integer, factor it” is too weak because roughly half of all integers are even and trivially factorable. The correct hardness conjecture restricts to products of two random -bit primes.
Candidate: lattice problems.
Problems such as finding the shortest vector in a lattice, or learning with errors (LWE), have been studied for decades without yielding polynomial-time solutions. They form the basis of post-quantum cryptography—schemes believed to resist quantum computers. (Ajtai 1996 initiated this direction; Google’s current post-quantum transition is likely lattice-based.)
Trapdoor Functions
Trapdoor One-Way Function A trapdoor function is a one-way function equipped with a secret trapdoor such that, given , inverting is easy. Without , inversion is hard.
Trapdoor functions are essential for public-key encryption: the public key encodes , the private key encodes . Anyone can encrypt (apply ); only the key holder can decrypt (invert using ).
Finding Large Primes Efficiently
Building RSA requires generating large primes. This is surprisingly easy:
By the prime number theorem, a random -bit integer is prime with probability approximately .
Primality testing can be done in polynomial time (AKS, or probabilistic tests like Miller–Rabin).
Algorithm: repeatedly sample a random -bit integer and test for primality. Expected number of trials: . Each test runs in polynomial time in , so the whole procedure is efficient.
In practice, RSA uses primes of 1024 bits each; their product is a 2048-bit modulus. The randomization in key generation is essential: if the same prime were always chosen, an attacker could precompute.
One-Way Functions and Pseudorandom Generators
This chapter develops the formal theory underlying the primitives introduced in Chapter 13. The material follows Goldwasser–Bellare (GB) Sections 2.4.1, 3.1–3.4, and Barak Section 2.4.
Formal Definition of One-Way Functions
One-Way Function (GB Def. 2.1) A function is a one-way function if:
Efficiently computable. There is a polynomial-time algorithm computing .
Hard to invert. For every PPT adversary and every polynomial , for all sufficiently large :
The adversary receives (the security parameter in unary, so the algorithm runs in time polynomial in ) and .
Success means finding any preimage of , not necessarily itself.
The probability is over the uniform choice of and the adversary’s internal randomness.
“Hard” means success probability is negligible — smaller than for every polynomial .
Important warning.
OWF hardness is directional (easy forward, hard backward), not the same as NP-hardness. OWF existence is an unproven assumption; it implies P NP but is believed to be strictly stronger.
One-Way Permutation A one-way permutation is a one-way function that is also a bijection (one-to-one and onto). Equivalently, is an efficiently computable, length-preserving permutation of that is hard to invert.
One-way permutations are strictly easier to work with than general one-way functions when constructing PRGs: because is a bijection, feeding a uniform -bit seed through still produces a uniform -bit output, which lets the hybrid argument go through cleanly.
Hard-Core Predicates
A one-way function hides its input when given , but how much does it hide? A hard-core predicate extracts a single bit of that is provably hidden.
Hard-Core Predicate (GB Def. 2.48) A poly-time computable function is a hard-core predicate for if for every PPT and every polynomial , for all sufficiently large :
In words: given , the adversary cannot guess with probability noticeably better than (random guessing).
An alternative but equivalent characterization (GB Def. 2.50):
Hard-Core Predicate, Indistinguishability Form (GB Def. 2.50) is a hard-core predicate for if and only if where is a uniformly random bit independent of . That is, the bit looks like a fresh random bit to any poly-time observer who sees .
The Goldreich–Levin Theorem
The most important result about hard-core predicates is that every one-way function has one — we need not search for -specific tricks.
Goldreich–Levin (GB Thm. 2.49) Let be any one-way function. Define (That is, takes a -bit input, outputs concatenated with .) Then is a hard-core predicate for .
Why must be included in the output of ?
To compute , the receiver needs . So reveals (which is public anyway) while hiding (since is one-way). If were hidden, even the legitimate user could not evaluate .
Proof sketch (by reduction).
Suppose predicts with advantage . One constructs a reduction that, given , uses as a subroutine to recover with non-negligible probability — contradicting that is a OWF. The key idea: is a random parity of ; random makes all such parities “look independent,” so any non-trivial prediction of the parity implies partial knowledge of .
Pseudorandom Generators: Definitions
A pseudorandom generator (PRG) stretches a short truly random seed into a longer output that is computationally indistinguishable from uniform randomness.
Poly-Time Indistinguishability (GB Def. 3.1) Distributions and over are poly-time indistinguishable, written , if for every poly-time distinguisher :
Pseudorandom Distribution (GB Def. 3.2) A distribution over is pseudorandom if , where denotes the uniform distribution on .
Pseudorandom Generator (GB Def. 3.3) is a pseudorandom generator (PRG) if:
(stretching: output is longer than input).
is poly-time computable.
(output is pseudorandom).
The input is called the seed (length ); is the expansion factor.
A PRG lets us replace a long one-time-pad key with a short seed: encrypt as for and seed . The result is computationally (not perfectly) secret, but secure against all PPT adversaries.
Relationship to Barak Definition 2.10.
The PRG security condition is exactly the asymptotic indistinguishability (Definition 2.10 from Barak, see §1.3) applied to the two ensembles and .
Constructing a PRG from a One-Way Function
PRG from OWF (GB Thm. 3.4) If a one-way function exists, then a pseudorandom generator exists.
The proof is constructive and proceeds in two steps.
Step 1: The Construction (1-bit stretching)
— one-bit PRG extender Let be any OWF and let be the Goldreich–Levin hard-core predicate for the derived function . Define Input: seed . Output: bits. stretches the seed by exactly 1 bit.
Why is a PRG.
We must show . By Definition 2.50 (GB), the hard-core property gives . Since is one-way, already “looks random” in the relevant sense, so . Chaining these two indistinguishabilities (using transitivity of ), the output of is pseudorandom.
Step 2: The Construction (polynomial stretching)
A 1-bit extension is not useful on its own. We chain to produce polynomially many bits.
— -bit PRG Let be any polynomial. Iterate:
Set (the seed).
For : let and .
Output .
Equivalently, Output length: bits from a -bit seed.
The Hybrid Argument: Proving is a PRG
To show , define a sequence of hybrid distributions interpolating between the two endpoints:
(all bits generated by the PRG).
(all bits truly random).
(): the first bits from the PRG, the last bits truly random.
Key step. Show for each . Each transition replaces one hard-core bit with a truly random bit. By the hard-core predicate property (Definition 2.48), no PPT adversary can distinguish these with non-negligible advantage.
Conclusion. , so by transitivity.
Error accumulation.
Each step introduces indistinguishability error . Over steps, total error is (a polynomial times a negligible function is negligible).
Why adjacent hybrids are indistinguishable.
and differ only in position : has (hard-core bit), has a truly random . Any distinguisher separating from yields an adversary breaking the hard-core predicate property of — contradicting OWF hardness. This is a reduction: adversary against hard-core predicate OWF inversion.
OWF Hard-Core Predicate 1-bit PRG -bit PRG Computationally secure stream cipher
Next-Bit Tests
There is a striking alternative characterization of PRGs: a string looks random if and only if no poly-time algorithm can predict its next bit from its previous bits.
Next-Bit Test (GB Def. 3.6) A poly-time algorithm is a next-bit test at position if, given the first bits of a string, predicts bit . succeeds at position if for some polynomial and infinitely many .
Next-Bit Security (GB Def. 3.8) passes all next-bit tests if for every poly-time , every polynomial , all large , and all : where is a uniform random seed.
Statistical Test (GB Def. 3.9) A statistical test is any poly-time . distinguishes if for infinitely many .
Next-Bit Tests All Statistical Tests (GB Thm. 3.10) is a PRG (passes all statistical tests) if and only if passes all next-bit tests.
Proof sketch ().
If fails a statistical test — i.e., distinguishes from — then there exists a position such that distinguishes the distribution of the first bits of from the first bits of , even given that the first bits are the same. This directly yields a next-bit predictor.
Significance.
To prove is a PRG, it suffices to show next-bit unpredictability — a simpler, local condition — rather than fooling all possible statistical tests. This is why the hybrid argument works: each step only needs to argue about one bit at a time.
Two Intuitions for Randomness
Before the formal definition, it is worth grounding the notion of a PRG in two complementary intuitions about what it means for a bit string to “look” random.
Intuition 1: Passes all statistical tests.
A random sequence should be unbiased (equal numbers of 0s and 1s in the long run), should have every fixed-length pattern appear with the expected frequency, and should pass any other efficiently computable statistical test. A distinguisher in the formal definition is exactly such a test: it takes a string and says “random” or “not random.”
Intuition 2: Unpredictability.
Given any prefix of the sequence, a computationally bounded observer should not be able to guess the next bit with probability noticeably better than . This is the next-bit test view.
These two intuitions are equivalent for pseudorandom generators (GB Thm. 3.10, above): fools all poly-time statistical tests if and only if passes all next-bit tests.
Why restrict to polynomial-time distinguishers?
An exponential-time adversary given a string of length could enumerate all seeds, compute for each, and check whether the string is in the range of . A random string of length lands in the range with probability at most , which is negligible when . So exponential time can distinguish; we restrict to polynomial time because that is the realistic adversary model.
(Remark: for other applications — such as derandomization and complexity theory — people study pseudorandomness against weaker classes, e.g. log-space bounded tests. The connection to outcome indistinguishability from the fairness portion of this course is not a coincidence: OI was framed knowing exactly this type of poly-time indistinguishability formula.)
Why PRGs Are Practically Useful
True randomness is expensive.
Generating truly random bits requires a physical entropy source (thermal noise, radioactive decay, quantum measurement, atmospheric noise, lava lamps, …). These sources are slow and require special hardware. In contrast, a PRG lets you spend a small amount on a short truly random seed and then stretch it into as many pseudorandom bits as needed.
Derandomization.
An important open question: does randomness help computation? We do not know whether (roughly, whether every efficient randomized algorithm has an efficient deterministic simulation). PRGs are a tool for minimizing the number of truly random bits required by an algorithm, with the hope of eventually eliminating them entirely. If strong enough PRGs exist, follows.
PRGs vs. OWFs.
A PRG must certainly be hard to invert (otherwise, given an output, one could recover the seed and distinguish pseudo from truly random). In fact, every PRG is a OWF. The converse is also true: OWFs exist if and only if PRGs exist (a deep result; in class we prove the easier direction via the GL theorem and the construction).
Hybrid Argument: Proof Structure for Next-Bit PRG
The proof that next-bit unpredictability implies full pseudorandomness uses a hybrid argument — the second of the two fundamental techniques in cryptography (the first being reductions).
Reduction: “If you could do , you could do ” — used to derive contradictions.
Hybrid argument: Interpolate between two distributions through a chain of intermediate hybrids; if the endpoints are distinguishable, some adjacent pair must be distinguishable, reducing to a simpler sub-problem.
Both appeared earlier in this course: reductions throughout crypto; the hybrid argument appeared in the -fold DP composition proof (walking one database toward another one person at a time).
Construction for this proof.
Assume for contradiction that some PPTM distinguishes from with non-negligible advantage . Define hybrid distributions :
(all pseudorandom — the red distribution).D 0 = G ( U k ) D_0 = G(U_k) (all truly random — the blue distribution).D ℓ ( n ) = U ℓ ( n ) D_{\ell(n)} = U_{\ell(n)}
Since
The conditioning required to extract a next-bit predictor from the adjacent hybrids involves some care (the prefix of the hybrid string is not entirely random). Goldwasser–Bellare carry out the remaining calculation; the structure is the same as the calculation at the start of this section.
The Blum–Blum–Shub (BBS) Generator
The BBS generator is a concrete, number-theory-based PRG with provable security under the Quadratic Residuosity assumption.
Setup.
Let
Hard-core predicate.
The least significant bit
Blum–Blum–Shub Generator
Seed:
Iteration:
Output:
Why BBS is notable.
Concrete: security rests on a specific, well-studied number-theoretic problem (quadratic residuosity
factoring).⇔ \Leftrightarrow Backward secure: given all
output bits andQ Q , one cannot recover earlier statesx Q x_Q (squaring is one-way).x 0 , x 1 , … x_0, x_1, \ldots Historically important: one of the first provably secure PRG constructions.
Chapter Summary: The Implication Chain
OWF
exists (assumed: factoring, discrete log, subset sum, …)f f Hard-core predicate⇒ \Rightarrow exists (Goldreich–Levin, GB Thm. 2.49)B B ⇒ \Rightarrow is a 1-bit PRG (GB §3.2 + Def. 2.50)G 1 ( s ) = f ( s ) ∘ B ( s ) G^1(s)=f(s)\circ B(s) ⇒ \Rightarrow is aG Q G^Q -bit PRG (hybrid argument)p o l y ( k ) \mathrm{poly}(k) Stream cipher⇒ \Rightarrow is computationally secureE n c s ( m ) = G | m | ( s ) ⊕ m \mathrm{Enc}_s(m)=G^{|m|}(s)\oplus m
Randomness, Weak/Strong OWFs, and the Goldreich–Levin Proof
Why Randomness Is Essential in Key Generation
Both in the shared-key setting (two parties share a secret key) and in the public-key setting (one party publishes a public key; any sender can encrypt; only the receiver can decrypt), keys must be generated using randomness.
Why must we randomize when choosing keys? What goes wrong if key generation is deterministic?
Answer.
If key generation is deterministic, every party who runs the algorithm produces the same key. In the shared-key case, everyone would share the same secret; in the public-key case, everyone’s “private” key would be identical and publicly deducible. The requirement is unpredictability: different parties must produce different, independently unguessable keys. This mirrors the role of randomness in differential privacy — without it one could reverse-engineer which of two adjacent databases produced a given output.
Probabilistic Polynomial-Time Machines (PPTMs)
Probabilistic Polynomial-Time Machine
(PPTM) A machine
In cryptography, “easy” means computable by a PPTM, and “hard” means no PPTM succeeds (with non-negligible probability).
Negligible Functions
Negligible Function A function
Examples.
Key closure property.
The sum of polynomially many negligible functions is negligible:
This is essential for composition: if each sub-protocol leaks only negligibly, running polynomially many sub-protocols in sequence still leaks negligibly in total. This is far nicer than differential privacy, where privacy losses add linearly (or sub-linearly via advanced composition, but never remain negligible for free).
Formalizing “Hard to Invert”: Two Attempts
Straw-man definition (too weak)
A first attempt:
Proper definition: negligible success probability
One-Way Function — Strong Form
The adversary receives the security parameter
Weak versus Strong One-Way Functions
Weak One-Way Function
Comparison.
Strong OWF: success probability is negligible (adversary almost never wins).
Weak OWF: failure probability is non-negligible (adversary sometimes loses).
Note the asymmetry: “success probability
Weak implies Strong (informal) If a weak one-way function exists, then a strong one-way function exists.
The construction amplifies hardness by evaluating
One-Way Functions Do Not Hide All Input Bits
A common misconception: if
Example.
Let
is one-way: givenF F , we cannot findH ( x ) ∘ r H(x) \circ r (sincex x is one-way).H H leaksF F entirely — exactly half the input bits are public.r r
This same construction
(
Hashing does not automatically protect privacy. If a database releases only hash values of sensitive fields, the hash reveals nothing about fields that happen to be hard to invert, but it may expose fields that are easy to guess (e.g., a social security number from a small space). “It’s hashed” is not a privacy guarantee without further analysis.
Hardcore Predicates: Formal Definition
A predicate is a function
Hardcore Predicate A poly-time
computable function
Intuition.
is a single bit, so random guessing gives success probability exactlyB ( x ) B(x) .1 / 2 1/2 A hardcore predicate says: seeing
gives the adversary no useful hint for guessingf ( x ) f(x) ; it can do at most negligibly better than chance.B ( x ) B(x) If you know
, computingx x is easy. If you only seeB ( x ) B(x) , it is as hard as flipping a coin.f ( x ) f(x)
The Goldreich–Levin Hardcore Bit
Goldreich–Levin (1989) Let
Why
r r
is included in the output.
To evaluate
Geometric intuition.
Polynomial-Time Indistinguishability (Revisited)
Recall (Chapter 14):
Poly-Time Indistinguishability of
Ensembles Two families of distributions
For every polynomial-time distinguisher, for every
polynomial bound on the advantage, the two families cannot be told apart
once
Proof that the GL Bit Is Hardcore
We prove:
Unpacking: the red distribution is
Proof by contradiction
Assume
there exists a PPTM
Construction.
Build a PPTM
Receive
(i.e.,G ( s ) G(s) ).f ( x ) ∘ r f(x) \circ r Sample a fresh uniform bit
.Z ∈ { 0 , 1 } Z \in \{0,1\} Run
on𝒜 \mathcal{A} .G ( s ) ∘ Z G(s) \circ Z If
outputs 1, output𝒜 \mathcal{A} (guessZ Z ).B ( s ) = Z B(s) = Z If
outputs 0, output𝒜 \mathcal{A} (guess1 − Z 1 - Z ).B ( s ) = 1 − Z B(s) = 1-Z
Analysis.
This is non-negligibly better than
Handling the absolute value.
If
This proof is the asymptotic version of the non-asymptotic argument
in Barak §2.4. The core idea is identical: a distinguisher with
polynomial advantage
Remark on P vs. NP.
All the hardness assumptions in this chapter (OWF existence,
indistinguishability) are unproven. If
Candidate One-Way Functions Revisited
Subset Sum Modulo
M M
Parameters:
orδ < 1 \delta < 1 : efficient algorithms exist.δ > n / log n \delta > n / \log n : believed hard; related to lattice-based cryptography.δ = Θ ( 1 ) \delta = \Theta(1)
The solution need not be unique; one-wayness only requires that some preimage is hard to find.
Discrete Logarithm
Let
Discrete Logarithm Problem Given
The forward direction (exponentiation: given
Post-Quantum Cryptography
Both integer factoring and discrete log can be solved in polynomial time on a quantum computer via Shor’s algorithm (1994). If large-scale quantum computers are built, these cryptosystems are broken.
Post-quantum cryptography refers to schemes whose security does not rely on the hardness of factoring or discrete log. The leading candidate is lattice-based cryptography, where hardness is based on problems like Learning With Errors (LWE). Interestingly, lattice algorithms (due to Lenstra–Lenstra–Lovász) were originally used to break knapsack cryptosystems; Regev and others later showed lattice problems could also be used to build secure systems.
GL Proof: Refined Case Analysis
The following is a more explicit version of the argument from §15.10, using conditional probabilities to make each case transparent.
Setup.
As before,
Case 1:
𝒜 \mathcal{A}
outputs 1.
Case 2:
𝒜 \mathcal{A}
outputs 0.
Total.
By the law of total probability:
Corollary: Hardcore Bit Is Indistinguishable from a Random Bit
The previous theorem showed:
Hardcore Bit vs. Random Bit If
Proof. Let
This corollary is the key insight behind semantic security. Suppose a
public-key cryptosystem encrypts messages bit by bit. If encryptions of
Why must encryption be randomized? If encryption were deterministic,
there would be exactly one ciphertext for
Encryption and Semantic Security
Private-Key Encryption: Syntax
Private-Key Encryption Scheme A
private-key encryption scheme is a triple
: probabilistic key generation.G e n ( 1 k ) → k \mathrm{Gen}(1^k) \to k : encryption of messageE n c k ( m ) → c \mathrm{Enc}_k(m) \to c under keym m .k k : decryption.D e c k ( c ) → m \mathrm{Dec}_k(c) \to m
Correctness:
Perfect Secrecy (Shannon)
Perfect Secrecy A scheme has
perfect secrecy if
The One-Time Pad (OTP) achieves perfect secrecy:
Shannon’s impossibility.
Any perfectly secret scheme requires
Semantic Security
Semantic Security
(Goldwasser–Micali) An encryption scheme
IND-CPA Security
IND-CPA (Indistinguishability under Chosen Plaintext
Attack) A scheme is IND-CPA secure
if for every PPT adversary
Generate
.k ← G e n ( 1 k ) k\leftarrow\mathrm{Gen}(1^k) queries an encryption oracle𝒜 \mathcal{A} adaptively.E n c k ( ⋅ ) \mathrm{Enc}_k(\cdot) submits two messages𝒜 \mathcal{A} .m 0 , m 1 m_0, m_1 Challenger picks
, sendsb ← { 0 , 1 } b\leftarrow\{0,1\} .c * = E n c k ( m b ) c^*=\mathrm{Enc}_k(m_b) continues to query𝒜 \mathcal{A} , then outputsE n c k ( ⋅ ) \mathrm{Enc}_k(\cdot) .b ′ b'
Semantic Security
Conceptual importance.
Semantic security is the “right” intuitive definition (nothing is leaked), while IND-CPA is the “right” technical definition (clean game, easy to use in reductions). Their equivalence means we can use whichever is convenient.
Stream Ciphers from PRGs
PRG-based Stream Cipher Let
PRG Stream Cipher is IND-CPA If
Proof sketch.
If
Caution: single-use.
If the same seed
Public-Key Encryption
Private-key encryption requires the sender and receiver to share a secret key in advance. This is the key distribution problem: how do two parties who have never met establish a shared secret over a public channel?
Public-key encryption (PKE) resolves this by having each party hold a key pair: a public key they broadcast freely and a private key they keep secret. Anyone can encrypt to you using your public key; only you can decrypt using your private key.
Public-Key Encryption Scheme A
public-key encryption scheme is a triple
: generate a public key and a secret key.G e n ( 1 k ) → ( 𝑝 𝑘 , 𝑠 𝑘 ) \mathrm{Gen}(1^k) \to (\mathit{pk}, \mathit{sk}) : encrypt messageE n c 𝑝 𝑘 ( m ) → c \mathrm{Enc}_{\mathit{pk}}(m) \to c using the public key.m m : decrypt using the secret key.D e c 𝑠 𝑘 ( c ) → m \mathrm{Dec}_{\mathit{sk}}(c) \to m
Correctness:
IND-CPA for PKE.
The definition is the same as for private-key IND-CPA, except the
adversary is given the public key
Why encryption must be randomized.
In a public-key cryptosystem, if encryption were deterministic, any
observer could encrypt both messages themselves (the public key is
public) and compare against the ciphertext, immediately learning which
message was encrypted. A secure scheme must have multiple possible
encryptions of each message—i.e., encryption must sample from a
distribution. A corollary: if encryptions of
Quadratic Residues and the QR Hardness Assumption
The Goldwasser–Micali scheme (below) builds on the computational hardness of distinguishing squares from non-squares modulo a composite.
Quadratic Residue Let
The Jacobi symbol.
For
If
:J N ( x ) = − 1 J_N(x) = -1 is definitely a QNR.x x If
:J N ( x ) = + 1 J_N(x) = +1 is either a QR or a QNR with “fake” Jacobi symbol (called a pseudo-square).x x
For
Given
Key multiplicative structure.
QR
Multiplication in
Goldwasser–Micali Probabilistic Encryption
Goldwasser–Micali (GM) Encryption
Key generation. Choose random
Encryption of a single bit
:b = 0 b = 0 is a random QR.c = r 2 c = r^2 :b = 1 b = 1 is a random pseudo-square (QNR withc = r 2 y c = r^2 y ).J N ( c ) = 1 J_N(c)=1
Decryption. Using
Multi-bit messages. Encrypt each bit independently with fresh randomness.
GM Security Under the QR hardness assumption, GM encryption is semantically secure (IND-CPA).
Why it is probabilistic.
Different random choices of
Homomorphic property.
If
Chosen-Ciphertext Attacks
The IND-CPA model gives the adversary access to an encryption oracle. A stronger model gives access to a decryption oracle as well.
CCA Security (Two Variants)
CCA-pre (non-adaptive): The adversary may query the
decryption oracle
CCA-post (adaptive, also called CCA2): The adversary
retains access to
Why CCA-post?
Giving the adversary a decryption oracle even after seeing the challenge may seem like overkill. The motivation is that in practice we rarely know exactly what capabilities an attacker has. By proving security against the strongest plausible adversary—one who can decrypt anything except the exact ciphertext they are trying to break—we get a guarantee that holds regardless of how the attacker acquires auxiliary decryption power.
Implication chain.
Malleability and Non-Malleability
Malleable Encryption Scheme An
encryption scheme is malleable if an adversary, given a
ciphertext
Malleability is a problem because in a CCA setting the adversary can:
(1) receive challenge ciphertext
Non-Malleability A scheme is
non-malleable if for every PPT adversary
Non-malleability is a stronger guarantee than semantic
security: any function
The Six Notions of Security
Combining adversary power with break type yields six standard notions:
| CPA | CCA-pre | CCA-post | |
|---|---|---|---|
| Semantic security | IND-CPA | IND-CCA-pre | IND-CCA2 |
| Non-malleability | NM-CPA | NM-CCA-pre | NM-CCA2 |
These are ordered by strength: NM-CCA2 is the strongest and IND-CPA the weakest. For most practical protocols (e.g., TLS), IND-CCA2 security is the target.
The GM Scheme is Malleable
Goldwasser–Micali is IND-CPA secure (Theorem [th:gm-sec]),
but it is malleable under CCA, because the multiplicative
structure of
Attack: produce another encryption of the same bit.
Given challenge
Attack: produce an encryption of the flipped bit.
Set
The GM scheme’s homomorphic property (XOR on ciphertexts) is what makes it useful for certain applications—but it is also exactly what makes it malleable. Achieving NM-CCA2 security requires abandoning homomorphism or adding non-interactive zero-knowledge proofs of well-formedness (as in the Cramer–Shoup scheme).
Zero Knowledge
From Classical Proofs to Interactive Proofs
Classical proofs.
A classical mathematical proof is a checkable sequence of statements: fix axioms and rules of inference, and every line is either an axiom or the result of applying a deduction rule to earlier lines. This is the setting of Euclidean geometry, Peano arithmetic, and so on. (By Gödel’s incompleteness theorem, no such system can be simultaneously complete and consistent — but this will not concern us here.)
NP and polynomial witnesses.
The complexity class NP formalizes classical proofs:
a language
3-SAT:
is a satisfying variable assignment; checking is linear time.w w 3-coloring:
is a coloring; checking (no edge monochromatic) is linear.w w Graph isomorphism:
is the mapw w ; checking is easy.φ : V ( G ) → V ( H ) \varphi: V(G)\to V(H) Hamiltonicity:
is the Hamiltonian cycle; checking is linear.w w
The witness
The limitation: co-NP.
Proving that a statement is false — a formula is unsatisfiable, two graphs are non-isomorphic, a graph has no Hamiltonian cycle — amounts to a “for all” quantifier. There is no known short proof of such statements (that would imply P = NP or NP = co-NP). Intuitively, it is easier to demonstrate a satisfying assignment than to argue that none exists.
Interactive proofs.
In an interactive proof system, the verifier is not passive. Instead of receiving a proof and checking it line by line, the verifier asks questions. This is particularly powerful for statements outside NP.
Interactive Proof System An
interactive proof system for language
Completeness: if
,x ∈ L x \in L accepts with probabilityV V .≥ 2 / 3 \ge 2/3 Soundness: if
, no proverx ∉ L x \notin L makesP * P^* accept with probabilityV V .> 1 / 3 > 1/3
By repeating the protocol
Graph Non-Isomorphism: An Interactive Proof
Graph isomorphism (GI) is in NP: prove
Protocol (one round).
picksV V uniformly at random, computes a uniformly random isomorphic copyX ∈ { G , H } X \in \{G, H\} , and sendsY = φ ( X ) Y = \varphi(X) toY Y .P P identifies which ofP P orG G the graphH H was derived from, and sends its guessY Y tob ̂ \hat{b} .V V accepts iffV V equals its original choice.b ̂ \hat{b}
Repeat
Analysis.
Completeness. If
, a computationally powerfulG ≆ H G \not\cong H can always determine which graphP P came from (sinceY Y andφ ( G ) \varphi(G) are non-isomorphic). Accepts with probability 1.φ ( H ) \varphi(H) Soundness. If
, thenG ≅ H G \cong H andφ ( G ) \varphi(G) have the same distribution. Any prover guesses correctly with probability at mostφ ( H ) \varphi(H) per round; after1 2 \frac{1}{2} rounds, a cheating prover wins with probability at mostk k .2 − k 2^{-k}
GNI has an interactive proof even though it is not known to be in NP. Interactive proofs are provably more powerful than classical NP proofs (under standard assumptions).
Zero-Knowledge Proofs: Definition and Motivation
In practice, the prover often holds a secret witness — a satisfying assignment, a graph coloring, a Hamiltonian cycle, a private key — and wants to convince the verifier that the statement is true without revealing the witness.
Why keep the witness secret?
A satisfying assignment for a hard formula can serve as a password. The account holder wants to prove they know it without transmitting it.
A graph coloring or Hamiltonian cycle may contain proprietary information.
In lattice-based and other cryptographic settings, the witness is the private key; revealing it would break the system entirely.
Zero-Knowledge Proof
(Goldwasser–Micali–Rackoff) An interactive proof
Interpretation.
The simulator has no access to the prover or the witness
The Lady Tasting Tea
The statistician Muriel Bristol claimed to distinguish tea poured
milk-first from tea-first. In a blind test with 8 cups, she identified
all 8 correctly — an event with probability
This is an informal zero-knowledge proof of capability: the verifier is convinced of the fact, but learns nothing about the witness behind it.
Commitment Schemes
You write your prediction on paper, seal it in an envelope, and hand it to the verifier. Before opening, the verifier has no idea what is inside (hiding). Once handed over, you cannot change the contents (binding). When opened, the verifier can check your claim.
Commitment Scheme A commitment scheme has two phases:
Commit phase. The sender transmits
(wherec o m ( v ; r ) \mathrm{com}(v;\, r) is fresh randomness) to the receiver. The sender is now bound tor r , but the receiver learns nothing about it.v v Open phase. The sender reveals
; the receiver verifies.( v , r ) (v, r)
Hiding: A PPT receiver cannot distinguish
Binding: The sender cannot produce
Information-theoretic vs. computational.
Each of hiding and binding can hold either information-theoretically (no algorithm, regardless of power, can break it) or computationally (no PPT algorithm can break it under a hardness assumption).
No commitment scheme can be simultaneously information-theoretically hiding and information-theoretically binding. All other three combinations are achievable.
Example (QR-based). Commit to bit
Interactive Proof for Quadratic Non-Residuosity
Both
Protocol (one round).
picksV V andS ← ℤ N * S \leftarrow \mathbb{Z}_N^* uniformly. Sends:b ← { 0 , 1 } b \leftarrow \{0,1\} Y = { S 2 mod N b = 0 S 2 X mod N b = 1 Y = \begin{cases} S^2 \bmod N & b = 0 \\ S^2 X \bmod N & b = 1 \end{cases} identifiesP P (using the factorization to test whetherb b ) and sendsY ∈ Q R N Y \in \mathrm{QR}_N tob ̂ \hat{b} .V V accepts iffV V .b ̂ = b \hat{b} = b
Analysis.
Completeness. If
is a QNR:X X is a QR;S 2 S^2 is a QNR. A powerfulS 2 X S^2 X always identifiesP P correctly.b b Soundness. If
is a QR:X X andS 2 S^2 are both QRs, identically distributed. No prover can distinguish them; cheating succeeds with probabilityS 2 X S^2 X per round. After1 2 \frac{1}{2} rounds:k k .2 − k 2^{-k}
Zero-Knowledge Proof for Quadratic Residuosity
Now
Protocol (one round).
picksP P uniformly. SendsT ← ℤ N * T \leftarrow \mathbb{Z}_N^* .α = T 2 X mod N \alpha = T^2 X \bmod N picksV V and sendsb ← { 0 , 1 } b \leftarrow \{0,1\} tob b .P P sends:P P Y = { T S mod N b = 0 T mod N b = 1 Y = \begin{cases} TS \bmod N & b = 0 \\ T \bmod N & b = 1 \end{cases} checks:V V { Y 2 ≡ α ( mod N ) b = 0 Y 2 X ≡ α ( mod N ) b = 1 \begin{cases} Y^2 \equiv \alpha \pmod{N} & b = 0 \\ Y^2 X \equiv \alpha \pmod{N} & b = 1 \end{cases}
Correctness.
:b = 0 b=0 , soY = T S Y = TS .Y 2 = T 2 S 2 = T 2 X = α Y^2 = T^2 S^2 = T^2 X = \alpha :b = 1 b=1 , soY = T Y = T .Y 2 X = T 2 X = α Y^2 X = T^2 X = \alpha
Zero knowledge via the rewind simulator.
The real transcript distribution is:
:b = 0 b=0 for uniform( Y 2 , 0 , Y ) (Y^2,\; 0,\; Y) (which is uniform sinceY = T S Y = TS is uniform).T T :b = 1 b=1 for uniform( T 2 X , 1 , T ) (T^2 X,\; 1,\; T) .T T
The secret
The simulator proceeds:
Flip a coin to guess
.b ̂ ∈ { 0 , 1 } \hat{b} \in \{0,1\} Pick uniform
.Y ′ ∈ ℤ N * Y' \in \mathbb{Z}_N^* If
: setb ̂ = 0 \hat{b}=0 ; prepare to sendα ′ = ( Y ′ ) 2 \alpha' = (Y')^2 .Y ′ Y'
If : setb ̂ = 1 \hat{b}=1 ; prepare to sendα ′ = ( Y ′ ) 2 X \alpha' = (Y')^2 X .Y ′ Y' Send
toα ′ \alpha' and receiveV * V^* .b a c t u a l b_{\mathrm{actual}} If
: output the transcriptb a c t u a l = b ̂ b_{\mathrm{actual}} = \hat{b} .( α ′ , b a c t u a l , Y ′ ) (\alpha', b_{\mathrm{actual}}, Y') Otherwise: rewind
to its state before step 4 and retry.V * V^*
In expectation, only 2 attempts suffice per round. In either case,
the produced transcript is identically distributed to a real
interaction:
Zero-Knowledge Proof of Hamiltonicity
A graph
Protocol (one round)
Commit.
picks a uniformly random permutationP P ofπ \pi and formsV ( G ) V(G) (same edges, vertices relabeled byH = π ( G ) H = \pi(G) ).π \pi sends a commitment to each entry of theP P adjacency matrix of| V | × | V | |V|\times|V| , one bit per entry.H H Challenge.
picksV V and sendsb ← { 0 , 1 } b \leftarrow \{0,1\} tob b .P P Response.
:b = 0 b=0 opens all commitments and revealsP P .π \pi checks thatV V is a valid permutation ofH H .G G :b = 1 b=1 opens only the entries of the adjacency matrix ofP P corresponding to the permuted cycleH H (i.e., theπ ( C ) \pi(C) edgesn n ).π ( c 1 ) π ( c 2 ) , π ( c 2 ) π ( c 3 ) , … \pi(c_1)\pi(c_2),\;\pi(c_2)\pi(c_3),\;\ldots checks these entries form a Hamiltonian cycle inV V .H H
Repeat
Correctness and Soundness
Completeness. An honest
with cycleP P passes both checks.C C Soundness. If
has no Hamiltonian cycle, noG G can simultaneously prepare commitments that pass both checks. PassingP * P^* requires a valid permutation ofb = 0 b=0 (which contains no Hamiltonian cycle); passingG G requires opening a Hamiltonian cycle — which does not exist. A cheating prover passes at most one check per round: soundness errorb = 1 b=1 per round,≤ 1 2 \le \frac{1}{2} after2 − k 2^{-k} rounds.k k
Zero Knowledge: The Rewind Simulator
The simulator
Guess the challenge. Flip a coin: guess
.b ̂ ∈ { 0 , 1 } \hat{b} \in \{0,1\} Prepare commitments.
: commit to the adjacency matrix of a genuine random permutationb ̂ = 0 \hat{b}=0 (can open the whole matrix to passπ ( G ) \pi(G) ).b = 0 b=0 : commit to a matrix with 1s on an arbitrary Hamiltonian cycle and arbitrary values elsewhere (can open the cycle to passb ̂ = 1 \hat{b}=1 ).b = 1 b=1
Run the (possibly cheating) verifier
and receiveV * V^* .b a c t u a l b_{\mathrm{actual}} If
: open the prepared commitments and output the transcript.b a c t u a l = b ̂ b_{\mathrm{actual}} = \hat{b}
If : rewindb a c t u a l ≠ b ̂ b_{\mathrm{actual}} \ne \hat{b} to the start of this round and repeat from step 1.V * V^*
In expectation, 2 attempts suffice.
The verifier sees either the whole permuted graph (but no cycle
information) or just the cycle positions (but not the rest of the graph)
— never both at once. The commitment scheme’s hiding property ensures
that unopened entries reveal nothing. The Hamiltonian cycle
Zero-Knowledge Proof for 3-Colorability
The canonical theoretical example: every NP language has a zero-knowledge proof.
Protocol.
Given graph
picks a uniformly random permutationP P ofπ \pi , applies it to get coloring{ 1 , 2 , 3 } \{1,2,3\} , and commits to each vertex’s color: sendsπ ∘ χ \pi\circ\chi .{ C o m m i t ( π ( χ ( v ) ) ) } v ∈ V \{\mathrm{Commit}(\pi(\chi(v)))\}_{v\in V} challenges with a random edgeV V .( u , w ) ∈ E (u,w) \in E opens the commitments forP P andu u , revealingw w andπ ( χ ( u ) ) \pi(\chi(u)) .π ( χ ( w ) ) \pi(\chi(w)) accepts iff the two revealed colors are distinct.V V
Repeat
Analysis.
Completeness. A valid coloring always passes (adjacent vertices have distinct colors;
preserves distinctness).π \pi Soundness. If
is not 3-colorable, some edge must be monochromatic; the verifier catches it with probabilityG G per round. After≥ 1 / | E | \ge 1/|E| rounds, soundness error is| E | ⋅ k |E|\cdot k .≤ ( 1 − 1 / | E | ) | E | k ≤ e − k \le (1-1/|E|)^{|E|k} \le e^{-k} Zero knowledge. The simulator (without knowing
) generates a random pair of distinct colors and fake commitments for the challenged edge, producing an identically distributed transcript. The random permutationχ \chi ensures the revealed colors look fresh and uniform.π \pi
NP
This follows from 3-colorability having a ZK proof, combined with the NP-completeness of 3-coloring (via Cook–Levin and reduction): any NP language reduces to 3-coloring in polynomial time.
Connection to commitment schemes.
The ZK protocols above rely on commitments: binding ensures soundness (the prover cannot change the committed coloring or permutation after the challenge); hiding ensures zero knowledge (unopened commitments reveal nothing). Commitment schemes can be constructed from one-way functions.
Post-Quantum Cryptography: Lattice-Based Schemes
The cryptographic constructions discussed in this course — factoring-based (Goldwasser–Micali) and discrete-log-based systems — are not post-quantum secure. Shor’s algorithm solves both integer factorization and discrete logarithm in polynomial time on a quantum computer.
Lattice problems offer a post-quantum alternative. Ajtai (1996) introduced lattice problems with a remarkable worst-case to average-case reduction: solving random instances efficiently would imply solving the hardest instances efficiently. This gives a provable guarantee that factoring lacks: random instances are provably as hard as the worst case. Moreover, no efficient quantum algorithm for lattice problems is known.
Post-quantum: no known quantum speedup.
Worst-case hardness: security provably tied to hard worst-case instances, not just empirical hardness of random ones.
Versatility: supports fully homomorphic encryption and other advanced primitives not achievable from factoring alone.
ZK-SNARKs: Succinct Non-Interactive Zero Knowledge
Motivation: Privacy in Distributed Systems
Bitcoin introduced a pseudonymous transaction model: every user operates under a public key rather than a name. But pseudonymity is not anonymity. Because the blockchain is a public ledger, an observer can link transactions to the same pseudonym, and then link pseudonyms to identities via auxiliary information — precisely the linkage-attack strategy that defeated Netflix’s “anonymous” ratings (see Chapter 11).
ZK-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) were developed, in part, to provide genuinely private transactions: a user proves they are authorized to spend funds without revealing which funds, in which wallet, at what time.
The SNARK Acronym Unpacked
- Zero-Knowledge (ZK):
-
the verifier learns nothing beyond the truth of the statement (the simulator paradigm of Goldwasser–Micali–Rackoff).
- Succinct (S):
-
the proof has size
, wherep o l y log N \mathrm{poly}\log N is the length of the witness, rather thanN N .p o l y ( N ) \mathrm{poly}(N) - Non-Interactive (NI):
-
no back-and-forth between prover and verifier; a single message suffices (achieved via the Fiat–Shamir heuristic).
- Argument (A):
-
soundness holds only against computationally bounded provers (under cryptographic assumptions), not information-theoretically.
- of Knowledge (K):
-
the prover does not merely show a witness exists; the protocol extracts the witness from any successful prover, proving that the prover genuinely “knows” it.
Construction: PCP + Merkle Tree + Fiat–Shamir
The construction proceeds in three steps:
Step 1: Probabilistically Checkable Proof (PCP).
By the PCP theorem, any NP witness
Step 2: Merkle Tree for Commitment and Selective Opening.
Naively, the prover would send all of
The prover commits to
by building a Merkle tree over the leavesπ \pi and sending only the root hashπ 1 , … , π p o l y ( N ) \pi_1,\ldots,\pi_{\mathrm{poly}(N)} .h = M e r k l e R o o t ( π ) h = \mathrm{MerkleRoot}(\pi) The verifier requests
leaf positions.p o l y log N \mathrm{poly}\log N The prover opens each requested leaf with an authentication path (a sequence of sibling hashes of length
).O ( log N ) O(\log N)
Each opening is itself a proof of membership in the Merkle tree,
which can be verified against the root
Step 3: Fiat–Shamir Heuristic.
The protocol so far is interactive (the verifier sends random
challenges). The Fiat–Shamir heuristic replaces every
verifier message with the output of a cryptographic hash function
applied to the transcript so far:
ZK-SNARK Witness Size Using PCP +
Merkle commitment + Fiat–Shamir, the resulting proof has
Why this is remarkable.
For NP statements with witnesses of length, say,
Proofs of Work: Origins and Design
The Original Problem: Spam Deterrence
Proofs of work were invented in 1992 by Dwork and Naor for a purpose entirely unrelated to cryptocurrency: combating email spam.
The core observation: sending an email is essentially free for the sender but costly (in attention) for the recipient. If sending a single email required even a small amount of computation — say, 10 seconds of CPU time — then legitimate users would barely notice, but a spammer sending millions of emails would face an insurmountable computational burden.
Moderately Hard Functions
The technical object is a moderately hard function: a
function
Computing
requires a specified amount of work (not too easy, not too hard).f ( x ) f(x) Verifying
is fast (much cheaper than computingf ( x ) = y f(x) = y ).f f The work is per-message, per-recipient: the solution to one puzzle cannot be reused for a different message or a different recipient. This non-reusability is essential — without it, a spammer could solve one puzzle and send to a million recipients.
The Puzzle Structure
In Dwork and Naor’s scheme, the puzzle for a message
Trapdoor for legitimate bulk mailers.
Dwork and Naor’s original scheme included a trapdoor: a
trusted authority could issue “puzzle masters” who can solve puzzles in
Bitcoin Diverges from the Original Design
Bitcoin’s proof-of-work mechanism shares the high-level structure
(find a nonce
No trapdoor. Bitcoin’s hash-based PoW has no shortcut: every miner, including the protocol’s creators, must perform full brute-force search. This is a deliberate design choice for decentralization.
Environmental cost. Without a trapdoor, all computation is wasted work. Bitcoin’s global mining network consumes electricity comparable to small countries. The Dwork–Naor design explicitly avoids this: legitimate senders with the trapdoor pay negligible cost; only spammers pay.
Implementation: Microsoft Outlook
Microsoft implemented a proof-of-work filter in Outlook: outgoing emails would include a small computational certificate, computed silently in the background. Mail servers could weight incoming mail higher or lower based on whether a valid certificate was present. This is a direct descendant of the Dwork–Naor design.
Dwork–Naor (1992): moderately hard, per-message-per-recipient, trapdoor exists for authorized bulk senders. Bitcoin (2008): moderately hard, global race, no trapdoor, no trusted authority — at the cost of enormous energy use.
Paper Readings
Goldwasser, Micali, Rackoff (1989) — The Knowledge Complexity of Interactive Proof Systems.
Introduces interactive proof systems and defines zero knowledge via the simulator paradigm: a proof is zero-knowledge if a polynomial-time simulator, without access to the prover or the witness, can produce transcripts computationally indistinguishable from real interactions. The paper proves that graph isomorphism has a zero-knowledge proof and introduces the notion of “knowledge complexity” to quantify how much information a proof leaks. The simulator paradigm established here is now the standard framework for defining security in virtually every area of modern cryptography, from encryption to multi-party computation.
Kilian (1992) — A Note on Efficient Zero-Knowledge Proofs and Arguments.
Combines probabilistically checkable proofs, Merkle tree commitments,
and zero-knowledge proofs of knowledge into the first succinct argument
system: the prover Merkle-commits to a PCP encoding of the witness, the
verifier queries a polylogarithmic number of positions, and the prover
responds with a ZK proof that the PCP verifier would accept the
committed values — without ever revealing the PCP itself. Communication
is
Bridging Fairness and Privacy
Bitcoin and Blockchain: A Case Study in Distributed Trust
The Double-Spend Problem
Digital money faces a fundamental problem that physical cash does not: a digital file representing a coin can be copied. Alice could send Bob a digital coin and simultaneously send Carol the same coin. Digital signatures solve part of the problem — they prove Alice authorized a transaction — but they do not prevent Alice from signing two conflicting transactions.
Prior attempts.
Pre-Bitcoin digital currency schemes (e-cash, DigiCash) relied on a trusted central server to maintain a “spent coins” list. This is exactly what a bank does. Nakamoto’s insight was to eliminate the trusted central party entirely.
Blockchain as a Distributed Timestamp Server
A blockchain is an append-only linked list of blocks, where each block
Contains a batch of transactions,
Contains the cryptographic hash of the previous block (creating a chain: modifying any past block changes all subsequent hashes), and
Contains a proof-of-work certificate.
Because blocks are linked by hashes, an adversary who wants to alter a historical transaction must recompute all subsequent blocks’ proofs of work — an infeasible task if the adversary controls less than half the network’s compute power.
Proof of Work as Byzantine Fault Tolerance
The core mechanism is the proof of work (see Section 17.12 for the 1992 origins). Miners compete to extend the chain: the first to find a valid nonce broadcasts the new block and receives the block reward. By the longest-chain rule (Nakamoto consensus), nodes accept the chain with the most cumulative work as the canonical history.
Why this prevents double-spend.
Suppose Alice broadcasts conflicting transactions
Security via gambler’s ruin.
If an attacker controls fraction
Incentive Mechanism
Nakamoto designed a self-sustaining incentive structure:
Block reward: the miner who finds a valid block creates new coins (initially 50 BTC, halving every 210,000 blocks), funding their own computational cost.
Transaction fees: users can attach fees to transactions; miners prioritize high-fee transactions, creating a market for block space.
This aligns rational miners’ interests with honest participation: cheating (e.g., accepting double-spends) would undermine confidence in Bitcoin and destroy the value of the very coins they just earned.
Merkle Trees for Efficient Verification
Each block header commits to its transaction set via a Merkle tree: transactions are leaves; each internal node is the hash of its two children; the root hash is stored in the block header (a single 32-byte value regardless of how many transactions are in the block).
Practical benefit.
A light client (e.g., a mobile wallet) does not store the
full blockchain. To verify that transaction
Privacy Limitations: Pseudonymity vs. Anonymity
Bitcoin’s white paper describes a “privacy model” based on pseudonymity: instead of using real names, users operate under public keys. But this is not anonymity.
Linkage attacks.
Because the blockchain is a public ledger, every transaction is visible. An adversary who can link one public key to a real identity (e.g., via an exchange that requires KYC, or via IP address logging when a transaction is first broadcast) can trace the graph of all that key’s transactions. Further, inputs to a transaction are often assumed to belong to the same wallet, allowing clustering.
Connection to Netflix de-anonymization.
This is the same structural problem as the Netflix Prize dataset (Chapter 11): releasing “anonymous” records with rich structure provides sufficient auxiliary information for re-identification. The blockchain is maximally rich in structure — a permanent, global, perfectly accurate record of every transaction ever made.
ZK-SNARKs as a Privacy-Preserving Upgrade
The pseudonymity failure of Bitcoin motivated the design of privacy coins such as Zcash, which use ZK-SNARKs (Section 17.11) to allow shielded transactions: a user proves in zero knowledge that
They own a valid coin (i.e., know a secret key for a coin in the Merkle tree of unspent outputs), and
They are not double-spending (the nullifier for this coin has not been revealed before),
without revealing which coin, which key, or how
much is being transferred. The SNARK proof is succinct
(
Bitcoin illustrates the interplay of all three course themes:
Privacy: pseudonymity without DP or ZK is insufficient; linkage attacks succeed as they did on Netflix.
Cryptography: the system is built from digital signatures, hash functions, Merkle trees, and (in Zcash) ZK-SNARKs — every tool from this course’s second half.
Fairness: the incentive mechanism (Nakamoto consensus, selfish mining) raises questions about who controls the protocol and whether “one CPU, one vote” concentrates power in mining pools, mirroring algorithmic fairness concerns about concentration of decision-making power.
Selfish mining.
One known attack on Nakamoto consensus is selfish mining: a
miner with fraction