BB84 Quantum Messenger
An educational realtime messaging prototype built with Flask, Socket.IO, and SQLAlchemy. Supports private and group chats, media sharing, read receipts, presence, and a simulated BB84/eavesdropping demonstration for exploring messaging and protocol behavior.
Problem and audience
This project gives students a way to explore messaging and key exchange concepts. The portfolio’s Alice, Bob and Eve walkthrough illustrates which rounds survive basis comparison and how interception affects the measured error rate.
Architecture and tradeoffs
This map follows the actual Flask chat server, Socket.IO events, SQLAlchemy message store, and in-memory pair-key state in the repository.
- Flask + Socket.IO
- A Flask server serves the client and handles login, account, uploads, admin, and Socket.IO chat events using eventlet. It tracks online socket IDs in process memory.
- SQLAlchemy database
- SQLAlchemy models persist users, groups/memberships, messages, reactions, calls, invitations, and device sessions. The app selects a configured database URL or uses its local fallback.
The messaging app and the portfolio simulation are separate demonstrations. The Flask app maintains shared state for chat sessions. The browser simulation focuses on showing the protocol steps without needing the chat server.
Scope and limitations
The repository does not implement quantum key distribution: bb84_protocol() hashes Python random values, and messages use repeating XOR. The send event also includes plaintext and the key. Treat this as an educational prototype, not secure end-to-end messaging. The portfolio’s BB84 table is a separate browser simulation.
The reviewed change reconciles legacy messenger database schemas.
Reviewed repository snapshot (9d1dd49) ↗