BB84 Protocol Overview
BB84 is the world's first quantum key distribution algorithm, proposed by Charles Bennett and Gilles Brassard in 1984.
Alice generates a random sequence of bits (0 and 1) and randomly chooses a measurement basis for each bit:
- Rectilinear basis: 0° (vertical polarization) for 0, 90° (horizontal) for 1
- Diagonal basis: 45° for 0, 135° for 1
In the game: you choose the polarization manually or use automatic sending.
Alice sends each photon (qubit) to Bob over the quantum channel. Quantum states cannot be copied (the no-cloning theorem).
In the game: the photon travels over the quantum channel from Alice to Bob.
For each incoming photon, Bob randomly chooses a measurement basis (rectilinear or diagonal) and measures the photon in that basis.
In the game: Bob automatically picks a random basis and shows the measurement result.
After sending all the photons, Alice and Bob use the classical (ordinary) channel to tell each other which basis they used for each bit — but not the bit values.
In the game: clicking "Sift key" activates the classical channel to exchange basis information.
Alice and Bob keep only the bits for which the bases matched (about 50% of everything sent). The rest are discarded.
In the game: a raw key is built from the matching measurements.
In the real protocol, Alice and Bob compare part of the remaining bits (which are then discarded). If Eve was eavesdropping, she introduced errors that are detected during the comparison.
In the game: 30 random bits of the sifted key are compared publicly to estimate the QBER. The “Eve” switch shows how eavesdropping raises the error rate.
If the error rate is below a certain threshold, the remaining bits form the secret key. Otherwise the key is discarded and the process repeats.
In the game: if QBER < 11%, the remaining bits go through error correction and are compressed (XOR) into an 8-bit key; if QBER ≥ 11%, the key is discarded.
Protocol security: BB84's security rests on fundamental principles of quantum mechanics — any attempt to measure a quantum state disturbs it, which makes eavesdropping detectable.
1 / 4 — Квантовый канал
Stage 1: Quantum channel
Alice chooses a random polarization for each qubit and sends it to Bob. Bob independently picks a random measurement basis for each qubit. You control Alice's sending through the control panel.
What is simplified: channel noise is a fixed ~2%; Eve uses the simplest intercept-resend attack; error correction and privacy amplification are shown schematically (real systems use protocols like Cascade or LDPC plus universal hashing, with keys thousands of bits long). The 11% QBER threshold is the well-known BB84 security bound.