Quantum Key Distribution: BB84 & E91
Detecting an eavesdropper by the disturbance they cannot avoid.
Every key exchange your browser performs today is secure only because certain math problems are believed to be hard, and Shor's algorithm solves the most common ones. BB84 swaps that belief for a law of physics: you cannot learn anything about non-orthogonal quantum states without disturbing them. In this lesson you run the protocol, compute exactly how loudly an eavesdropper is caught, and grow the same key from entanglement and a Bell test.
What you’ll learn
- State the BB84 protocol (preparation, measurement, sifting, parameter estimation, error correction, privacy amplification) and the role of each step.
- Derive the 25% error rate of the intercept-resend attack and the probability that Eve survives test bits.
- Prove that, for non-orthogonal states, any information gain causes disturbance.
- Describe E91 and its trusted-device variant BBM92, and explain how a CHSH test certifies the key.
- Compute the asymptotic key rate and locate the 11% error threshold.
The key-distribution problem
The one-time pad is unbreakable: to send a message , transmit with a uniformly random key as long as , used once. Shannon (1949) proved that is statistically independent of , so no amount of computing power helps an eavesdropper. The catch is the key. Alice and Bob need a fresh, shared, secret for every message.
Public-key cryptography (Diffie–Hellman, RSA, elliptic curves) solves the distribution problem, but only computationally: its security rests on factoring and discrete logarithms being hard, and those are exactly the problems Shor's algorithm solves. Quantum key distribution (QKD) attacks the distribution problem with physics instead.
Think first Why must a one-time pad never be reused? Suppose Alice sends and .
Eve computes : the key cancels. Natural-language messages are highly redundant, so can usually be unravelled into both messages. (This is how the US Venona project broke Soviet messages from the 1940s whose pad pages had been reused.) Perfect secrecy needs fresh key at the rate you communicate, which is exactly what QKD tries to supply.
BB84, step by step
BB84 (Bennett & Brassard, 1984) uses two bases of a qubit, in practice a photon's polarization:
The two bases are mutually unbiased: a state from one gives perfectly random outcomes in the other. Bit value is encoded as in or as in .
- Preparation. For each round , Alice picks a random bit and a random basis , and sends the state encoding in basis .
- Measurement. Bob measures each arriving qubit in his own random basis , obtaining .
- Sifting. Over the classical channel they announce the bases, never the bits, and keep only rounds with : about half. This is the sifted key.
- Parameter estimation. They publish a random sample of sifted bits and compute the quantum bit error rate (QBER) . If exceeds a threshold, they abort.
- Error correction. They reconcile the remaining bits, publicly revealing some parity information.
- Privacy amplification. They hash the corrected string to a shorter one, about which Eve's information is negligible.
| Alice's bit | Alice's basis | State sent | Bob's basis | Bob's result | Kept? |
|---|---|---|---|---|---|
| 0 | 0 | yes | |||
| 1 | 0 or 1 (random) | no | |||
| 1 | 1 | yes | |||
| 0 | 0 or 1 (random) | no | |||
| 1 | 1 | yes |
Alice sends and Bob measures in the basis. What does Bob observe?
- Always 0, because encodes the bit 0
- 0 or 1 with probability ½ each, uncorrelated with Alice's bit
- Always 1, because the bases disagree
- Nothing: a photon measured in the wrong basis is absorbed
Show the answer
B. 0 or 1 with probability ½ each, uncorrelated with Alice's bit
. The outcome is a fair coin, independent of Alice's bit, which is why sifting discards these rounds.
Eve's dilemma: information costs disturbance
Eve's simplest strategy is intercept-resend: measure each photon in a basis of her choosing and send Bob a fresh photon in the state she observed. She cannot copy the photon instead, because the no-cloning theorem forbids a copier for a set containing both and .
The bases are announced only after Bob has measured, so Eve must guess.
In these rounds she learns the bit and leaves no trace.
In a sifted round Bob measures in Alice's basis , and the resent state is unbiased with respect to it.
A 25% QBER in the sifted key, against roughly 0% on a clean link.
Attacking everything, she survives test bits with probability : about for .
Eve runs a full intercept-resend attack. What is the smallest number of test bits that catches her with probability at least 99.9%, i.e. ?
Show the answer
25 bits
, so : just misses, succeeds. A cautious Eve attacks only a small fraction of the photons, which is why the threshold must be set by a security proof rather than by "any errors at all".
Model any attack as a unitary coupling of the signal to Eve's probe , and suppose it leaves two signal states undisturbed.
Unitaries preserve inner products.
If the two states are non-orthogonal, Eve's probe ends in the same state for both: she has learned nothing that distinguishes them.
In BB84 each state overlaps each state, so the chain follows. An attack that disturbs none of the four states teaches Eve nothing at all; any information she gains forces a nonzero error rate.
E91: keys from entanglement
Ekert (1991) proposed a different picture: a source, possibly controlled by Eve, distributes Bell pairs and both parties measure. With and a real basis ,
When Alice measures her half in basis and gets , Bob's qubit is left in exactly the BB84 state . Prepare-and-measure BB84 is therefore equivalent to an entanglement-based protocol, the observation at the heart of its security proofs.
| Settings (Bloch angles in the – plane) | Correlation | Used for |
|---|---|---|
| Alice , Bob | depends on the pair | random choice each round |
| and | : identical bits | the key (2 of 9 setting pairs) |
| , , , | the CHSH test |
From raw key to secret key
Real links are noisy, so Alice and Bob must live with a nonzero QBER and decide how much secret key it leaves. Error correction requires Bob to learn about bits of parity information per key bit (Shannon's limit), and since that information is public, it must be paid back. Privacy amplification then compresses the string by however much Eve might know, using a randomly chosen hash function.
How much can Eve know? The entanglement picture answers it. Bit errors in the key are -type errors on the shared pairs; Eve's knowledge of the key is controlled by phase (-type) errors, which would appear as bit errors had the same pairs been measured in . Because the basis is random and announced only afterwards, the phase-error rate of the key rounds is estimated by the error rate of the rounds.
Secret bits per sifted bit for one-way post-processing, as (Shor & Preskill, 2000). is the bit-error rate of the key, and bounds the phase-error rate.
The binary entropy: , .
For a symmetric channel the two error rates coincide.
. This is the famous 11% threshold, and the reason the widget calls a run secure only when .
The measured QBER is . What fraction of the sifted key survives error correction and privacy amplification, ?
Show the answer
0.43
, so . Even modest noise costs more than half the key, and the cost grows steeply: at only about survives.
| Practical issue | Consequence | Countermeasure |
|---|---|---|
| Fiber loss, about dB/km | Key rate falls exponentially with distance; no repeaterless protocol beats bits per mode for transmissivity | Twin-field QKD (rate ), trusted relay nodes, satellites, eventually quantum repeaters |
| Weak laser pulses sometimes contain 2+ photons | Photon-number-splitting attack: Eve keeps a copy without disturbance | Decoy states: randomly vary the intensity to monitor the single-photon yield |
| Imperfect detectors | Blinding and timing attacks have fully broken commercial systems | Measurement-device-independent QKD; device-independent QKD |
| Finite number of rounds | Statistical uncertainty in | Finite-key analysis with composable security parameters |
Key takeaways
- BB84 encodes random bits in two mutually unbiased bases; sifting keeps the ~50% of rounds with matching bases, and test bits estimate the QBER.
- For non-orthogonal states, information gain implies disturbance. Full intercept-resend causes , and Eve survives test bits with probability .
- E91 distributes Bell pairs; matching settings give key, and a CHSH value near certifies that Eve is decoupled (monogamy). BBM92 is its trusted-device version, equivalent to BB84.
- With one-way post-processing the asymptotic key rate is per sifted bit, positive for .
- QKD needs an authenticated classical channel (it grows a key, it does not create one), and real devices need protection against implementation attacks.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Eve performs intercept-resend on a random 20% of the photons and leaves the rest alone. What QBER do Alice and Bob observe in the sifted key?
- 20%
- 5%
- 25%
- 10%
Show the answer
B. 5%
Each attacked sifted bit is wrong with probability , so . That is below the 11% threshold, which is fine: the security proof accounts for exactly this kind of partial information when it sets the privacy-amplification cost.
Why do Alice and Bob discard the rounds in which their bases differ?
- Eve is guaranteed to have intercepted those photons
- Those photons are usually lost in the fiber
- Announcing the bases has revealed those bits to Eve
- Bob's outcome is a fair coin, independent of Alice's bit, so those rounds carry no shared key
Show the answer
D. Bob's outcome is a fair coin, independent of Alice's bit, so those rounds carry no shared key
The bases are mutually unbiased: a state measured in (or vice versa) gives a uniformly random result. These rounds would contribute 50% errors and no correlation.
In E91, Alice and Bob's test rounds give , the maximum quantum value. What does this let them conclude?
- Their pairs are (essentially) the maximally entangled state, so by monogamy Eve's system is uncorrelated with their outcomes
- An eavesdropper is present, because a classical channel would give
- Their key is correct, but Eve may still hold a copy of it
- The source must be a trusted device built by Alice
Show the answer
A. Their pairs are (essentially) the maximally entangled state, so by monogamy Eve's system is uncorrelated with their outcomes
A maximal CHSH violation can only come from a maximally entangled pure state (up to local changes of basis). A pure state of cannot be correlated with anything else, so Eve is decoupled. The source may even be built by Eve.
The BB84 key rate is . Why is subtracted twice?
- Once for each of the two bases, and
- Because Alice and Bob each discard bits of their own strings
- Once to pay for the public error-correction information, and once for privacy amplification against Eve's information, which is bounded by the phase-error rate
- Because sifting removes half of the raw key
Show the answer
C. Once to pay for the public error-correction information, and once for privacy amplification against Eve's information, which is bounded by the phase-error rate
Error correction leaks about bits per key bit; Eve's knowledge is bounded by , the entropy of the phase errors. For symmetric noise .
Why must the classical channel of QKD be authenticated?
- To keep the basis announcements secret from Eve
- Otherwise Eve can run separate QKD sessions with Alice and with Bob, impersonating each to the other
- To reduce the QBER below 11%
- So that Bob can correct errors without revealing parity bits
Show the answer
B. Otherwise Eve can run separate QKD sessions with Alice and with Bob, impersonating each to the other
Without authentication, a man in the middle establishes one key with Alice and another with Bob, and relays (and reads) all traffic. Eve may hear the classical messages; she must not be able to forge them.
Go deeper
- Security Proofs & Privacy Amplification · From error rates to secret key rates.
- Device-Independent QKD · Security from Bell violations, trusting no hardware.
- Post-Quantum vs Quantum Cryptography · Two very different answers to the quantum threat.
Further reading
- C. H. Bennett & G. Brassard, "Quantum cryptography: Public key distribution and coin tossing", Proceedings of the IEEE International Conference on Computers, Systems and Signal Processing (1984).
- A. K. Ekert, "Quantum cryptography based on Bell's theorem", Physical Review Letters 67, 661 (1991).
- C. H. Bennett, G. Brassard & N. D. Mermin, "Quantum cryptography without Bell's theorem", Physical Review Letters 68, 557 (1992).
- M. A. Nielsen & I. L. Chuang, Quantum Computation and Quantum Information, §12.6 (Cambridge, 10th anniv. ed., 2010).