HomeCybersecurityBB84 Photon-by-Photon Key Sifting (2D)

BB84 Photon-by-Photon Key Sifting (2D)

2D companion to the BB84 secure key rate simulator: instead of an analytical formula, this runs a real photon-by-photon Monte Carlo protocol — Alice's random bit and basis, Malus's-law polarization measurement at Bob (and at an eavesdropping Eve), public sifting and error checking — and the empirical QBER and key rate converge live to the closed-form theory.

Cybersecurity2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-quantum-cryptography-bb84 ↗ Open standalone

This is the 2D companion to the 3D BB84 secure key rate simulator. Rather than evaluating a closed-form gain/QBER/rate formula, it runs the actual quantum key distribution protocol at the level of individual photons: Alice draws a random bit and basis for every simulated pulse, the fiber channel probabilistically absorbs or transmits it, and Bob (and, when switched on, an eavesdropping Eve performing a genuine intercept-resend attack) measures the surviving photons using real single-photon quantum measurement statistics — Malus's law, cos²(θ) — rather than any shortcut. Only pulses where Bob's randomly chosen basis happens to match Alice's are kept in the sifted key, and the empirical quantum bit error rate and secure key rate are computed directly from these simulated outcomes and shown converging live to the same closed-form theoretical curves the 3D model plots analytically. Distance, attenuation and mean photon number shrink the channel transmittance exactly as in classical fiber optics, and turning on Eve's attack reproduces the textbook 25% sifted-key error rate emergent from her random-basis interception — not asserted, but measured from the simulation.

⚙ Under the hood

Run the real BB84 protocol photon-by-photon: Alice's random bit and basis, Malus's-law polarization measurement at Bob and at an intercepting Eve, public sifting and error checking — watch the empirical QBER and key rate converge live to the 3D sim's closed-form theory.

Quantum CryptographyBB84QKDMonte CarloCybersecurityPhotonics

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)