Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BB84 Quantum Key Distribution (QKD) Simulator

A modular C++23 simulator modelling the BB84 quantum key distribution protocol to generate shared cryptographic keys under realistic conditions and adversary strategies.


Key Features

  • Optical Hardware Models:
    • End-to-End Key Generation: Simulates the complete 'QKD lifecycle' from quantum state generation and noisy fibre transmission to basis reconciliation and classical sifting, yielding concrete raw and sifted keys.
    • Source Models: Supports both ideal single photon sources and weak coherent pulses (WCP) governed by Poisson statistics.
    • Channel Physics: Models exponential fibre attenuation, single photon detector efficiency, optical misalignment error rates, and detector dark counts.
  • Adversary Strategies:
    • Implements dynamic intercept-resend eavesdropping strategies with optimal interception parameter calculation.

Project Directory Structure

bb84_sim/
├── Makefile
├── .gitignore
├── README.md
├── include/
│   ├── bb84.hpp          # Core quantum nodes, hardware configs, and state models
│   └── simulator.hpp     # End-to-end pipeline orchestration and metrics
├── src/
│   ├── bb84.cpp          # Implementation of quantum generation, transmission, and measurement
│   ├── simulator.cpp     # Simulation loop, sifting, and QBER evaluation
│   └── main.cpp          # CLI application and performance summary dashboard
└── tests/
    ├── doctest.h         # Single-header testing framework
    └── tests.cpp         # Automated physics baseline and determinism tests

Getting Started

Prerequisites

  • A modern C++23 compliant compiler (e.g., g++ version 13+ or equivalent).
  • make utility.

Building and Running

  • Compile everything and run the test suite:
make
  • Run the main simulation CLI binary:
make run
  • Clean up build artefacts:
make clean

Roadmap

This project is actively under development. Near-term milestones focus on introducing a Photon-Number-Splitting (PNS) attack module, decoy-state methods, classical post-processing pipelines (error correction and privacy amplification), and finite-key security analysis. Long-term objectives include extending the framework to support alternative QKD protocols and multi-hop quantum network simulations.

License

This project is open-source and is intended for academic use or learning purposes.

About

End-to-end C++23 BB84 quantum key distribution simulator for cryptographic key generation under realistic optical channel physics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages