Alice → Bob
pulse clicks in green · dark counts in orange
Surviving photon Absorbed in fiber Intercepted by Eve
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

BB84 Secure Key Rate vs. Channel Distance

BB84 quantum key distribution promises unconditional security against eavesdropping, but its practical range is set by ordinary fiber-optic physics: every kilometre of glass absorbs photons exponentially, and every lost photon is a bit of key that never arrives. This simulator renders the Alice-to-Bob fiber channel in 3D — single-photon pulses launched toward Bob's detector, each one probabilistically absorbed according to the fiber's attenuation law — and turns the resulting click statistics into a live secure-key-rate calculation using the standard gain/QBER/binary-entropy formulas from quantum cryptography. Drag the distance and attenuation sliders to watch the key rate collapse toward zero as loss dominates, tune the mean photon number to see the dark-count floor bite at low brightness, and switch on an intercept-resend eavesdropper to watch the quantum bit error rate spike past the ≈11% threshold where BB84 itself refuses to produce a key — the same signature that makes the protocol detectably secure in the real world.