Overview

This project bridges the gap between Quantum Mechanics and Cybersecurity by providing a comprehensive simulation of the BB84 Protocol (Bennett & Brassard, 1984).

It demonstrates how two parties (Alice and Bob) can securely establish a shared cryptographic key over an untrusted quantum channel, relying on the fundamental laws of physics—specifically the No-Cloning Theorem and Measurement Disturbance.

This project reflects my focus on applying quantum computing principles to real-world cybersecurity challenges, using Qiskit to model realistic qubit behavior rather than classical approximations.


Problem

Traditional cryptographic key exchange methods (such as Diffie-Hellman and RSA) rely on computational complexity assumptions, which are expected to become vulnerable with the advancement of large-scale quantum computers through algorithms such as Shor’s Algorithm.

Meanwhile, practical experimentation with Quantum Key Distribution (QKD) typically requires specialized and expensive optical hardware. This creates a barrier for security researchers and students who wish to study quantum-safe communication protocols and adversarial models.

There is a strong need for accessible, software-defined environments to analyze attack vectors, evaluate security thresholds, and validate theoretical predictions under controlled conditions.


Solution

This project implements a modular, Object-Oriented simulation of a quantum communication network based on the BB84 protocol.

The system consists of the following components:

  1. Quantum State Preparation
    Alice generates random classical bits and encodes them into qubits using randomly selected rectilinear (+) and diagonal (×) bases through Hadamard and Pauli-X gates.

  2. Quantum Channel Simulation
    A configurable quantum channel is modeled to transmit qubits while optionally allowing interception and measurement.

  3. Adversary Model (Eve)
    An eavesdropper module performs intercept-resend attacks by measuring qubits in random bases and re-encoding them before forwarding, introducing detectable disturbances.

  4. Classical Post-Processing
    After transmission, Alice and Bob perform basis reconciliation, key sifting, and Quantum Bit Error Rate (QBER) analysis to determine channel integrity.

Comparative analysis is performed between ideal (no attacker) and adversarial scenarios to validate protocol robustness.


Technologies

  • Core Logic: Python 3.x using Object-Oriented Design principles.
  • Quantum Framework: Qiskit (IBM Quantum) for circuit construction and execution.
  • Numerical Analysis: NumPy for statistical processing of measurement results.
  • Visualization: Matplotlib for plotting QBER thresholds and key generation efficiency.
  • Testing: PyTest for validation of protocol components and correctness checks.

Key Features

  • Complete BB84 Lifecycle: Simulates qubit generation, transmission, measurement, and key reconciliation.
  • Configurable Attack Simulation: Enables or disables adversarial interception to demonstrate protocol vulnerability.
  • Security Monitoring: Real-time QBER computation to trigger automatic protocol termination when compromise is detected.
  • Dynamic Circuit Visualization: Automatically generates and displays quantum circuits used during transmission.
  • Extensible Architecture: Modular design allows easy integration of additional attack models and noise channels.

Results

  • Security Validation: Intercept-resend attacks consistently produced a ~25% QBER, matching theoretical predictions and triggering secure abort procedures.

  • Key Exchange Efficiency: A stable sifted key generation rate of approximately 50% was achieved in noise-free environments due to basis mismatch.

  • Experimental Analysis: Multiple simulations were conducted under varying interception and noise conditions to evaluate protocol resilience.

  • Educational Insight: The system effectively visualizes quantum state collapse when measurements are performed in incompatible bases.


Project Structure


project/  
│  
├── main.py  
├── alice.py  
├── bob.py  
├── eve.py  
├── channel.py  
├── analysis.py  
├── utils.py  
└── tests/

Limitations

  • Assumes an idealized quantum channel without environmental decoherence.
  • Does not currently implement privacy amplification or classical authentication.
  • Focuses on intercept-resend attacks and does not model advanced collective attacks.
  • Simulation-based environment without direct hardware backend integration.

Future Work

  • Integration of realistic noise and decoherence models.
  • Implementation of privacy amplification and error correction.
  • Support for IBM Quantum hardware backends.
  • Development of a web-based visualization dashboard.
  • Expansion to other QKD protocols (E91, B92).

Learning Outcomes

Through this project, I developed:

  • Practical expertise in quantum cryptographic protocol implementation.
  • Strong understanding of quantum measurement and entanglement effects.
  • Experience in adversarial system modeling.
  • Advanced proficiency in Qiskit circuit design.
  • Insight into post-quantum security engineering.

References

  • Bennett, C. H., & Brassard, G. (1984). Quantum Cryptography: Public Key Distribution and Coin Tossing.
  • Nielsen, M. A., & Chuang, I. L. (2010). Quantum Computation and Quantum Information.
  • Qiskit Documentation (IBM Quantum).