BB84
Quantum Key Distribution · Bennett–Brassard 1984
Simulate preparation, measurement and sifting, then compare sampled error rates with and without an intercept-resend Eve; full interception gives about 25% QBER on an ideal noiseless channel.
Classical simulation — no photons or quantum security. SHA-256 key derivation here is not a security proof for privacy amplification.
The QBER slider sets a teaching threshold. A security cutoff depends on the device assumptions and finite-key analysis.
Press Run Without Eve or Run With Eve to send photons down the channel.
Click a photon as it lands to read what Alice encoded on it.
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.
| # |
|---|
| Alice bit |
| Alice basis |
| Bob basis |
| Sift |
Run the protocol to build the per-photon sifting table.
BB84 PROTOCOL
SECURITY ANALYSIS
| Security Type | Basis | Quantum computer breaks it? |
|---|---|---|
| RSA-2048 | Factoring | YES — Shor's algorithm |
| ECDSA P-256 | Discrete log | YES — Shor's algorithm |
| AES-256 | Brute force | REDUCED — Grover (128-bit eff.) |
| ML-KEM (Kyber) | Lattice | BELIEVED NO — unproven |
| BB84 QKD | Physics | NO — 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.
REAL-WORLD LIMITATIONS
DEPLOYED QKD NETWORKS (2026)
TRY PUBLIC POST-PROCESSING
The main six-step run intentionally skips reconciliation. After an accepted run, try a small-code correction and a separately seeded extractor on the same retained bits. Alice publicly sends three syndrome bits per seven-bit block and a 16-bit verification tag. Bob can repair at most one error per block; a mismatched tag rejects other errors with a residual collision probability of 2−16.
Starts at zero because this simulation cannot infer Eve's conditional knowledge from QBER. Enter a hypothetical bound between zero and the retained length. A zero-bit result is valid; extracted bits are not used as an AES-256 key here.
Teaching model, not a finite-key QKD proof. The budget illustrates the two-universal-hashing result of Renner and König (TCC 2005); see the Quantum Entropy extractor lab.
WHEN ARE BASES ANNOUNCED?
Choose a message order. Eve is assumed to control delivery, store each qubit until Alice's basis announcement when permitted, and forward a replacement before Bob measures. This is an idealized, classical simulation of a particular attack, not a general QKD security claim.
The receipt/measurement ordering is explained in Vidick and Wehner, Introduction to Quantum Cryptography, §8.1.2 (2023).