A state-of-the-art, military-grade secure messaging system implementing advanced cryptographic protocols, AI-powered intrusion detection, Tor anonymization, and comprehensive forensics resistance.
- X3DH Key Agreement: Perfect forward secrecy with ephemeral keys
- ChaCha20-Poly1305: Authenticated encryption with associated data (AEAD)
- Digital Signatures: Ed25519 for message authentication and non-repudiation
- Key Rotation: Automatic key rotation every 10 messages for forward secrecy
- Deniability: Cryptographic deniability features
- Memory-Only Storage: Messages never written to disk
- Automatic Destruction: Messages destroy after reading or timeout
- Secure Memory Wiping: Multiple-pass memory overwriting
- Access Limiting: One-time read with immediate destruction
- Tamper Detection: Integrity verification with immediate destruction on tampering
- Hidden Service: Automatic .onion address generation
- Traffic Obfuscation: Message padding and timing delays
- Circuit Rotation: Automatic Tor circuit changes for anonymity
- Dummy Traffic: Background noise generation
- Ephemeral Identities: Session-based aliases with automatic rotation
- Per-User Keypairs: Individual cryptographic identities
- QR Code Sharing: Secure key exchange via QR codes
- Fingerprint Verification: Manual key verification process
- Trust Management: Trust levels and verification status
- Key Rotation: Automated key rotation for forward secrecy
- Behavioral Analysis: Machine learning-based user behavior modeling
- Anomaly Detection: Real-time detection of suspicious patterns
- Network Threat Detection: IP reputation, rate limiting, attack pattern recognition
- System Monitoring: Resource usage and process monitoring
- Automated Response: Automatic blocking and alerting on threats
- Event Monitoring: Comprehensive security event logging
- Threat Detection: Real-time pattern analysis
- Automated Actions: Emergency procedures and countermeasures
- Signal-Based Architecture: Decoupled security event handling
- Logging Suppression: Complete logging elimination
- Forensics Resistance: Anti-forensics and memory protection
- Anti-Debugging: Process monitoring and debugger detection
- Memory Protection: Secure memory allocation and wiping
- Emergency Protocols: Panic button and emergency wipe
βββββββββββββββββββ    βββββββββββββββββββ    βββββββββββββββββββ
β   Frontend      ββββββ   Flask App     ββββββ Security Layer  β
β                 β    β                 β    β                 β
β β’ Matrix UI     β    β β’ Route Handler β    β β’ Crypto Engine β
β β’ QR Scanner    β    β β’ Session Mgmt  β    β β’ Key Manager   β
β β’ Status Board  β    β β’ Security      β    β β’ Memory Mgmt   β
βββββββββββββββββββ    βββββββββββββββββββ    βββββββββββββββββββ
         β                       β                       β
         βββββββββββββββββββββββββΌββββββββββββββββββββββββ
                                 β
    βββββββββββββββββββ¬βββββββββββΌβββββββββββ¬ββββββββββββββββββ
    β                 β          β          β                 β
βββββΌββββ    ββββββββββΌββ    βββββΌβββββ  ββββΌβββ    ββββββββββΌββ
β Tor   β    β AI IDS   β    βSignals β  β DB  β    βHardening β
β       β    β          β    β        β  β     β    β          β
ββ’Hiddenβ    ββ’Behavior β    ββ’Events β  ββ’Mem β    ββ’Anti-    β
β Svc   β    β Analysis β    ββ’Threatsβ  βOnly β    β Forensicsβ
ββ’Obfus β    ββ’Anomaly  β    ββ’Actionsβ  ββ’Wipeβ    ββ’Debug    β
βββββββββ    ββββββββββββ    ββββββββββ  βββββββ    ββββββββββββ
# Python 3.8+
python --version
# Tor (for anonymization)
# macOS: brew install tor
# Ubuntu: sudo apt-get install tor
# Install Tor from https://www.torproject.org/# Clone and navigate
git clone <repository>
cd Manogna
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.py# For maximum security
export FLASK_ENV=production
export PYTHONWARNINGS=ignore
# Disable logging
export WERKZEUG_RUN_MAIN=true
# Run with hardening
python -c "from app import app_instance; app_instance.run(debug=False, host='127.0.0.1')"1. Navigate to /register
2. Create unique User ID and optional alias
3. Save generated QR code and fingerprint
4. Share QR code with trusted contacts only
1. Go to /send_message
2. Enter recipient's User ID
3. Compose message (max 5000 chars)
4. Set self-destruct timer (1-60 minutes)
5. Share generated secure link via secure channel
1. Open secure link (one-time use)
2. Message displays for 10 seconds
3. Automatic destruction after viewing
4. No recovery possible
1. Visit /status for real-time dashboard
2. Monitor threat levels and system status
3. View Tor connection and AI analysis
4. Access emergency controls
- Signal Protocol: X3DH + Double Ratchet
- Encryption: ChaCha20-Poly1305 AEAD
- Signatures: Ed25519 digital signatures
- Key Derivation: PBKDF2 with 100,000+ iterations
- Random Generation: Cryptographically secure random
- Secure Allocation: Memory locking where possible
- Multiple Overwrites: 3-pass random + specific patterns
- Garbage Collection: Forced GC with noise injection
- Stack Protection: Anti-debugging and memory obfuscation
- Tor Hidden Service: .onion address generation
- Traffic Analysis Resistance: Padding + timing delays
- IP Anonymization: Exit node rotation
- SSL/TLS: End-to-end encryption over Tor
- Behavioral Modeling: User pattern learning
- Threat Classification: Multi-stage threat detection
- Automated Response: Real-time blocking and alerts
- False Positive Reduction: Machine learning optimization
- 
π Key Management - Private keys are generated locally and never transmitted
- Loss of QR code/fingerprint means permanent loss of access
- Verify fingerprints in person when possible
 
- 
π Message Security - Messages are destroyed after reading - no recovery possible
- Self-destruct timers are enforced - plan accordingly
- Screenshot/copy protection enabled in browser
 
- 
π Network Security - Always use Tor Browser for maximum anonymity
- Verify .onion address authenticity
- Avoid using on compromised networks
 
- 
π» System Security - Run on dedicated, hardened systems when possible
- Disable swap/hibernate to prevent memory dumps
- Use full disk encryption
 
- 
π‘οΈ Operational Security - Treat this as classified system
- Monitor for surveillance/forensics tools
- Have emergency wipe procedures ready
 
export FLASK_SECRET_KEY="your-256-bit-secret"
export TOR_SOCKS_PORT="9050"
export MAX_MESSAGE_SIZE="5000"
export DEFAULT_TTL_MINUTES="5"# Maximum Security (Default)
SECURITY_LEVEL = "MAXIMUM"
LOGGING_ENABLED = False
FORENSICS_RESISTANCE = True
AI_MONITORING = True
# High Security
SECURITY_LEVEL = "HIGH"
LOGGING_ENABLED = False
FORENSICS_RESISTANCE = True
AI_MONITORING = True
# Development (NOT for production)
SECURITY_LEVEL = "DEV"
LOGGING_ENABLED = True
FORENSICS_RESISTANCE = False
AI_MONITORING = False# Run security tests
python -m pytest tests/security/
# Test encryption
python tests/test_crypto.py
# Test memory wiping
python tests/test_memory.py
# Test AI detection
python tests/test_ai_ids.py- Test with OWASP ZAP
- Network analysis with Wireshark
- Memory analysis with Volatility
- Static analysis with Bandit
- Message Encryption: <50ms for 5KB message
- Key Generation: <100ms for full keypair
- Memory Wipe: <10ms for 1MB block
- Tor Circuit: 3-15 seconds for new circuit
- AI Analysis: <20ms per request
- RAM: 50-100MB baseline + message storage
- CPU: Low usage, spikes during crypto operations
- Network: Minimal overhead with Tor
- Storage: Zero persistent storage (memory only)
1. Tor Connection Failed
# Check Tor service
sudo systemctl status tor
# Manual Tor start
tor --SocksPort 9050 --ControlPort 90512. Message Not Decrypting
- Verify recipient has correct keys
- Check session establishment
- Ensure message hasn't expired
3. AI False Positives
- Check system resource usage
- Verify no security tools running
- Adjust threat sensitivity
4. Memory Issues
- Monitor system RAM usage
- Check for memory leaks
- Increase swap (temporary only)
# Via web interface
POST /emergency_wipe
# Manual trigger
python -c "from app import app_instance; app_instance.memory_manager.emergency_wipe()"- Immediate memory wipe initiated
- All sessions terminated
- Tor circuits rotated
- System lockdown activated
- Execute emergency wipe
- Rotate all keys
- Change Tor identity
- Investigate breach vector
This software implements military-grade cryptography and security measures. Usage may be restricted in certain jurisdictions. Users are responsible for compliance with local laws and regulations.
This software may be subject to export control regulations. Review applicable laws before international distribution.
This software is provided for educational and research purposes. The authors are not responsible for misuse or legal violations.
- All security issues should be reported privately
- Include proof-of-concept for vulnerabilities
- Coordinate disclosure timeline
- All code must pass security review
- Cryptographic changes require expert review
- Performance impact must be documented
Classified Security Software License
This software contains military-grade security implementations. Use is restricted to authorized personnel only. See LICENSE file for full terms.
- Report via encrypted email only
- Include system configuration
- Provide reproduction steps
- Check documentation first
- Review troubleshooting section
- Contact maintainers via secure channels
π "Security through obscurity is no security at all. Security through mathematics is absolute."