Home Page - Quantum-themed landing |
3D Simulation - Interactive photon visualization |
Theory - Educational content |
Analytics - Real-time charts & metrics |
Experience quantum cryptography like never before - Watch individual photons travel through space in real-time 3D as they establish an unbreakable secret key!
BB84 Quantum Key Distribution Simulator is a cutting-edge web application that brings quantum mechanics to life. Built with React, Three.js, and modern web technologies, it provides an immersive 3D visualization of the groundbreaking BB84 protocol invented by Charles Bennett and Gilles Brassard in 1984.
Traditional encryption can be broken with enough computing power. Quantum Key Distribution uses the laws of physics themselves to guarantee security - making it future-proof against even quantum computers!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ "Any observation of a quantum system disturbs its state" โ
โ - The principle that makes BB84 unbreakable โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
|
|
- ๐ Animated starfield background with colorful particles
- ๐จ Quantum gradient color scheme (Blue โ Purple)
- โจ Glow effects on interactive elements
- ๐ญ Smooth transitions and animations
- ๐ฑ Fully responsive design for all devices
- ๐ Dark theme optimized for long viewing
- ๐ฏ Intuitive controls with tooltips
- ๐ฌ Built-in AI chatbot for instant help
Choose one of the following:
- Node.js 18+ with npm/yarn/bun
- Docker (no Node.js required)
# Clone the repository
git clone https://github.com/PRODHOSH/bb84_simulation.git
cd bb84_simulation
# Install dependencies
npm install
# Start development server
npm run dev# Clone the repository
git clone https://github.com/PRODHOSH/bb84_simulation.git
cd bb84_simulation
# Build and run with Docker
docker build -t bb84-simulation .
docker run -p 3000:80 bb84-simulation
# Access at http://localhost:3000# Node.js
npm run build
npm run preview
# Or with Docker
docker build -t bb84-simulation .
docker run -d -p 3000:80 bb84-simulationFor easier container management, create a docker-compose.yml:
version: '3.8'
services:
bb84-simulator:
build: .
ports:
- "3000:80"
restart: unless-stoppedThen run:
docker-compose up -d| Stage | Base Image | Purpose |
|---|---|---|
| Builder | node:20-alpine |
Install deps, build app |
| Production | nginx:alpine |
Serve static files |
Final Image Size: ~50MB (optimized Alpine images)
-
โ๏ธ Set Parameters
- Adjust photon count using the slider (8-32)
- Toggle Eve to simulate eavesdropping
-
โถ๏ธ Run Simulation- Click "Run Simulation" button
- Watch photons travel in 3D space
-
๐ Observe
- Green photons = Matching bases (kept)
- Red photons = Different bases (discarded)
- See polarization states in real-time
-
๐ Analyze Results
- View secret key generated
- Check error rates
- Explore analytics dashboard
graph TB
A[๐ฒ Alice: Generate Random Bits] --> B[๐ก Alice: Choose Random Bases]
B --> C[๐ Alice: Encode Photons]
C --> D{๐๏ธ Eve Intercepts?}
D -->|Yes| E[โ ๏ธ Eve: Measures & Disturbs]
D -->|No| F[โ
Clean Transmission]
E --> G[๐ฌ Bob: Receives Photons]
F --> G
G --> H[๐ Bob: Random Measurement]
H --> I[๐ข Public Basis Comparison]
I --> J[๐ Keep Matching Bases]
J --> K[๐ Error Rate Check]
K --> L{QBER > 25%?}
L -->|Yes| M[โ Abort - Eve Detected]
L -->|No| N[โ
Secure Key Ready!]
style A fill:#286EFF
style N fill:#00FF88
style M fill:#FF4444
style D fill:#AA50FF
| Basis | State | Symbol | Bit Value |
|---|---|---|---|
| Rectilinear (+) | Vertical | | | 0 |
| Rectilinear (+) | Horizontal | โ | 1 |
| Diagonal (ร) | Diagonal | / | 0 |
| Diagonal (ร) | Anti-diagonal | \ | 1 |
No-Cloning Theorem + Heisenberg Uncertainty = Unbreakable Security โจ
| Category | Technologies |
|---|---|
| Frontend | React 18, TypeScript 5, Vite 5 |
| 3D Graphics | Three.js, React Three Fiber, React Three Drei |
| Styling | Tailwind CSS, Shadcn/ui, Radix UI |
| State | React Context, TanStack Query |
| Backend | Supabase (PostgreSQL, Auth) |
| Charts | Recharts |
| Routing | React Router v6 |
| Deployment | Docker, Nginx, Vercel |
Perfect for:
- ๐ Students learning quantum cryptography
- ๐จโ๐ซ Educators teaching quantum mechanics
- ๐ฌ Researchers demonstrating QKD concepts
- ๐ผ Professionals exploring post-quantum security
- ๐ Enthusiasts fascinated by quantum physics
- ๐ Original BB84 Paper
- ๐ Wikipedia: Quantum Key Distribution
- โ๏ธ IBM Quantum Computing
- ๐ต Google Quantum AI
bb84_simulation/
โโโ src/
โ โโโ components/
โ โ โโโ simulation/
โ โ โ โโโ PhotonScene.tsx # 3D visualization
โ โ โ โโโ PhotonParticle.tsx # Individual photon
โ โ โ โโโ KeyResults.tsx # Results display
โ โ โ โโโ AnalyticsDashboard.tsx
โ โ โโโ ui/ # Reusable UI components
โ โโโ contexts/
โ โ โโโ SimulationContext.tsx # State management
โ โโโ hooks/
โ โ โโโ useBB84Simulation.ts # Core BB84 logic
โ โโโ pages/
โ โ โโโ Home.tsx
โ โ โโโ Theory.tsx
โ โ โโโ Simulation.tsx
โ โ โโโ NotFound.tsx
โ โโโ lib/
โ โโโ utils.ts
โโโ public/
โ โโโ team.html # Team page
โ โโโ images/
โโโ ...config files
VIT University Engineering Physics Project
๐ง Joshwa - Hardware Engineer
๐ป Prodhosh - Full-Stack Developer
๐ Raghav - Documentation Lead
๐ Sachin - Presentation Specialist
๐ Sudhir - Presentation Specialist
๐ Vijay Nishal - Documentation Lead
โ
Industry-Grade Code - Production-ready React/TypeScript
โ
Real Physics - Accurate quantum mechanics simulation
โ
3D Graphics - Smooth 60fps rendering with Three.js
โ
Interactive Learning - Hands-on quantum education
โ
Modern Stack - Latest web technologies
โ
Open Source - Free for educational use
โ
AI Chatbot - Instant help and explanations
โ
Responsive Design - Works on all devices
- VR Support for immersive quantum experience
- E91 Protocol (entanglement-based QKD)
- Bloch Sphere visualization
- Noise Models for realistic channels
- Performance Metrics comparison
- Multi-language support
- Tutorial Mode with guided tours
- Advanced Analytics with ML predictions
Contributions make the open-source community amazing! Any contributions are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.





