QKD-BB84 Protocol

1. Introduction

This document describes the BB84 quantum key distribution (QKD) protocol as implemented in the QKD-BB84 simulator within the AnuQrana platform (Protocols module). It covers the protocol’s theoretical basis, the two interface views (Map View and Component View), every configurable panel and field exactly as they appear in the interface, the supported eavesdropping strategies, and the procedure for configuring, running, and recording a simulation trial.

2. Protocol Overview

BB84 lets two parties, Alice and Bob, establish a shared secret key by transmitting and measuring single photons encoded in polarization.

Alice encodes each bit onto one of two randomly selected polarization bases:

  • Rectilinear basis (Z-basis): horizontal (0 deg) and vertical (90 deg) polarization, corresponding to bit values 0 and 1.

  • Diagonal basis (X-basis): 45 deg and 135 deg polarization, corresponding to bit values 0 and 1.

Bob measures each photon using an independently, randomly selected basis. Afterward, Alice and Bob compare bases over the classical channel and keep only the results where both bases matched (sifting). A sample of the sifted bits is disclosed to estimate the quantum bit error rate (QBER). If QBER is below the configured threshold, the remaining sifted bits form the final secure key; otherwise the key is discarded, as an elevated error rate is presumed to indicate eavesdropping.

3. Interface Overview

Opening Protocols -> QKD-BB84 loads the simulator screen, shown in two selectable views at the top of the right-hand configuration panel:

  • Map View – displays a geographic map (OpenStreetMap/Leaflet) for selecting the physical locations of Alice and Bob, alongside a Select Location panel with dropdowns for Alice and Bob.

  • Component View – displays the optical block diagram: Alice’s transmitter block on the left, Bob’s receiver block on the right, connected by a Quantum Channel (solid arrow) and a Classical Channel (dashed arrow).

A red RUN > button in the top-right corner executes the simulation using the currently configured parameters. In both views, the right-hand panel contains four collapsible sections: Alice, Bob, Channel, and Input Parameters.

../_images/BB84_Map_View.png

(a) Map View

../_images/BB84_Component_View.png

(b) Component View

Map View, showing Alice and Bob pinned to selected locations (CDAC KP, Bengaluru and IIT Madras) with the Quantum + Classical Channel route drawn between them; and Component View, showing the Alice and Bob optical blocks connected by the Quantum and Classical Channels, with the Alice panel expanded to the Light Source sub-panel.

3.1 Component View – Optical Layout

In Component View, Alice’s block shows two source symbols feeding a polarizing element and a wave-plate element into a beam splitter, followed by an attenuator (grey bars) and an emitter symbol, before the pulse crosses the quantum channel to Bob. Bob’s block mirrors this with a beam splitter that routes the incoming photon to one of two measurement arms, each ending in polarizing elements and detectors labeled D1, D2, D3, and D4.

4. Alice Panel

Expanding Alice reveals the Light Source sub-panel with the following fields:

Field

Description

Default

Frequency (Hz)

Pulse repetition rate – the number of photon pulses transmitted per second.

80000000

Mean Photon Number

Average photon occupation per pulse, kept low so multi-photon pulses are rare, consistent with the weak-coherent-state regime.

0.1

5. Bob Panel

Expanding Bob reveals two tabs: Detector and Beam Splitter.

5.1 Detector Tab

This tab has two sub-tabs, Detector D1 & D2 (X-basis arm) and Detector D3 & D4 (Z-basis arm), each exposing the same four fields, set independently per detector pair:

Field

Description

Default

Efficiency (slider, 0-1)

Fraction of incident photons that produce a registered detection event; 1 = ideal, lossless detector.

1

Dark Count (/s)

Rate of spurious detection events with no incident photon; 0 = no false-positive events.

0

Time Resolution (ns)

Minimum time interval over which the detector can distinguish two separate detection events.

150

Max Count Rate (/s)

Highest detection rate the detector can register before dead-time/saturation effects degrade performance.

25000000

5.2 Beam Splitter Tab

Configures the fidelity of Bob’s entrance beam splitter, which performs the passive, unbiased basis selection at the hardware level (the same Beam Splitter Fidelity concept described in Section 6.3).

6. Channel Panel

Expanding Channel reveals two tabs: Quantum Channel and Classical Channel.

6.1 Quantum Channel Tab

Channel Type is chosen with a radio button: Optical Fiber or Free Space. Only one is active per simulation run.

Optical Fiber fields:

Field

Description

Default

Length (km)

Physical distance between Alice and Bob.

100

Attenuation (dB/m)

Signal power loss per unit length of fiber.

0.00001

Light Speed (m/s)

Propagation speed of light within the fiber, lower than the vacuum speed of light.

200000000

Polarization Fidelity (slider, 0-1)

Degree to which the fiber preserves the transmitted polarization state; lower values mean more polarization drift and additional error.

0.9

Free Space fields (shown instead when this channel type is selected):

Field

Description

Length (km)

Physical distance between Alice and Bob.

Total Loss (dB)

Aggregate signal attenuation over the link.

6.2 Classical Channel Tab

Field

Description

Classical Channel Length (m)

Length of the conventional, non-quantum link used for basis reconciliation and error estimation.

6.3 Beam Splitter Fidelity

Referenced from the Bob panel (Section 5.2): degree to which the entrance beam splitter approximates an ideal, unbiased 50:50 splitting ratio.

7. Input Parameters Panel

Expanding Input Parameters reveals the protocol-level run settings:

Field

Description

Default

No. of Keys

Number of independent keys generated during the run.

3

Key Size

Length of each final secure key, selectable from a dropdown: 128, 256, 512, or 1024 bits.

128

Threshold (%)

Maximum QBER tolerated before a key is rejected as insecure.

11

QBER (%)

Simulated quantum bit error rate applied for the run.

30

Eavesdropper

Radio toggle: Without or With.

Without

Eavesdropping Strategy (shown only when Eavesdropper = With)

Intercept-and-Resend or Photon Number Splitting.

–

Fraction of Qubits Eve Wants to Measure (shown only when Eavesdropper = With)

Slider from 0 to 1 controlling what proportion of transmitted qubits Eve intercepts.

–

Simulation Time (ms)

Slider setting the total duration of the simulated run.

80

8. Map View

Switching to Map View replaces the optical block diagram with an interactive map (zoom controls and a layer-selector icon top-left). The right-hand panel adds a Select Location section above Alice/Bob/Channel/Input Parameters, containing two dropdowns:

Field

Description

Alice

Select Alice’s geographic location from the dropdown, referenced on the map.

Bob

Select Bob’s geographic location from the dropdown, referenced on the map.

The Alice, Bob, Channel, and Input Parameters sections below remain identical in content to Component View – only the diagram at left changes from the optical layout to the map (see Figure (a) in Section 3).

9. Eavesdropping Strategies

Setting Eavesdropper to With in the Input Parameters panel unlocks the Eavesdropping Strategy selector, offering two attack models:

9.1 Intercept-and-Resend Attack

Eve intercepts each transmitted photon, measures it in a randomly chosen basis, and forwards a newly prepared photon in the state corresponding to her measurement outcome. When her basis matches Alice’s, no error is introduced; when it doesn’t, Bob’s subsequent measurement in Alice’s original basis is correct only half the time. This gives:

P(error) = P(basis mismatch) x 0.5 = 0.5 x 0.5 = 0.25

A full attack on every photon raises QBER by roughly 25%, well above a typical 11% threshold, making this strategy readily detectable through QBER monitoring alone.

9.2 Photon Number Splitting (PNS) Attack

This strategy exploits the fact that Alice’s weak coherent source occasionally emits pulses with two or more photons (Poisson-distributed, with mean photon number mu = 0.1 giving P(n>=2) ~ 0.0048). Eve performs a quantum non-demolition measurement of photon number; when a pulse has two or more photons, she retains one and lets the rest pass to Bob undisturbed, later measuring her retained photon once the correct basis is disclosed during sifting. Because Bob’s photon is never disturbed, this attack does not raise the measured QBER and is not detectable through QBER monitoring alone – countermeasures such as decoy-state protocols are required.

9.3 Fraction of Qubits Eve Wants to Measure

This field scales attack intensity. For Intercept-and-Resend:

QBER = QBER_channel + f x 0.25

where f is the configured fraction. Reducing f lowers the detectable QBER increase while proportionally reducing Eve’s information gain. For PNS, the measured QBER stays at the channel baseline regardless of f; reducing f mainly limits the number of key bits Eve recovers rather than affecting detectability.

10. Running a Simulation

  1. Open Protocols and select QKD-BB84.

  2. Choose Map View or Component View using the radio buttons at the top of the panel.

  3. Expand Alice, Bob, and Channel to configure parameters as described in Sections 4-6, or leave the near-ideal defaults in place.

  4. Expand Input Parameters and set the protocol-level fields described in Section 7.

  5. If modeling an attack, set Eavesdropper to With and configure the strategy and fraction as described in Section 9.

  6. Click RUN >.

11. Suggested Experimental Procedure

11.1 Baseline Trial (No Eavesdropper)

Leave Eavesdropper set to Without and click RUN. Record photons transmitted, total detector clicks (D1-D4), sifted key length, measured QBER, and pass/fail relative to the configured Threshold.

11.2 Eavesdropping Trials

Set Eavesdropper to With, choose Intercept-and-Resend, click RUN, and record the same metrics. Repeat with Photon Number Splitting selected.

11.3 Comparison and Conclusions

Compare measured QBER across the three trials (No Eavesdropper, Intercept-and-Resend, Photon Number Splitting), determine acceptance/rejection against the 11% threshold for each, and identify which strategy evades detection through QBER monitoring alone. Repeat across all configured keys (No. of Keys) to check consistency.

11.4 Expected Outcomes

  • No Eavesdropper: QBER stays low, limited mainly by channel imperfections such as Polarization Fidelity (default 0.9); the key is accepted.

  • Intercept-and-Resend: QBER rises substantially, typically exceeding the 11% threshold, causing key rejection – demonstrating BB84’s core security property.

  • Photon Number Splitting: QBER remains close to the no-eavesdropper baseline despite Eve acquiring key information – illustrating the limits of QBER monitoring alone.

12. Results

Each RUN produces the following output metrics, recorded per trial:

Quantity

No Eavesdropper

Intercept-and-Resend

Photon Number Splitting

Photons Transmitted

Detector Clicks (D1-D4)

Sifted Key Length (bits)

Measured QBER (%)

Threshold (%)

11

11

11

Key Accepted? (Y/N)

Final Secure Key Length (bits)

12.1 Interpretation of Results

  • Key Accepted: measured QBER is below the configured Threshold. Sifting and error correction proceed, and a final secure key of the configured Key Size is produced.

  • Key Rejected: measured QBER is at or above the Threshold. Alice and Bob abort, presuming an excessively noisy channel or the presence of an eavesdropper, and no key is produced from the trial.