Quantum Key Distribution · Educational Deep Dive

BBM92: Quantum Key Distribution from Entangled Photons

How two people can agree on a secret key using nothing but entangled particles and the laws of quantum mechanics — explained, simulated, and visualized.

Simulation results below are generated by a real quantum-state implementation, not illustrations.

What is BBM92?

BBM92 is a quantum key distribution (QKD) protocol introduced in 1992 by Charles H. Bennett, Gilles Brassard, and N. David Mermin. It is an entanglement-based reformulation of the more famous BB84 protocol: instead of one party preparing and sending quantum states to the other, a source distributes pairs of entangled photons, one to each party, and the shared secret key emerges from the intrinsic randomness of their measurements.

Because BBM92 doesn't require either party to trust the source of the entangled pairs, it is a natural fit for satellite-based QKD, where the satellite itself can be treated as an untrusted relay.

The protocol pipeline

Every BBM92 session moves key material through the same six stages:

1. Entangled pair distribution
→
2. Random basis measurement
→
3. Public sifting
→
4. QBER estimation
→
5. Error reconciliation
→
6. Privacy amplification

1–2. Distribution and measurement

A source generates pairs of photons in the entangled Bell singlet state:

|Ψ⁻⟩ = (|01⟩ − |10⟩) / √2

One photon of each pair goes to Alice, the other to Bob. Each of them independently and randomly chooses one of two measurement bases — rectilinear (Z) or diagonal (X) — and measures their photon. Because the pair is entangled, this isn't like flipping two independent coins: whenever Alice and Bob happen to choose the same basis, quantum mechanics guarantees their results are perfectly (anti-)correlated, no matter how far apart they are.

The chart below shows the actual basis choices from a real run of the simulation (first 80 of 300 entangled pairs). Hover over the points — this is a live, interactive Plotly chart, not a static image.

Alice's and Bob's independently chosen measurement basis per trial.

3. Sifting

Over a public (but authenticated) classical channel, Alice and Bob reveal which basis they used for each trial — never their results. They keep only the trials where both chose the same basis and discard the rest. Since there are two bases, this keeps roughly 50% of the raw pairs.

Sifting outcome for this run: kept vs. discarded trials.

4. QBER estimation

Before trusting the sifted key, Alice and Bob sacrifice a random sample of it — publicly comparing the actual bit values (not just bases) — to estimate the Quantum Bit Error Rate (QBER). Any eavesdropping attempt on an entangled pair necessarily disturbs the correlation (a consequence of the no-cloning theorem and the monogamy of entanglement), which shows up as an elevated QBER. This simulation models an ideal, noiseless channel with no eavesdropper, so the estimated QBER should be essentially zero.

Estimated QBER for this run — low/green is good; high/red would indicate noise or eavesdropping.

5–6. Reconciliation and privacy amplification

Any small residual mismatches in the sifted key are corrected via public error-reconciliation (a simplified, single-pass Cascade-style block-parity scheme in this implementation). Finally, privacy amplification compresses the reconciled key through a universal hash function — a random Toeplitz matrix in this case — so that any partial information an eavesdropper might have gathered is diluted to a negligible amount in the final key.

How much key material survives each stage of the pipeline.

Bonus: what does a "collapsed" qubit look like?

Once measured, each half of an entangled pair collapses into a definite state pointing along the axis it was measured in. The Bloch sphere below plots a small sample of Alice's and Bob's post-measurement qubit states from this run — points cluster on the poles of whichever axis (Z or X) each party happened to measure in.

Post-measurement Bloch vectors for a sample of entangled pairs.

This run, by the numbers

300
Entangled pairs simulated
147
Sifted (matching-basis) bits
0.0%
Estimated QBER
59
Final secret key bits

Why entanglement-based QKD matters

ProtocolApproachEavesdropper detection
BB84Prepare-and-measure, 4 statesError rate vs. Alice's known preparation
E91Entanglement-basedViolation of Bell's inequality (CHSH)
BBM92Entanglement-based, 2 statesCorrelation checks in complementary (Z/X) bases

Because BBM92's key bits come from the inherent randomness of measuring an entangled state, no single party — not even the source — can predetermine the key. Combined with the fact that any interception attempt is physically detectable, this makes QKD resistant to "harvest now, decrypt later" attacks that threaten classical, computationally-secured key exchange in a post-quantum-computing world.

From simulation to a usable key: the Key Management System

A QKD link only produces raw key material — a real deployment needs a Key Management System (KMS) to store, track, and dole out that key material to applications safely. The companion project behind this post implements exactly that:

Try it yourself

The full source — the quantum simulation, the interactive dashboard, the KMS service, and the test suite — is open source. Clone it and run the whole pipeline locally:

# clone the project
git clone https://github.com/salavifa/bbm92-qkd
cd bbm92-qkd

# set up the environment
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# terminal 1: start the Key Management System
uvicorn bbm92.kms.api:app --reload

# terminal 2: start the interactive visualization dashboard
python -m bbm92.visualization.dashboard.app
# then open http://127.0.0.1:8050

# or run the whole pipeline end-to-end from the CLI
python scripts/run_demo.py --num-pairs 1000 --seed 7
View the code on GitHub →