A quantum-resistant messaging application with real-time encryption comparison dashboard.
- π Real Kyber-512 Post-Quantum Encryption - Production-grade quantum-resistant cryptography
- π‘οΈ Hybrid Encryption - Combines classical (X25519) + quantum-resistant (Kyber) for maximum security
- π¬ Multi-User Chat - Unlimited clients across different networks
- π¨ Modern Web UI - Premium dark theme with real-time updates
- π Live Monitoring Dashboard - Grafana dashboard comparing Classical vs PQ vs Hybrid encryption
- β‘ Real-Time Metrics - Performance, security, and throughput comparison
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Client 1 β β Client 2 β β Client N β
β (Any Net) β β (Any Net) β β (Any Net) β
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
ββββββββΌβββββββ
β Chat Server β
β (Port 8080)β
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β Prometheus β
β (Port 9090)β
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β Grafana β
β (Port 3000)β
βββββββββββββββ
(Admin Only)
- Python 3.8+
- Docker & Docker Compose (for admin monitoring)
- pip
pip install -r requirements.txtOn the server machine (or admin machine):
./run_server.shThe server will start on 0.0.0.0:8080 (accessible from any network).
On the admin machine:
./run_admin.shThis starts:
- Grafana at http://localhost:3000 (admin/admin)
- Prometheus at http://localhost:9090
The dashboard automatically loads with encryption comparison metrics.
On any client machine:
./run_client.sh <server-ip>Or simply:
./run_client.shThen enter:
- Server IP (e.g.,
192.168.1.100oryour-server.com) - Your username
- Encryption mode (Hybrid recommended)
The web interface will open automatically in your browser.
The admin dashboard displays real-time comparisons:
| Metric | Classical | Post-Quantum | Hybrid |
|---|---|---|---|
| Encryption Speed | β‘ Fastest | π Slower | βοΈ Balanced |
| Security Level | π 128-bit classical | π 128-bit quantum | π‘οΈ 128-bit both |
| Key Size | π¦ 32 bytes | π¦ 1184 bytes | π¦ Combined |
| Ciphertext Overhead | β Minimal | βοΈ Moderate |
- β Secure against classical computers
- β Vulnerable to quantum computers (Shor's algorithm)
- π― 128-bit classical security
- β Secure against quantum computers
- β NIST-standardized (FIPS 203)
- π― 128-bit quantum security
- β Secure if EITHER algorithm remains unbroken
- β Defense-in-depth approach
- π― Maximum security:
max(classical, quantum)
- Deploy server on a cloud VM (AWS, DigitalOcean, etc.)
- Note the public IP
- Clients connect using:
./run_client.sh <public-ip>
- Forward port 8080 on your router to server machine
- Find your public IP:
curl ifconfig.me - Clients connect using your public IP
# On server machine
ngrok tcp 8080
# Use the ngrok URL in clients
./run_client.sh <ngrok-url>PCQ-messenger-backup/
βββ app/
β βββ crypto_classical.py # X25519 + AES-GCM
β βββ crypto_kyber.py # Real Kyber-512 implementation
β βββ crypto_hybrid.py # Hybrid encryption
β βββ server.py # WebSocket chat server
β βββ client.py # CLI client
β βββ web_ui.py # Flask web interface
β βββ metrics.py # Prometheus metrics
β βββ networking.py # Network utilities
βββ static/
β βββ style.css # Premium dark theme
β βββ app.js # WebSocket client
βββ templates/
β βββ chat.html # Chat interface
βββ monitoring/
β βββ docker-compose.yml # Monitoring stack
β βββ prometheus.yml # Prometheus config
β βββ grafana-dashboard.json # Pre-configured dashboard
β βββ grafana-provisioning/ # Auto-provisioning
βββ run_server.sh # Server launcher
βββ run_client.sh # Client launcher
βββ run_admin.sh # Admin monitoring launcher
βββ requirements.txt # Python dependencies
python -m app.client ws://<server-ip>:8080 --username YourName --mode hybrid# Server
./run_server.sh 0.0.0.0 8080 9090
# Client web UI
python -m app.web_ui --port 5001# Server metrics
curl http://<server-ip>:9090/metrics
# Client metrics (if running)
curl http://localhost:8001/metrics- Check server is running:
netstat -tulpn | grep 8080 - Check firewall:
sudo ufw allow 8080 - Verify server IP is correct
# Install system dependencies for liboqs
sudo apt-get update
sudo apt-get install -y cmake ninja-build libssl-dev
# Then retry
pip install -r requirements.txt# Restart monitoring stack
cd monitoring
docker-compose down
docker-compose up -dTypical performance on modern hardware:
| Operation | Classical | Post-Quantum | Hybrid |
|---|---|---|---|
| Key Generation | ~0.1ms | ~0.5ms | ~0.6ms |
| Encryption (1KB) | ~0.05ms | ~0.08ms | ~0.09ms |
| Decryption (1KB) | ~0.05ms | ~0.08ms | ~0.09ms |
| Handshake | ~0.2ms | ~1.0ms | ~1.2ms |
This is a demonstration project showcasing post-quantum cryptography integration.
MIT License - See LICENSE file for details
- liboqs - Open Quantum Safe project for Kyber implementation
- NIST - Post-Quantum Cryptography Standardization
- Grafana & Prometheus - Monitoring infrastructure
For issues or questions, please open an issue on the repository.