From raw key to secret key
At the end of BB84, Alice and Bob each hold a string of sifted bits. In the idealised story the strings are identical and Eve knows nothing. In practice neither is true:
- Real fibres and detectors produce errors, so the two strings differ in a few percent of positions.
- Alice and Bob cannot tell honest noise from eavesdropping, so they must assume Eve caused every error, and by the last lesson that means she may hold some information about the key.
This lesson covers the classical processing that repairs both problems. No qubits are involved. Everything happens in conversation over the public channel, with Eve listening to every word.
It assumes you know BB84 and what entropy measures.
The pipeline
Section titled “The pipeline”| Stage | What goes in | What comes out |
|---|---|---|
| Sifting | Every round | Rounds where the bases matched |
| Parameter estimation | Sifted key | An estimate of the error rate, minus the sampled bits |
| Information reconciliation | Two slightly different strings | Two identical strings |
| Privacy amplification | An identical, partly leaked string | A shorter string that Eve knows nothing about |
Each stage costs bits. The question is how many are left at the end.
Estimating the error rate
Section titled “Estimating the error rate”Alice and Bob pick a random sample of their sifted bits, announce the values, and count the disagreements. The fraction is the quantum bit error rate, usually written QBER or just . The sampled bits are now public, so they are thrown away.
The error rate does two jobs. It tells them how much correcting they have to do, and it bounds how much Eve can know. A small means the states arrived almost undisturbed, and undisturbed states gave Eve almost nothing.
Information reconciliation
Section titled “Information reconciliation”Next they make the strings identical. Bob cannot ask “what is your bit 7?”, since that would give bit 7 to Eve. Instead Alice announces parities: the sum modulo 2 of a block of bits. A parity reveals one bit of information about the block, however long the block is.
If Bob’s parity for a block differs from Alice’s, the block contains an error, and they can find it by halving. In the simulator there is exactly one error in Bob’s 16 bits.
Locating one error among 16 bits took five announced parities. The price is that Eve heard all five. Each one is a bit of information about the key that she did not have before, and it will have to be paid for in the next stage.
Alice’s and Bob’s parities for a block agree. What can Bob conclude?
Two errors in the same block cancel in the parity. Practical protocols shuffle the key and repeat with different blocks to catch them.
That gap is why real reconciliation takes several passes. A widely used early protocol, Cascade, splits the key into blocks, fixes one error in each block whose parity disagrees, then shuffles the key and repeats with larger blocks. An error fixed in a later pass exposes a second error hiding in an earlier block, and the corrections cascade backwards. Many current systems use error-correcting codes of the kind used in telecommunications instead, which need less back-and-forth.
How many bits must be revealed? Shannon’s theory gives a floor. If each bit is wrong with probability , correcting bits requires revealing at least
is the binary entropy. Some values:
| Error rate | 1% | 3% | 5% | 11% |
|---|---|---|---|---|
| 0.081 | 0.194 | 0.286 | 0.500 |
At an error rate of 5%, more than a quarter of the key’s worth of information is given away just to fix the errors. Practical methods reveal somewhat more than this minimum.
Privacy amplification
Section titled “Privacy amplification”Alice and Bob now share an identical string, and Eve knows part of it: whatever she got from the qubits, plus every parity announced during reconciliation. They do not know which part she knows. They only have a bound on how much.
The remedy is to compress. Here is the idea in its smallest form. Alice and Bob share two bits, and Eve knows one of them. They replace the two bits by their sum modulo 2. Eve knows one term of the sum and has no idea about the other, so she knows nothing at all about the result. Two half-secret bits have become one fully secret bit.
In general they compute many parities of the whole string, each over a randomly chosen subset of positions, and keep only those parities. The choice of subsets is made after Eve has finished her attack and is announced publicly. This is a hash function picked at random from a suitable family.
Things to try:
- With Eve knowing 6 bits, set the final key length to 4 and press Try 1,000 hashes. Almost every hash removes her completely.
- Raise the length to 10, exactly the number of bits she is missing. Now most hashes fail.
- Raise it to 12. Every hash fails, and no cleverness can prevent it.
Eve was missing 10 bits of the string. A final key of up to 10 bits can in principle be completely unknown to her, and a longer one cannot. A randomly chosen hash achieves this with high probability as long as the key is made a little shorter than the limit, and each bit given up as a safety margin roughly halves the chance of failure. The general result, the leftover hash lemma, says the same about any kind of partial knowledge Eve might have, not only knowledge of particular bits.
Notice what Alice and Bob did not need: any idea of which bits Eve knew.
How much key is left
Section titled “How much key is left”Now add up the bill for BB84, per sifted bit, in the limit of a very long key.
- Reconciliation reveals at least .
- The security proofs for BB84 show that an eavesdropper who causes an error rate can hold at most bits of information about each sifted bit from the quantum transmission.
Privacy amplification must remove both, leaving a secret key rate of
The rate reaches zero where , at an error rate of about 11%. Above that, this procedure produces no key at all, and Alice and Bob must abort. The intercept-and-resend attack causes 25% errors, so it is not merely detected. It leaves nothing to steal.
Alice and Bob measure an error rate of 15% in a BB84 run processed as described here. What should they do?
At 15% the two costs, each , exceed the entire key. Whatever is left after reconciliation could be known to Eve.
Two qualifications. The 11% figure belongs to this particular recipe, in which the classical messages for reconciliation flow one way. Protocols in which Alice and Bob talk back and forth are known to tolerate somewhat higher error rates. And a real run is finite: the error rate is only an estimate from a sample, and the uncertainty in that estimate has to be covered by removing still more bits.
A worked example
Section titled “A worked example”Alice sends one million qubits, and suppose for simplicity that all of them arrive.
- Sifting keeps about half: 500,000 bits.
- They sacrifice 50,000 to estimate the error rate, and find 3%. That leaves 450,000.
- Reconciliation reveals at least bits.
- Privacy amplification removes those and another 87,500 for what Eve may have learned from the qubits.
About 275,000 secret bits remain, a little over a quarter of what was sent. In a real system most photons are lost on the way, and the numbers are far smaller.
Authentication, and what QKD really provides
Section titled “Authentication, and what QKD really provides”One assumption has been hiding in every step: when Bob hears “Alice” on the public channel, it really is Alice. If Eve can impersonate each of them to the other, she simply runs BB84 separately with both and reads everything.
So every classical message must be authenticated. There are authentication schemes whose security does not depend on any computational assumption, but they need Alice and Bob to share a short secret key beforehand, and they use some of it up each time.
This is why QKD is strictly a key-growing protocol. It starts from a small shared secret and produces a much larger one, part of which is set aside to authenticate the next run. It does not let two strangers who have never shared anything establish a key from nothing.
What the proof covers
Section titled “What the proof covers”The guarantee at the end is unusually strong. It does not depend on Eve’s computing power, now or in the future: a key that was secret when it was made stays secret. This is called information-theoretic security.
But it is a statement about the protocol as written, run on devices that behave as the proof assumes. A source that sometimes emits two photons, a detector that responds differently to different timing, or a modulator that leaks its setting all break the assumptions, and attacks on real systems have exploited exactly such gaps. Closing them is engineering, and it is ongoing work.
The next lesson describes a different way of doing key distribution, in which the security test makes far fewer assumptions about the devices.
Remember it
Section titled “Remember it”After sifting, what are the three stages of classical processing in QKD?
Parameter estimation (measure the error rate), information reconciliation (make the keys identical), privacy amplification (remove what Eve knows).
Why does error correction cost key in QKD?
Every parity announced over the public channel is heard by Eve. At least bits per key bit must be revealed, and all of it removed later.
How does privacy amplification work?
Alice and Bob hash the key to a shorter one, for example by keeping random parities of it. If the output is a little shorter than Eve's uncertainty, she knows essentially nothing about it.
What is the asymptotic secret key rate of BB84 per sifted bit, at error rate ?
, where is the binary entropy: for error correction and for privacy amplification.
Above roughly what error rate does standard BB84 yield no key?
About 11%, where .
Why is QKD called a key-growing protocol?
The classical channel must be authenticated, which needs a short shared secret to begin with. QKD turns a short key into a long one.