Algorithm Search⌘K

Conceptadvanced

Quantitative information flow

Also called QIF, leakage quantification.

Measures how much a program leaks about its secret in bits, as the drop in an attacker's uncertainty after seeing the output.

Quantitative information flow (QIF) measures how much a program or a system tells an observer about a secret. Noninterference asks a yes or no question: can the public output depend on the secret at all? Most useful programs fail it on purpose. A password checker tells the user whether the guess was right, and an election reveals the tally. QIF replaces the yes or no answer with a number. It models the system as a channel from secrets to observations, models the attacker's knowledge as a probability distribution, and reports the leakage in bits as the drop in the attacker's uncertainty. The measure of uncertainty must fit the attacker. This choice is the main design decision in the field.

In plain words

Before running the program, the attacker has some idea of what the secret could be. After seeing the output, the attacker knows more. QIF asks how much more. Uncertainty is measured in bits, so a leak of 3 bits means, roughly, that the attacker's set of likely secrets got 8 times smaller. A program that reveals nothing leaks 0 bits. A program that prints the secret leaks all of it. Everything in between is a matter of degree, and the right measure depends on what the attacker wants: one correct guess, several tries, or a value close enough to the truth.

The idea

Secrets, priors and channels. The secret XX takes values in a finite set X\mathcal X. The attacker's knowledge before the run is a prior distribution π\pi on X\mathcal X. The system is a channel: a matrix CC with C[x,y]=P(Y=y∣X=x)C[x, y] = P(Y = y \mid X = x) for each observable output yy. A deterministic program has one 1 per row. The observation yy turns π\pi into a posterior distribution p(x∣y)p(x \mid y) by Bayes' theorem. The observation is whatever the model says the attacker sees: a printed value, a running time or the state of a shared resource. The guarantee covers only that observation.

Leakage as a drop in uncertainty. Pick an uncertainty measure HH on distributions and its conditional form H(π,C)H(\pi, C), the expected uncertainty after the output. The leakage is

leakage=H(π)−H(π,C).\text{leakage} = H(\pi) - H(\pi, C).

The capacity of the channel is the largest leakage over all priors. It does not depend on what the attacker knows in advance, which makes it the usual worst-case figure.

The choice of measure. Three measures are in common use, and they can rank the same pair of programs in opposite order.

  • Shannon leakage. With Shannon entropy and conditional entropy, the leakage is the mutual information H(X)−H(X∣Y)H(X) - H(X \mid Y), and the capacity is the Shannon channel capacity. It measures the expected number of bits needed to describe the secret. Early work on covert channels and the static analysis of Clark, Hunt and Malacaria (2007) use it.
  • Min-entropy leakage. With min-entropy, H∞(π)=−log⁡2max⁡xπ(x)H_\infty(\pi) = -\log_2 \max_x \pi(x), the leakage measures how much the output raises the chance of guessing the secret in one try. Smith (2009) proposed it because Shannon leakage can call a program safe when it lets the attacker guess the secret often. See min-entropy leakage.
  • g-leakage. A gain function scores each guess against each secret, which models attackers with several tries or partial goals. Min-entropy leakage is one case. See g-leakage.

All QIF pages on this site measure entropy and leakage in bits, with log⁡2\log_2.

Facts that hold for these measures. Each is a theorem for min-entropy leakage and g-leakage, and the first two also hold for Shannon leakage.

  • Leakage is never negative: an attacker can ignore the output.
  • Processing the output further cannot increase leakage.
  • A channel that satisfies noninterference, so that every row of CC is the same, leaks 0 bits. The converse fails for min-entropy leakage: a channel can leak 0 bits to a one-try attacker under a given prior while its output still depends on the secret.
  • The min-capacity bound gives the worst case in closed form, log⁡2∑ymax⁡xC[x,y]\log_2 \sum_y \max_x C[x, y], and a deterministic program with mm outputs leaks at most log⁡2m\log_2 m bits under every prior. The min-capacity is also at least the Shannon capacity and at least every g-capacity.

Adversary. Unless a page states otherwise, the attacker knows the prior and the channel, sees one output and has unbounded computing power. An adaptive attacker who chooses inputs and runs the system many times needs a model of the whole interaction; Köpf and Basin (2007) give one for side channels.

Examples

The last two bits. Let hh be uniform on {0,…,7}\{0, \ldots, 7\} and let the program output h mod 4h \bmod 4. Each output is equally likely and leaves two secrets. Shannon leakage and min-entropy leakage both equal 2 bits, and the one-try chance of guessing hh goes from 1/81/8 to 1/21/2.

A password check. Let hh be uniform on 8 values and let the output be whether a guess equals hh. The Shannon leakage is the entropy of the output, H(1/8)=0.544H(1/8) = 0.544 bits. The min-entropy leakage is 1 bit: the attacker's chance goes from 1/81/8 to 1/41/4. The program fails noninterference, yet a single check leaks little. Repeated checks are a different system: an attacker who may test every value learns the whole secret.

An election. Following Smith (2009), suppose each of kk voters picks one of two candidates independently with probability 1/21/2, and the system reveals the number of votes for the first candidate. The secret is the vector of kk votes, with 2k2^k equally likely values, and the output has k+1k + 1 possible values. The min-entropy leakage is log⁡2(k+1)\log_2(k + 1) bits. For k=10k = 10 it is 3.4593.459 bits, and the chance of guessing every vote rises from 1/10241/1024 to 11/102411/1024.

Two measures that disagree. Let hh be uniform on 8-bit values. Program A outputs hh when hh is a multiple of 8 and outputs 1 otherwise. Program B outputs the last three bits of hh. Shannon leakage rates A at 1.169 bits and B at 3 bits. But A reveals the whole secret one time in eight, and min-entropy leakage rates it at log⁡233=5.044\log_2 33 = 5.044 bits against 3 bits for B. The numbers come from the exact calculation on the min-entropy leakage page.

A noisy channel. The binary symmetric channel with crossover probability 0.1 has Shannon capacity 1−H(0.1)=0.5311 - H(0.1) = 0.531 bits and min-capacity log⁡21.8=0.848\log_2 1.8 = 0.848 bits. The two capacities answer different questions: how many bits per use can a sender and a receiver who cooperate get through with coding, and how much does one use help a one-try guesser.

Where it is used

  • Covert channel analysis. The bandwidth of a covert channel is a capacity in bits per unit time. Since few channels can be closed completely, the practical question is often whether the bandwidth is low enough, not whether it is zero.
  • Side channels. A running time, a cache state or a power trace is an output of a channel from the key or the input. Bounding the number of distinct observations bounds the min-entropy leakage; see the min-capacity bound. Köpf and Basin (2007) model adaptive side-channel attacks in this setting.
  • Program analysis. Static analyses bound the Shannon or min-entropy leakage of a program, for example by bounding the number of its outputs. Clark, Hunt and Malacaria (2007) give such an analysis for a small imperative language.
  • Declassification policies. A declassification policy may allow a program to release some information, and QIF can state how much: at most kk bits for a stated measure and adversary.
  • Privacy of released data. Gain functions model attackers who want to learn a property of a person's record, such as an attribute value, rather than the whole record.

References

  1. Geoffrey Smith, On the foundations of quantitative information flow, Proceedings of FoSSaCS 2009, LNCS 5504, pp. 288 to 302; Section 4 (programs on which Shannon leakage misjudges the one-guess threat) and Section 5 (vulnerability, min-entropy leakage, the password checker and the election example)
  2. David Clark, Sebastian Hunt and Pasquale Malacaria, A static analysis for quantifying information flow in a simple imperative language, Journal of Computer Security 15(3), 2007, pp. 321 to 371, Shannon leakage of while programs and a static analysis that bounds it
  3. Boris Köpf and David Basin, An information-theoretic model for adaptive side-channel attacks, Proceedings of ACM CCS 2007, pp. 286 to 296, the leakage of an adaptive attacker who chooses inputs and observes a side channel
  4. Mario S. Alvim, Konstantinos Chatzikokolakis, Catuscia Palamidessi and Geoffrey Smith, Measuring information leakage using generalized gain functions, Proceedings of CSF 2012, pp. 265 to 279, gain functions, g-leakage and the comparison of capacities
  5. Mario S. Alvim, Konstantinos Chatzikokolakis, Annabelle McIver, Carroll Morgan, Catuscia Palamidessi and Geoffrey Smith, The Science of Quantitative Information Flow, Springer, 2020, Part I and Part II (secrets, channels, vulnerability, leakage and capacity)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/STSGVR/text.yaml