Lion Cipher Lab
Differential privacy hands-on with Python
- AI Security
- Beginner
- ~40 min
- Free · no account required
Why it matters
'Differential privacy' has quietly become one of the most name-dropped phrases in tech -- the US Census Bureau used it to protect 2020 census statistics, and it shows up in phones, browsers, and vendor privacy pages everywhere. But most people who say it have never once seen what it actually does, so the phrase gets used as a magic word: 'it uses differential privacy, therefore your data is safe.' That is exactly the misreading that gets people hurt, because whether a deployment is private depends entirely on a dial called epsilon and on accounting details that are easy to get wrong. The cure…
What you'll learn
- what differential privacy actually guarantees
- the privacy budget epsilon and the accuracy-vs-privacy trade-off
- sensitivity of a query
- adding calibrated Laplace noise to an aggregate by hand in Python
- doing the same with a vetted library (OpenDP)
- reading epsilon claims critically
- the honest limits of differential privacy
Steps in this lab
- What differential privacy actually promises
- Epsilon: the privacy budget, and the trade you cannot escape
- See it by hand: add Laplace noise to a count
- Turn the dial: what epsilon actually costs
- Do it for real: the same noise, with OpenDP
- The wider toolbox: Google's library and PyDP
- The honest limits: what DP does not do
- What you built here, and the instinct to keep