A covert channel embedded in the classical sifting phase of the BB84 Quantum Key Distribution protocol. The channel transmits hidden data by intentionally misreporting basis announcements, hiding the covert payload within the hardware's expected QBER noise floor.
Paper: Covert Channel via Error-Injection by Classical Misreporting in the BB84 Sifting Phase (link TBD)
This project extends an existing BB84 QKD simulation by Dhruv Bhatnagar with a covert channel implementation and statistical analysis tools.
- Python 3.10+
- NumPy
- SciPy
- Matplotlib
| File | Description |
|---|---|
qkd_bb84_base.py |
Core classes for Alice, Bob, quantum channel, and classical channel |
qkd_experiment_base.py |
Base experiment class with build, run, key generation, and validation phases |
qkd_bb84_noiseless.py |
Noiseless BB84 experiment driver |
qkd_noise_model.py |
Noisy channel and Hadamard gate failure models |
qkd_eavesdropping_2.py |
Intercept-resend eavesdropping simulation |
| File | Description |
|---|---|
covert_channel.py |
CovertStateMachine class — rolling trigger mechanism, dual PRNGs, keystream |
qkd_covert_alice.py |
Covert Alice subclass — basis misreporting with message preamble and padding |
qkd_covert_bob.py |
Covert Bob subclass — covert bit extraction and preamble parsing |
covert_experiment.py |
Noiseless covert channel experiment driver |
covert_noise_experiment.py |
Noisy covert channel experiment driver |
baseline_noise_experiment.py |
Baseline noisy experiment (no covert channel) for comparison |
statistical_analysis.py |
KS test analysis for QBER and inter-error distance detectability |
generate_figures.py |
Generates all paper figures from saved experimental data |
covert_test.py |
Unit test for CovertStateMachine synchronization |
| Directory | Description |
|---|---|
Data/ |
Saved NumPy arrays from 1000-trial experiments (.npy files) |
Figures/ |
Generated SVG and PNG figures for the paper |
python covert_experiment.pyThis transmits a 24-bit test message through the covert channel with trigger length k=7 and prints the recovered message.
python covert_noise_experiment.pySame as above but with 3% channel noise simulating depolarizing errors.
python statistical_analysis.py <k>where <k> is the trigger length (e.g., 7, 8, 9, 10). Runs 1000 baseline and 1000 covert trials, performs KS tests on QBER and inter-error distance distributions, and saves results to .npy files.
python generate_figures.pyLoads saved data from Data/ and generates all paper figures to Figures/.
| Parameter | Description | Default |
|---|---|---|
s_length |
Number of qubits per session | 65,536 |
trigger_length (k) |
Length of trigger sequence | 7 |
noise_error_rate |
Channel depolarizing error rate | 0.03 |
PSK |
Pre-Shared Key (string) | "topsecret" |
The base BB84 simulation is by Dhruv Bhatnagar. The covert channel extension is by Albert Snyder.