Перейти к содержимому
Hub Nexus

Автора пока нетВзять себе

Версия 2Обновлено 3 мин чтения

Поддержка

Two lines of code can compute a "private" average, and still leak a person's birthday. That is the cautionary example in a guest post on NIST's differential privacy blog series by Dan Kifer, a computer science professor at Penn State, who explains how to test programs that claim differential privacy. The post notes that, in the worst case, it is mathematically impossible to find every privacy bug, but most are easy to catch with a little experimentation.

The three-step recipe

  1. Create a pair of datasets, X and Y, that differ in one person's data.
  2. Choose an outcome to focus on.
  3. Show that this outcome is too frequent or too infrequent with input X compared with input Y.

Differential privacy with parameter epsilon promises that no outcome becomes more than a bounded factor more or less likely when one person is added or removed. Breaking that promise on any pair of datasets is a bug.

Step one: pick simple datasets

Tiny datasets are enough to find many bugs. The post's example computes an average age with noise added, where ages are capped between 0 and 120. The simplest pair is an empty dataset X and a one-person dataset Y, say a person aged 120. With Y the program returns an extremely noisy number. With X it crashes with an error, because it divides by zero.

That error is itself a bug, and exploitable. An attacker could ask for the private average age of all people with one particular name and one particular birthday, trying one birthday after another with a tiny epsilon. Only the correct birthday gives no error, so the system thinks little privacy budget was spent while the attacker learns exactly when a person was born. The lesson: look for odd cases such as an empty dataset or an extreme value, and use several pairs if one cannot cover everything.

Step two: choose the outcome

In the example the outcome is the error message: it happens with one input and never with the other. In general, suppose you are evaluating a cheap imitation of a differentially private mechanism. Run it many times on X and count how often each output appears, then do the same on Y. Plot the logarithm of the frequencies, which turns "this many times more frequent" into a simple difference. Differential privacy allows each output's frequency to differ between X and Y only within bands set by exp(epsilon). If the mechanism is private, the plot for Y should stay inside those bands.

In the post's example plot, outputs below zero were much less frequent under Y than allowed. So the outcome to watch is "output of zero or less." If it is truly too rare under Y, that proves the mechanism lacks its claimed privacy.

Step three: prove it

The pattern could be chance, so you either prove mathematically that the outcome is much more likely under one input, or run statistical tests that confirm it. Existing tools use both approaches.

Tools

Software can do this tedious work. StatDP and DP-Finder were the first, and the post's discussion follows the StatDP method. CheckDP, DiPC and DPCheck came later, and the list is growing.

Limits and next steps

Testing gives confidence from input and output behavior alone, but it gets harder when the input or output space is huge or the computation is expensive. The next post in the series covers program analysis, which examines the code itself and can give confidence after a single run, or even without running the program at all.

Sources

  • Dan Kifer (guest author), Testing for Differential Privacy Bugs, NIST Cybersecurity Insights blog, differential privacy series edited by Joseph Near and David Darais; rewritten in hubnx's own words. The post's code and plots are left out.

Комментарии

Spinner Logo

Ещё на тему «Наука»

Автор: Hub Nexus editors
Top 10 in AI, week of 26 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 19 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 12 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 2 November 2026
CC BY 4.0
Adaptive Evolution
CC0 1.0 (общественное достояние)
FEQinput helps hydrologists read, search, edit and run input files for FEQ, the USGS model of unsteady flow in open channels, showing descriptions of input lines to help new users overcome a steep learning curve.