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

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

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

Поддержка

A program that is meant to protect privacy can be wrong while every number it prints looks plausible. A NIST post in its series on differential privacy explains why. The algorithms in the series have mathematical proofs, but turning them into code can introduce bugs that quietly fail to protect privacy.

What a privacy bug looks like

Differential privacy adds random noise to the result of a data analysis. A certain amount of noise buys a certain amount of privacy. A privacy bug means too little noise, so too little privacy, or too much, which ruins the accuracy of the result.

The post’s example starts from a differentially private count of the elements in a dataset. The scale of the Laplace noise is chosen as 1/ε, and because the raw count has sensitivity 1, the result satisfies ε-differential privacy. Now suppose the program must return twice the count. If the code still uses scale 1/ε, it is wrong: the raw result is now 2-sensitive, so the program only satisfies ε/2-differential privacy. To reach ε, the scale must be 2/ε. In general, an s-sensitive function needs Laplace noise with scale s/ε.

Two common classes of bug are adding the wrong amount of noise, as above, and calculating a function’s sensitivity incorrectly. Others come from buggy proofs, details of floating-point arithmetic, flawed random-number generators and even a program’s execution time.

Why testing does not catch it

Ordinary testing compares output with an expected answer: an integer square root should give 3 for 9. Even that is only as good as the cases chosen, and the post notes a program cannot be proved 100 percent correct by testing when the possible inputs are too many. Testing is nonetheless the leading approach to software assurance, because most correctness rules can be expressed as pairs of inputs and outputs.

Privacy programs break that approach. Their outputs are random, and a privacy bug shows only in the distribution of outputs, not in any single value.

Diagram contrasting traditional testing, where a correct program gives good output and a buggy one gives bad output, with privacy testing, where both programs can output the same value

Figure 3 of the post: traditional testing works for typical programs but not for privacy programs. Image from NIST’s page.

Both a correct and a buggy program could return 42. The difference is that each draws it from a Laplace distribution with a different scale, and one draw cannot reveal that. The post shows this with two lists of ten results, both with a raw answer of 2000 and ε set to 1. Readers are asked to say which came from the buggy program, and the buggy one, with half the privacy guarantee, looks no less reasonable than the correct one. It would take hundreds or thousands of samples to tell, and the tester would have to know the exact sensitivity to know what spread to expect.

What may work instead

The post names two families of approaches, both tailored to differential privacy and both still active research:

  • Sophisticated testing. One approach by Ding and colleagues uses statistical hypothesis testing and can detect privacy bugs in small programs in seconds.
  • Program analysis. Several approaches reason about the code itself, varying in how much they automate and which language features they support.

The post expects practical tools of both kinds to appear in the next few years. A later post in the series was to look at how to test differentially private programs by running them many times on many inputs and analyzing the results.

Sources

Комментарии

Spinner Logo

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

Автор: Hub Nexus editors
Top 10 in AI, week of 12 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 2 November 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 26 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 19 October 2026
CC0 1.0 (общественное достояние)
Laser therapy uses an intense, narrow beam of light to remove or destroy cancer and abnormal cells that can turn into cancer. Learn how lasers work and about the conditions that they are used to treat.
CC0 1.0 (общественное достояние)
From a Networking Event to a Seed Study: Tracking Eelgrass Flowers in Barnegat Bay