A secure end-to-end encrypted messaging platform with real-time security monitoring, anomaly detection, and tamper-proof message/file exchange.
Key Features: AES-GCM Encryption β’ Brute-Force Protection β’ HMAC Integrity Checks β’ ML-Powered Threat Detection.
- Secure Messaging: Encrypted text/file exchange with SHA-256 checksum validation
- Multi-Layer Security:
- PBKDF2-HMAC user authentication
- Tamper detection via HMAC signatures
- Automatic file/message deletion after decryption
- Threat Monitoring:
- Isolation Forest anomaly detection
- Random Forest classifier for malicious patterns
- Real-time alerts for brute-force attacks, data exfiltration, and integrity violations
- Admin Dashboard: View security logs, threat statistics, and system alerts
# Clone repository
git clone https://github.com/yourusername/secure-messaging-system.git
cd secure-messaging-system
python -m secure_messaging.run
Register User: Strong password policy enforced (8+ chars, mix of cases, symbols)
Send Message: Encrypted text communication
Send File: Secure .txt file transfer only
Check Messages: View/decrypt received items with auto-integrity checks
Admin Security Logs: View threat dashboard (credentials: admin/admin123)
.
βββ secure_messaging/
β βββ messenger.py # Core messaging logic
β βββ encryption.py # AES/HMAC implementation
β βββ authentication.py # User auth & session management
β βββ security_monitor.py # Real-time threat detection
β βββ security_model.py # ML model training/prediction
β βββ logging_manager.py # Unified logging system
βββ models/ # Pre-trained ML models
β βββ anomaly_detector.joblib
β βββ security_classifier.joblib
βββ datasets/ # Sample security logs
β βββ synthetic_logs.jsonl # Training data
β βββ test_logs.jsonl # Evaluation data
βββ run.py # CLI interface
βββ requirements.txt
synthetic_logs.jsonl: 240 hours of simulated normal/malicious activity
test_logs.jsonl: Validation dataset with labeled anomalies
Pre-trained models (retrain if needed):
python -m secure_messaging.security_model --train
Anomaly Detector: Isolation Forest (200 estimators)
Threat Classifier: Random Forest (200 estimators, max_depth=15)