← Back to section · Quantum Information Science

BB84 Step by Step: From Four Prepared States to the Final Key

BB84 taken apart as a six-stage pipeline: preparation and transmission, basis sifting, error sampling, information reconciliation, privacy amplification, and the authenticated channel — what each stage defends against, discards, and keeps.

Published 22 November 2026 · 6 min read · PQ Frontier

BB84 Step by Step: From Four Prepared States to the Final Key
AI-generated site artwork
Video explainer · Quantum communication: QKD and repeaters

Our QKD overview article explains BB84’s basic idea and where it fits. This article takes a different angle: treat the protocol as a pipeline and follow a stream of photons from preparation to finished key, seeing exactly what each stage does, what it throws away, and what it defends against. Most of QKD’s engineering and security boundaries hide in the details of this pipeline.

Stage 1: Preparation — Four States, Two Bases, True Randomness

For every bit, Alice makes two independent random choices: the bit value (0 or 1) and the encoding basis. The rectilinear basis encodes 0/1 as horizontal/vertical polarization; the diagonal basis encodes 0/1 as +45°/−45° polarization. Together these are four non-orthogonal quantum states: within one basis the two states are orthogonal and distinguishable, across bases they are pairwise non-orthogonal — and that is precisely where security comes from: any measurement must first guess a basis, a wrong guess yields no definite information, and the act of measuring disturbs the state. The 「randomness」 here must be genuinely random: if the basis and bit choices were predictable, the protocol’s security argument collapses. Ideally the protocol assumes single photons; real systems use attenuated lasers plus decoy states to close that gap, a mechanism covered in the overview article and not repeated here.

Stage 2: Transmission and Measurement — Bob Can Only Guess, Too

Photons reach Bob through fiber or free space. Bob does not know which basis Alice used, so he measures each photon in a randomly chosen basis: with the right basis, his result agrees with Alice’s bit deterministically (in the absence of noise); with the wrong basis, his result is completely random and uncorrelated with the original bit. Note that there is no 「store it now, measure later」 option: quantum states cannot be cloned, unmeasured photons cannot be shelved for long (quantum memory is still experimental technology), so measurement must happen on the spot. An eavesdropper, Eve, faces exactly the same predicament — she too can only guess a basis and measure. This symmetric dilemma is deliberate design; the only asymmetry is that Alice and Bob can afterwards compare bases, while Eve cannot make her disturbance disappear.

Stage 3: Sifting — Publish the Bases, Never the Results

After transmission, the two parties announce, over a classical channel, which basis each of them used for every position (bases only — never measurement results or bit values), and discard all positions where the bases disagree. Since both sides chose bases independently at random, on average about half the data survives: the sifted key. Announcing bases leaks nothing: basis and bit value are independent, so knowing the basis without the result tells you nothing about the bit. This stage also explains the first deduction in QKD’s rate accounting — the raw pulse count is halved immediately, with sampling and post-processing still to come. A final key rate far below the photon emission rate is built into the protocol’s structure, not a sign of poor engineering.

Stage 4: Error Sampling — Where Eavesdropping Leaves Its Trace

The parties randomly select a small portion of the sifted key, publicly compare its values to estimate the quantum bit error rate (QBER), and discard the sampled portion. Errors have two sources: intrinsic device and channel noise, and possible eavesdropping. Why must eavesdropping leave a trace? Take the canonical intercept–resend attack: Eve intercepts every photon, measures in a guessed basis, and resends according to her result. She guesses the wrong basis half the time; a photon resent in the wrong basis gives Bob a wrong result with probability one half even when he uses Alice’s basis — an added error rate of about 25% overall, far above the few-percent background of a healthy system. The decision rule is therefore clear: if the QBER lies within the expected noise range, proceed; if it is anomalously high or exceeds the security threshold, void the round and abort. With one-way classical post-processing, BB84’s theoretical tolerable QBER ceiling is about 11% (the classic result of the Shor–Preskill proof); deployed systems usually set their abort line more conservatively.

Stage 5: Information Reconciliation — Correcting Errors in Public Without Leaking the Key

The two sifted keys are not yet identical: the few-percent background errors are still in them. The parties must perform error correction over the public classical channel (this step is called information reconciliation), typically interactively with cascade codes or LDPC-type classical codes. Correction necessarily exchanges parity information over the public channel, and that information must be accounted for precisely: it is assumed known to Eve and deducted in the next stage. If correction fails (the two keys still disagree), the whole round is discarded — mismatched keys are an availability problem, not a security one, but the rule stands: better no key than a disputed one.

Stage 6: Privacy Amplification — Compressing Eve’s Knowledge Away

At this point Alice and Bob hold identical bit strings, but Eve may know part of them through eavesdropping and through listening to the public channel. Privacy amplification applies a publicly chosen universal hash function to compress the longer reconciled key into a shorter final key: the compression ratio is set by an upper bound on Eve’s information, and the shorter the output, the closer Eve’s expected information about the final key is driven to zero (the leftover hash lemma makes this quantitative). The final key length follows a strict ledger: sifted length, minus the sampling cost, minus the reconciliation leakage, minus the eavesdropping bound inferred from the QBER, minus a finite-size security margin — get any term wrong and the security conclusion fails. This is why serious QKD systems always report key rates far below naive estimates.

The Thread Through It All: The Authenticated Classical Channel

Looking back, three of the six stages run over the classical channel: basis announcements, sampling comparison, and reconciliation plus hash-function selection. This channel need not be confidential, but it must be tamper-proof: if Eve could forge classical messages, she could impersonate each party to the other (a man-in-the-middle attack), and no amount of quantum perfection would help. Authentication is usually done with a pre-shared key combined with universal hashing for message authentication, or with digital signatures — which makes QKD a key-expansion mechanism: a small shared secret first, then a continuous supply of fresh key. A final note on positioning: BB84 outputs symmetric key material; encryption itself is still done by classical algorithms such as one-time pad or AES. QKD’s job is only to deliver the key safely to both ends.

References

  • Bennett & Brassard, Quantum cryptography: Public key distribution and coin tossing, Proc. IEEE Int. Conf. on Computers, Systems and Signal Processing, 175 (1984).
  • Shor & Preskill, Simple proof of security of the BB84 quantum key distribution protocol, Phys. Rev. Lett. 85, 441 (2000). https://doi.org/10.1103/PhysRevLett.85.441
  • Scarani et al., The security of practical quantum key distribution, Rev. Mod. Phys. 81, 1301 (2009). https://doi.org/10.1103/RevModPhys.81.1301

Tags: BB84QKDProtocol Walkthrough