BB84

Quantum Key Distribution · Bennett–Brassard 1984

Watch Alice send polarized photons in random bases, Bob measure and sift a shared key, and Eve's interception spike the QBER to ~25% and expose her.

SIMULATED — This demo simulates the BB84 protocol classically. No actual photons or quantum states are produced. Security claims assume a perfect implementation.

Press Run Without Eve or Run With Eve to send photons down the channel.

Line angle = basis + bit: 90° · ⊕ bit 1 0° · ⊕ bit 0 45° · ⊗ bit 0 135° · ⊗ bit 1
ALICE BOB

Click a photon as it lands to read what Alice encoded on it.

Photons sent: 0 Sifted: 0 (0%) Errors: 0 (0%) Key bits: 0
Key bit — bases matched Error — noise or Eve Discarded — bases differ Eve intercept ⊕ rectilinear · ⊗ diagonal

Sifting — keep the photon only when the bases match

Showing a sample of photons. Bob picks his basis independently and at random, with no knowledge of Alice's — so bases agree about half the time.

For each sampled photon: Alice's bit, Alice's basis, Bob's basis, and whether the photon is kept or discarded.
#
Alice bit
Alice basis
Bob basis
Sift

Run the protocol to build the per-photon sifting table.

All photons at a glance kept discarded error (sacrificed)

BB84 PROTOCOL

SECURITY ANALYSIS

0% 50%
How a large quantum computer affects common cryptographic schemes compared with BB84.
Security TypeBasisQuantum computer breaks it?
RSA-2048FactoringYES — Shor's algorithm
ECDSA P-256Discrete logYES — Shor's algorithm
AES-256Brute forceREDUCED — Grover (128-bit eff.)
ML-KEM (Kyber)LatticeBELIEVED NO — unproven
BB84 QKDPhysicsNO — information-theoretic*

* Assuming an authenticated classical channel, devices that match the security proof's model, and correct post-processing — practical attacks target the implementation. A message later encrypted with AES-GCM (step 6) is protected computationally, not information-theoretically.

Two distinct theorems do the work here. No-cloning (Wootters & Zurek, 1982; Dieks, 1982): no operation can produce a perfect copy of an arbitrary unknown quantum state. It is a statement about copying being impossible, not about disturbance — it is why Eve cannot duplicate the photon and let the original pass through untouched. Measurement disturbance: measuring in the wrong basis collapses the state and randomizes the outcome. This is what lets Alice and Bob detect Eve. No-cloning removes Eve's copy-and-forward option; measurement disturbance exposes the attack this demo simulates. This panel models the simplest full attack, intercept-resend: measure each photon and send Bob a replacement. But Eve does not know Alice's basis. If she guesses wrong: • She collapses the photon to her basis • She resends in her measured state • Bob, using Alice's correct basis, gets a random result 50% of the time • Full interception produces a ~25% QBER — the expected disturbance for intercept-resend in the ideal four-state model A general Eve has subtler strategies: entangling probes, storing quantum states until the bases are announced, collective measurements across many signals, or attacks on the hardware itself. BB84's security does not rest on intercept-resend being Eve's best move — it rests on a security proof that bounds Eve's information from the observed error rate under an explicit model of the devices. Physics supplies the constraints that proof uses; it does not by itself secure the equipment around the channel.

REAL-WORLD LIMITATIONS

✗ Distance: fiber loss cuts the key rate sharply with distance; practical range depends on protocol and detectors, and long links lean on trusted relays or newer designs (twin-field QKD) ✗ Infrastructure: requires single-photon sources and detectors ✗ Key distribution only: does not provide authentication or signatures ✗ Trusted nodes: long-distance networks require trusted relay points which reintroduce classical vulnerabilities ✗ Side channels: timing, power, or implementation flaws can leak information not protected by quantum mechanics This simulation assumes a perfect implementation — the no-cloning theorem protects the quantum channel, not the hardware around it. QKD and post-quantum cryptography are complementary: PQC for most infrastructure, QKD for highest-value point-to-point links.

DEPLOYED QKD NETWORKS (2026)

China: 2,000km Beijing–Shanghai ground network + Micius satellite Europe: EuroQCI linking EU member states (in deployment) Asia: Metropolitan networks in South Korea, Japan, Singapore