BB84 Messaging App / Application de messagerie BB84

English

Inspiration

This project was inspired by a fundamental idea in quantum mechanics:

Observing information can change it.

In classical communication, messages can be copied without detection. However, in quantum systems, measurement disturbs the state. This makes it possible to detect eavesdropping.

We were inspired by the elegance of the BB84 protocol and wanted to make it interactive and understandable.

What it does

This project is a browser-based simulation of quantum key distribution (BB84) combined with encrypted messaging.

It allows two users to:

  • Generate a shared secret key using BB84
  • Detect eavesdropping using QBER (Quantum Bit Error Rate)
  • Communicate securely using AES-GCM encryption
  • Visualize the protocol through transcripts and animations

How we built it

The application uses:

  • Node.js + Express (backend)
  • Socket.IO (real-time communication)
  • Web Crypto API (encryption)
  • HTML/CSS/JS frontend
  • PWA support for mobile

Pipeline:

  1. Alice generates random bits and bases
  2. Qubits are simulated and sent
  3. Eve may intercept
  4. Bob measures randomly
  5. Matching bases are kept
  6. Sample is revealed for QBER
  7. Key is derived
  8. Messages are encrypted

Challenges we ran into

  • Synchronization issues between users
  • BB84 flow bugs
  • Real-time state consistency
  • Visualizing abstract quantum concepts
  • Mobile responsiveness
  • Balancing accuracy vs simplicity

Accomplishments that we're proud of

  • Fully working BB84 simulation
  • Real-time QBER detection
  • Integrated encryption pipeline
  • Interactive visualizations
  • Mobile-compatible PWA

What we learned

  • Security can come from physics
  • Visualization improves understanding
  • Real-time systems are complex
  • Theory must be simplified for implementation

QBER = errors / tested bits

What's next for BB84 Messaging App

  • Error correction
  • Privacy amplification
  • Bloch sphere visualization
  • More quantum protocols
  • Persistent message storage
  • Permanent deployment

Français

Inspiration

Ce projet est inspiré par l’idée que l’observation peut modifier l’information.

En mécanique quantique, la mesure perturbe l’état, ce qui permet de détecter un espion.

Ce que fait le projet

Simulation du protocole BB84 avec messagerie chiffrée.

Fonctionnalités:

  • Génération de clé
  • Détection d’espionnage (QBER)
  • Communication sécurisée
  • Visualisation du protocole

Comment nous l’avons construit

  • Node.js + Express
  • Socket.IO
  • Web Crypto API
  • Frontend web
  • PWA mobile

Pipeline:

  1. Alice génère bits/bases
  2. Transmission
  3. Eve peut intercepter
  4. Bob mesure
  5. Sifting
  6. QBER
  7. Clé finale
  8. Chiffrement

Défis rencontrés

  • Synchronisation
  • Bugs BB84
  • Temps réel
  • Visualisation
  • Mobile
  • Simplicité vs précision

Accomplissements

  • Simulation BB84 fonctionnelle
  • Détection QBER
  • Messagerie chiffrée
  • Visualisations
  • Support mobile

Ce que nous avons appris

  • Sécurité basée sur la physique
  • Importance de la visualisation
  • Complexité des systèmes distribués

Prochaines étapes

  • Correction d’erreurs
  • Amplification de confidentialité
  • Visualisation avancée
  • Déploiement permanent ## Demo & Visualizations

BB84 Encrypted Chat Interface

BB84 UI

Main interface showing session controls, BB84 pipeline, and encrypted chat.


Per-Qubit BB84 Transcript

BB84 Transcript

Detailed breakdown of each qubit: Alice → Eve → Bob, with basis comparison and key decisions.


Protocol Stage Overview

Protocol Pipeline

Shows raw qubits, sifted bits, disclosed samples, and final key derivation.


Basis Agreement Heatmap

Heatmap

Green = kept bits, Gray = discarded, Purple = test bits, Red = errors.


Photon Polarization Replay

Photon Replay

Visualization of quantum states traveling from Alice → Eve → Bob.


System Architecture

Architecture

Simplified architecture showing frontend, backend, and quantum simulation pipeline.


Mobile / PWA Experience

Mobile UI

Responsive design with full-screen quantum viewer and touch-friendly controls.

Share this project:

Updates