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.