Inspiration

The looming threat of quantum computers breaking our current encryption standards inspired this project. As quantum computing advances, algorithms like Shor's will soon be able to crack RSA and ECC encryption that protects our digital infrastructure. I wanted to create a practical demonstration of quantum-resistant cryptography using the BB84 protocol - the first quantum key distribution method that leverages quantum mechanics to create theoretically unbreakable encryption. By building this as a serverless application, I aimed to make quantum cryptography concepts more accessible while showcasing modern cloud architecture.

What it does

The Quantum Key Distribution Simulator implements a complete BB84 protocol simulation on AWS Lambda, allowing users to: Generate quantum-secure cryptographic keys with configurable parameters Detect potential eavesdropping through quantum bit error rate (QBER) analysis Encrypt and decrypt files using quantum-derived keys Monitor security metrics and receive alerts for potential breaches Visualize the entire quantum key exchange process through a React dashboard The system demonstrates the complete quantum key distribution workflow: Quantum bit generation with polarization states Basis reconciliation between parties Error detection and correction Privacy amplification to ensure security Secure key storage and management

How i built it

The project was built as a serverless application with several key components: Core QKD Simulator Lambda: Python implementation of the BB84 protocol with quantum bit generation, basis reconciliation, error detection, and privacy amplification. Eavesdropping Detection Lambda: Statistical analysis of quantum bit error rates to detect potential security breaches. Key Validator Lambda: Handles file encryption/decryption using quantum-derived keys. API Gateway: RESTful endpoints for interacting with the system. DynamoDB: Stores session data, security events, and encryption metadata. S3: Manages encrypted file storage and processing. CloudWatch & SNS: Provides monitoring, metrics, and security alerts. React Frontend: Visualizes the quantum key distribution process and security metrics. Terraform: Manages the complete infrastructure as code. The development followed a test-driven approach with comprehensive unit, integration, and performance tests using pytest, LocalStack for AWS simulation, and Docker for containerized testing.

Challenges i ran into

Building this project presented several significant challenges: Simulating Quantum Properties: Accurately modeling quantum phenomena like superposition and measurement on classical computers required creative approaches and statistical approximations. Error Correction Optimization: Implementing efficient error correction while maintaining security guarantees was particularly challenging. I had to balance error correction capability against potential information leakage. Cold Start Performance: Lambda cold starts initially caused unacceptable latency for key generation. This required optimization through provisioned concurrency, memory allocation tuning, and code optimization. Security Threat Modeling: Identifying and mitigating potential attack vectors in a quantum cryptographic system required extensive research and creative thinking. LocalStack Testing Complexity: Creating a reliable local testing environment that accurately simulated AWS services required complex configuration and initialization scripts.

Accomplishments that i'm proud of

Creating a system that effectively demonstrates quantum cryptography principles in an accessible way.

What i learned

This project provided deep insights into both quantum cryptography and AWS serverless architecture: Quantum Cryptography Principles: Gained thorough understanding of the BB84 protocol and the mathematical foundations of quantum key distribution. Serverless Best Practices: Learned to optimize Lambda functions, manage cold starts, and design event-driven architectures. Testing Strategies: Developed effective approaches for testing cloud-native applications using mocks, LocalStack, and containerization.

What's next

Probably testing additional QKD Protocols: Implementing E91 (entanglement-based) and SARG04 protocols for comparison and educational purposes. Machine Learning for Attack Detection: Using ML to identify sophisticated eavesdropping attempts beyond simple QBER analysis. Hardware Integration: Exploring integration with quantum random number generators (QRNGs) for true quantum randomness. Multi-Region Deployment: Implementing cross-region key distribution to simulate long-distance QKD networks. Enhanced Visualization: Expanding the React frontend to provide more detailed visualizations of quantum phenomena.

Built With

  • actions
  • aes-256-gcm
  • amazon
  • bandit
  • bb84
  • black
  • cloud
  • cloudformation
  • cloudwatch
  • docker
  • flake8
  • github
  • hmac-sha256
  • iam
  • kms
  • localstack
  • mypy
  • protocol
  • pytest
  • sns
  • terraform
  • x-ray
Share this project:

Updates