Skip to main content

Module bb84

Module bb84 

Source
Expand description

BB84 Quantum Key Distribution protocol simulation.

Implements the Bennett-Brassard 1984 (BB84) QKD protocol with:

  • Alice’s qubit preparation in rectilinear (Z) and diagonal (X) bases
  • Optional eavesdropping by Eve (intercept-resend attack)
  • Depolarizing channel noise
  • Bob’s measurement in random basis
  • Sifting: retain bits where Alice and Bob chose the same basis
  • Quantum bit error rate (QBER) estimation from a sample
  • Privacy amplification via XOR hashing to half the sifted key length
  • Eavesdrop detection: qber > 0.10

Structs§

Bb84Protocol
BB84 Quantum Key Distribution protocol.
Bb84Result
Result of running the BB84 protocol.