Secure statistical databases with random sample queries

Dorothy E. DenningACM Transactions on Database Systems 1980 · DOI

TL;DR

This seminal 1980 paper by Dorothy Denning introduces Random Sample Queries (RSQ), a method to prevent privacy leaks in statistical databases. By calculating statistics from a random subset of a query's results rather than the full set, the system introduces enough "noise" to thwart attackers trying to isolate individual records while maintaining high accuracy for legitimate large-scale data analysis.

What Problem Does This Paper Address?

The paper tackles the inference problem in statistical databases. Even if a database restricts access to individual records and only provides aggregate statistics (like means or counts), a clever user can often deduce confidential information.

For example, if you know the average salary of a department of 10 people, and then you get the average salary of the same department plus one specific new hire, you can easily calculate that new hire's exact salary. Attackers use "trackers"—sets of carefully crafted queries—to isolate individuals by intersecting different groups. Traditional defenses, like rounding results or restricting very small query sets, are often easy to bypass or too restrictive for researchers who need accurate data.

Methods

Denning proposes a new control mechanism: Random Sample Queries (RSQ).

  1. Sampling at Query Time: Instead of returning a statistic based on every record that matches a query (the "query set"), the system selects a random sample of those records.
  2. Selection Function: To decide if a record $i$ is included in the sample for a query $C$, the system uses a selection function $f(C, i)$. This function is designed to be "pseudorandom"—it feels random to the user but is deterministic based on the query and the record's unique ID. This ensures that the same query always returns the same (sampled) result, preventing users from simply asking the same question repeatedly to average out the noise.
  3. Statistical Estimation: The system returns sampled relative frequencies ($RFREQ^*$) and sampled means ($AVG^*$). Because the sample size is known (governed by a probability parameter $p$), these serve as unbiased or nearly unbiased estimators of the true population statistics.

Datasets

The author evaluated the RSQ method using simulated databases of varying sizes:

  • Sizes: $N = 100, 500,$ and $1000$ records.
  • Generation: Records were created using a pseudorandom number generator. Each record included an 18-bit random ID and several data fields (like salary) generated over a uniform distribution.
  • Testing: 300 random characteristic formulas were used to measure the error rates and the difficulty of compromise.

Key Insights and Ideas

  • The Power of Large Samples: Unlike traditional census sampling which uses tiny fractions of a population, RSQ uses large samples (e.g., $p = 0.9375$). This keeps the statistics very accurate for legitimate use.
  • Error Scaling: A crucial insight is that the relative error in the statistics decreases as the query set size ($n_C$) increases, following a $1/\sqrt{n_C}$ relationship. This is ideal: the groups we care most about (large ones) get the most accurate results.
  • Compounding Errors for Attackers: While the error is small for a single query, it becomes catastrophic for an attacker. Tracker attacks involve subtracting the results of multiple queries. In RSQ, the independent sampling errors in each query don't cancel out; they compound. This makes the "isolated" result for an individual record wildly inaccurate.
Figure 1: This graph shows that as the query set size increases, the expected root-mean-squared relative error drops significantly, especially for higher sampling probabilities (p).

Key Results

  • High Accuracy: For a sampling probability $p = 0.9375$ and a query set of roughly 670 records, the relative error is less than 1%.
  • Robustness Against Trackers: In experiments, tracker attacks on small databases resulted in mean relative errors of over 700% for frequencies.
  • Computational Cost of Attack: The paper calculates that in a database of 20,000 records, an attacker would need to pose over 1.2 million queries to reliably compromise a single mean value using a tracker if $p = 0.5$. This makes manual attacks impossible and computer-aided attacks much easier to detect.

Limitations and Future Work

  • Small Query Sets: RSQ is less effective when the query set is very small (e.g., 1 or 2 records), as the record might be included in the sample with high probability. The author suggests combining RSQ with a minimum query set size restriction.
  • Equivalent Queries: If an attacker can generate many syntactically different but logically "equivalent" queries (e.g., "Males over 20" vs "Males not under 21"), they might get different samples and average them to find the true value. Denning suggests using a "normal form" for formulas or a two-pass sampling approach to ensure equivalent queries always use the same sample.
  • Dynamic Databases: The analysis assumes a static database. Future work would need to address how frequent updates (inserts/deletes) might allow an attacker to observe changes in the sampled output to infer new data.

Summary updated

Abstract

A new inference control, called random sample queries, is proposed for safeguarding confidential data in on-line statistical databases. The random sample queries control deals directly with the basic principle of compromise by making it impossible for a questioner to control precisely the formation of query sets. Queries for relative frequencies and averages are computed using random samples drawn from the query sets. The sampling strategy permits the release of accurate and timely statistics and can be implemented at very low cost. Analysis shows the relative error in the statistics decreases as the query set size increases; in contrast, the effort required to compromise increases with the query set size due to large absolute errors. Experiments performed on a simulated database support the analysis.
BibTeX
@article{denning1980secure,
  author = {Dorothy E. Denning},
  title = {{Secure statistical databases with random sample queries}},
  journal = {ACM Transactions on Database Systems},
  year = {1980},
  doi = {10.1145/320613.320616},
}

Loading related content...

Figure