An interactive web-based simulation of Quantum Key Distribution (QKD) with a novel twist—Hexadecimal Quantum Cryptography. This project visualizes how quantum mechanics can be used to establish secure communication channels, complete with detection of eavesdropping attempts.
This React-based application demonstrates quantum cryptography principles through an engaging 3D visualization powered by Three.js. Instead of traditional binary quantum cryptography, this project explores a hexadecimal variant that theoretically increases data transmission efficiency by encoding 16 possible values (0-F) per symbol instead of just 2 (0-1).
Key Scenario: Watch Alice and Bob securely exchange cryptographic keys while Eve attempts to eavesdrop—and discover how the system detects her interference in real-time.
- Interactive 3D Visualization: Three.js-powered scenes showing the quantum key exchange process
- Alice-Bob-Eve Scenario: Classic cryptographic scenario with real-time detection of eavesdropping
- Quantum Key Distribution (QKD) Simulation: Demonstrates basis selection and key agreement protocols
- Manual Hexadecimal Encryption: Custom encryption algorithm (no external crypto libraries) operating in hexadecimal
- True Random Number Generator (TRNG): Purpose-built hexadecimal random value generator
- Live Logging: Track the entire key exchange process with detailed logs
- Interactive Controls: Start/stop encryption, toggle eavesdropping detection, visualize quantum states
- React 19 - Component-based UI framework
- TypeScript - Type-safe development
- Three.js - 3D graphics and visualization
- TailwindCSS - Utility-first styling
- Material-UI - Component library
- Manual Quantum Cryptography - Custom implementation without external crypto libraries
- Hexadecimal Encoding - Alternative to traditional binary quantum protocols
- TRNG (True Random Number Generator) - Custom random value generation
- Node.js (v16 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/IkkeYannick/The-Small-Lab.git
cd The-Small-Lab- Install dependencies:
npm install- Start the development server:
npm start- Open your browser and navigate to
http://localhost:3000
npm run buildThis creates an optimized production build in the build/ directory.
Quantum cryptography uses fundamental principles of quantum mechanics to ensure communication security:
- Basis Selection: Alice and Bob randomly choose measurement bases (rectilinear
+or diagonal×) - Entangled Photons: Quantum-entangled photons are used to transmit information
- Secure Key Agreement: Only matching basis selections contribute to the final shared key
- Eavesdropper Detection: Eve's measurement attempts introduce detectable errors
Instead of binary (0-1), this project uses hexadecimal values (0-F):
- Traditional approach: 1 bit per photon → 2 possible values
- Hexadecimal approach: 4 bits per symbol → 16 possible values
This theoretical enhancement increases data transmission efficiency while maintaining quantum security principles.
A custom implementation that generates cryptographically useful random hexadecimal values:
export function HexadecimalTrueRandomNumberGeneration(): string {
const seed = Math.random();
const random = Math.sin(seed) * 16;
return Math.abs(Math.floor(random)).toString(16);
}Note: While not a true quantum RNG (which costs ~€1000+), this implementation provides sufficient entropy for simulation purposes.
- Start the Simulation: Click the start button to begin the quantum key exchange
- Toggle Eavesdropping: Enable Eve's eavesdropping attempt to see how the system detects interference
- Monitor the Process: Watch the 3D visualization and live logs showing:
- Basis selections by Alice and Bob
- Photon measurements
- Key agreement results
- Error detection (if eavesdropping is detected)
- View Results: Check the live logs for detailed information about each step
This project is designed as an educational tool to understand:
- Quantum Key Distribution (QKD) principles
- Quantum entanglement and superposition
- Eavesdropping detection mechanisms
- Custom encryption implementations
- 3D visualization with Three.js
npm start- Run development servernpm test- Run tests
The project uses TypeScript for type safety and follows React best practices with functional components and hooks.
This project demonstrates:
- How quantum mechanics provides unbreakable encryption
- Custom implementation of cryptographic systems
- Interactive 3D visualization of complex concepts
- Integration of multiple cutting-edge technologies
- Innovation in traditional quantum cryptography (hexadecimal approach)
Built by Yannick Vandenbulcke