Lesson 6 of 13 · 13m
Differential Privacy in Production
The only anonymization with a mathematical guarantee — epsilon budgets, real deployments, and where DP does not apply.
A guarantee you can state
Every technique in the previous lesson is a heuristic — generalize enough, suppress enough, hope no auxiliary set exists. Differential privacy is different: it is a proof about the release mechanism. An output is ε-differentially-private if removing any single person from the input changes the output distribution by at most a factor of e^ε. The guarantee doesn't depend on what the attacker knows — auxiliary data is irrelevant by construction.
The mechanism is calibrated noise. For a counting query with sensitivity Δf (the most one record can change the answer), add Laplace noise with scale Δf/ε. Smaller ε means more noise and stronger privacy; larger ε means cleaner answers and weaker protection.
The budget is spent, not set
ε composes. Release fifteen statistics at ε = 0.4 each and your cumulative privacy loss is ε = 6 — the budget adds up across every release, forever. Teams that treat epsilon as a config value ("we're a ε=0.4 shop") misunderstand it as a dial you set once. It is a wallet you spend.
Apple learned this in public. At WWDC 2016 it announced local differential privacy in iOS 10 for emoji trends and QuickType suggestions — noise added on the device before upload, so Apple never sees your true emoji. Researchers (Tang et al., arXiv:1709.02753, September 2017) measured the actual macOS 10.12 deployment and found the real privacy loss was far above what Apple's descriptions implied: per-datum ε was 1 or 2, but the budget renewed daily — up to ε = 16 per day across the four collectors, growing for as long as the user stayed opted in. The guarantee is only as strong as the accounting behind it.
Local versus central
Two placements. Central DP adds noise after aggregation, trusting the curator with raw data — fine when the curator is you and the release is public. Local DP adds noise on the device before upload, so the server never sees truth — the RAPPOR/Apple model. Local DP costs far more noise for the same utility: every device's answer is perturbed, so you need volume to recover signal. Pick central when you control the data and release statistics; pick local when the collection itself is the thing you shouldn't be trusted with.
Deployments that worked
- RAPPOR (Erlingsson, Pihur, Korolova, CCS 2014) — Google ran randomized-response collection in Chrome to learn which homepage settings malware was hijacking, without learning anyone's settings.
- US Census 2020 — the redistricting file released in August 2021 was the first census processed under DP. Alabama sued over accuracy and lost; the controversy is the honest cost statement — the guarantee consumes real utility, and demographers noticed.
- Gboard federated learning + local DP — model improvements from gradients, not keystrokes.
Where DP fails
DP protects membership in aggregates. It cannot anonymize a service that returns your own data — there is no query whose correct answer is your record. It also cannot rescue small cells: a cohort of five users is swallowed by the noise the guarantee requires. If your "release" is per-user features or small-segment analytics, DP doesn't apply — you need consent and minimization instead.
Don't implement it by hand. The failure mode isn't the math, it's the accounting: budget registries, contribution bounding (cap how many records one user can add), and composition tracking. Use OpenDP, Google's differential-privacy library, or Tumult Analytics — audited implementations where the epsilon bookkeeping is the point.
The practice
- Publish epsilon alongside the release. A DP claim without a stated ε is marketing.
- Keep a release registry: each release's ε and mechanism, summed against a global budget per dataset.
- Bound contributions per user before querying — unbounded records per user make ε meaningless.
- Choose DP for aggregate statistics and telemetry; for anything per-person, go back to minimization.
Differential privacy is the only anonymization technique where you can state, in one inequality, exactly what an attacker cannot learn. Everything else is a claim waiting for a paper to disprove it.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Healthcare Ransomware: Why Hospitals Can't Patch Fast Enough
The criminals behind the attack claim to have shared 400GB of patient data. The NHS stated it is working swiftly to confirm the validity of these files. The ransomware attack on the UK's National Health Service (NHS) continues to disrupt health services in London, with a significant amount of…
RSA Is Simple. Deploying RSA Correctly Almost Never Is.
The capstone to our RSA series. The math checks out. Shipping it as written gets you breached. This is the nineteen-year-old attack that proves it, and what belongs in production instead.
RSA in JavaScript Part 2: The JWT Is Where You'll Actually Meet It
Most JavaScript developers never call an RSA function directly. They verify an RS256 token, and two classic attacks turn that into an authentication bypass — both demonstrated here, both fixed by one line.