BB84 key distribution
Alice and Bob want to talk privately. If they share a random secret key as long as their message, the one-time pad makes the message perfectly secure. The hard part is getting the key to both of them without anyone else seeing it. That is the key distribution problem.
Classical solutions rest on mathematical assumptions, such as factoring being hard. BB84, published by Charles Bennett and Gilles Brassard in 1984, rests on physics instead: anyone who listens to the quantum channel leaves evidence.
This lesson assumes you know the material in the Quantum Information track up to measurement.
Two ways to store a bit in a qubit
Section titled “Two ways to store a bit in a qubit”Alice can encode a bit in either of two bases:
| Basis | Bit 0 | Bit 1 |
|---|---|---|
| (rectilinear) | ||
| (diagonal) |
Bob can measure in either basis. Measuring in the basis is an ordinary measurement. Measuring in the basis means applying first, which you saw distinguishes from perfectly.
Everything follows from one fact. If Bob uses the basis Alice used, he reads her bit correctly. If he uses the other basis, his result is a fair coin flip and carries no information about her bit.
Alice encodes the bit 1 in the basis. Bob measures in the basis. What does he get?
Bit 1 in the basis is . By the Born rule a measurement gives each outcome with probability one half.
The protocol
Section titled “The protocol”- Alice sends. For each qubit she picks a random bit and a random basis, and sends the corresponding state.
- Bob measures. For each qubit he picks a random basis, measures, and writes down the result.
- They compare bases, not bits. Over an ordinary public channel they announce which basis they used for each qubit. They keep the rounds where the bases matched and discard the rest. This step is called sifting.
- They test for eavesdropping. They reveal a random sample of the kept bits and compare. If too many disagree, they abort.
About half the rounds survive sifting, and without interference Alice and Bob hold identical bits in those rounds. Run it a few times with the eavesdropper switched off.
Why eavesdropping shows
Section titled “Why eavesdropping shows”Now switch Eve on. She uses the most obvious attack, called intercept and resend: she measures each qubit as it passes and sends Bob a fresh qubit prepared according to what she saw.
Her problem is that she does not know Alice’s basis, and Alice does not announce it until after Bob has measured. So Eve has to guess.
- Half the time she guesses right. She reads the bit correctly and resends the correct state. No trace.
- Half the time she guesses wrong. Her result is random, and she resends a state in the wrong basis. When Bob then measures in Alice’s basis, his result is random too, so it is wrong half the time.
In the kept rounds, the chance of an error is therefore . Use Send 10,000 more with Eve on and off to check the two rates.
A 25% error rate is impossible to miss. If Alice and Bob compare just 50 sample bits, the chance that Eve slips through with no mismatches is , less than one in a million.
Why Eve cannot do better by copying
Section titled “Why Eve cannot do better by copying”Eve would like to copy each qubit, pass the original along untouched, and measure her copy once the bases are announced. The no-cloning theorem forbids exactly this: no physical process copies an unknown quantum state. Any attack that gains information about the key must disturb the states, and the more Eve learns the more errors she causes.
What the simple picture leaves out
Section titled “What the simple picture leaves out”BB84 as described is a sketch. A working system has to deal with several more things:
- Real channels are noisy, so some errors occur without any eavesdropper. Alice and Bob cannot tell noise from Eve and must assume the worst. They correct the errors and then compress the key to squeeze out whatever Eve might know. For BB84 this works when the error rate is below roughly 11%.
- The public channel must be authenticated. Otherwise Eve can simply pretend to be Bob. Authentication needs a short shared secret to begin with, so BB84 is strictly a way of growing a key.
- Devices are imperfect. The security proof is about the ideal protocol. Practical attacks have targeted the gap between it and real hardware, for example detectors that can be blinded with bright light.
The next lessons take these in turn.
Remember it
Section titled “Remember it”In BB84, which rounds do Alice and Bob keep?
The rounds where Bob happened to measure in the basis Alice prepared in, about half of them.
What error rate does an intercept-and-resend eavesdropper cause in the sifted key?
About 25%.
Why does intercept-and-resend cause 25% errors?
Eve guesses the wrong basis half the time. When she does, Bob's result is random, so it is wrong half of those times.
What do Alice and Bob say in public during BB84, and what do they keep private?
They announce which bases they used, after Bob has measured. They keep the bit values private, apart from a sample sacrificed to estimate the error rate.