Error correction and privacy amplification
After sifting, Alice and Bob still have mismatches and Eve may know some bits. Two classical steps fix both.
8 min read · reviewed December 2026
Step one: information reconciliation
Alice and Bob’s sifted keys differ in a few places. They run an error-correcting procedure over the public channel, which reveals some information, such as parities of blocks of bits. The cost is that every bit of information revealed is also available to Eve. The amount of information that must be revealed is about h(Q) per sifted bit, which is the first h(Q) in the key-rate formula.
Step two: privacy amplification
Eve may know some bits of the corrected key, either from partial interception or from the information revealed in step one. Alice and Bob shorten the key by applying a random hash function chosen from a suitable family, publicly agreed. If the output is short enough, Eve’s knowledge of it is negligible. The second h(Q) in the formula is the price of this shortening.
| Photons sent | Sifted | Compared | Measured error | Secret bits (asymptotic) |
|---|---|---|---|---|
| 10000 | 4924 | 1250 | 2.0% | 2634 |
| 100000 | 50110 | 12500 | 2.1% | 26601 |
What the table shows
The numbers come from the lab’s simulator with 2 percent noise. Of every thousand photons sent, about half survive sifting, a quarter of those are used for the error estimate, and the rest, scaled by about 1 − 2h(Q), becomes secret key. The final yield is a small fraction of the photons sent.
The lab’s simplification
The lab applies the asymptotic formula to compute the final key length. It does not run an actual error-correcting code or hash function. The key length is what the theory gives for long keys, not an engineered result.
Try it
Questions
Why not just throw away the wrong bits?
Alice and Bob do not know which bits are wrong. Finding them without revealing the key is the job of reconciliation.
What is a hash function in this context?
A random function that compresses a long string into a short one so that small changes in the input scramble the output. It turns partial knowledge into no knowledge.
Is this step quantum?
No. Both steps are ordinary classical computation over the public channel.
Read next
Sources and further reading
- C. H. Bennett and G. Brassard, “Quantum cryptography: public key distribution and coin tossing” (1984)
- P. W. Shor and J. Preskill, “Simple proof of security of the BB84 quantum key distribution protocol” (2000)
- A. K. Ekert, “Quantum cryptography based on Bell’s theorem” (1991)
- Algorithm page: BB84 protocol
- Lesson: quantum cryptography
Check the original sources for exact citations.