Secure E2EE Messaging System - Sequential Implementation Plan
Splits building a secure E2EE messaging system into three sequential developer tasks with handoffs, attack demos, and documentation.
What this file does
Splits building a secure E2EE messaging system into three sequential developer tasks with handoffs, attack demos, and documentation.
When to use it
- Planning a team project with strict sequential dependencies
- Building a custom E2EE messaging system from scratch for a university course
- Defining non-negotiable security constraints and forbidden libraries upfront
- Structuring a project that requires attack demonstrations and threat modeling
Assumes this stack
Secure E2EE Messaging System - Sequential Implementation Plan
Project Overview
Course: Information Security - BSSE (7th Semester)
Team Size: 3 Members
Implementation Model: Sequential (Member 1 → Member 2 → Member 3)
Sequential Task Division (Code Implementation Only)
MEMBER 1: Foundation & Authentication Layer
Duration: Week 1-3
Prerequisites: None (Starting point)
Code Responsibilities:
-
Project Setup
- Initialize Git repository (private)
- Setup React.js frontend structure
- Setup Node.js + Express backend
- Configure MongoDB connection
- Setup HTTPS configuration
-
User Authentication System
- User registration API endpoint
- User login API endpoint
- Password hashing with bcrypt/argon2 (salt + hash)
- JWT token generation for sessions
- Protected route middleware
-
Asymmetric Key Generation
- Client-side RSA-2048/3072 OR ECC (P-256/P-384) key pair generation
- Use Web Crypto API (SubtleCrypto)
- Generate keys on user registration
-
Secure Key Storage
- Implement private key storage using Web Crypto API + IndexedDB
- Public key storage in MongoDB (server)
- Key retrieval functions
- Justify and document secure storage approach
-
Basic Frontend Components
- Registration page
- Login page
- Basic navigation structure
- Key generation status display
Handoff to Member 2:
- Working auth system (register/login)
- Users can generate and securely store key pairs
- API endpoints documented
- Database schema for users and public keys
- Frontend routing structure ready
MEMBER 2: Key Exchange & Messaging Core
Duration: Week 4-6
Prerequisites: Member 1 must complete authentication & key generation
Code Responsibilities:
-
Custom Key Exchange Protocol
- Design unique DH/ECDH variant
- Implement Diffie-Hellman OR ECDH key exchange
- Add digital signature mechanism for authentication
- Implement HKDF or SHA-256 for session key derivation
- Implement "Key Confirmation" final message
- Draw protocol flow diagrams (for documentation)
-
End-to-End Message Encryption
- Implement AES-256-GCM encryption (client-side)
- Generate fresh random IV per message
- Create authentication tag (MAC) per message
- Message encryption function
- Message decryption function
-
Message Storage & Retrieval
- API endpoint to store encrypted messages
- Store: ciphertext, IV, metadata (sender/receiver ID, timestamp)
- API endpoint to retrieve messages
- Never store plaintext on server
-
Replay Attack Protection
- Implement nonces
- Implement timestamps
- Implement message sequence numbers/counters
- Verification logic to reject replayed messages
-
Real-time Messaging (Optional)
- Setup Socket.io for real-time chat
- Emit/receive encrypted messages
- Online/offline status
-
Messaging UI Components
- Chat interface
- Message send/receive display
- Key exchange initiation UI
- Decryption status indicators
Handoff to Member 3:
- Working key exchange protocol
- Encrypted messaging functionality (send/receive)
- Replay attack protection implemented
- Message encryption/decryption working
- Chat UI functional
MEMBER 3: File Sharing & Security Features
Duration: Week 7-8
Prerequisites: Member 2 must complete messaging core
Code Responsibilities:
-
Client-side File Encryption
- Implement AES-256-GCM file encryption (client-side)
- Split files into chunks (recommended)
- Encrypt each chunk with fresh IV
- Generate authentication tags
-
Encrypted File Upload
- API endpoint for encrypted file upload
- Store encrypted chunks on server
- Store file metadata (name, size, type, sender, receiver)
- Never store plaintext files
-
Encrypted File Download & Decryption
- API endpoint to retrieve encrypted files
- Client-side file decryption
- Chunk reassembly
- File download to user device
-
File Sharing UI Components
- File upload interface
- File encryption progress indicator
- Shared files list
- File download and decryption interface
-
Security Logging System
- Log authentication attempts
- Log key exchange attempts
- Log failed message decryptions
- Log detected replay attacks
- Log invalid signatures
- Log server-side metadata access
- Create log viewing interface (admin panel)
-
Final Integration & Polish
- Integrate all components
- Error handling across all modules
- Loading states and user feedback
- Final UI/UX improvements
Final Output:
- Complete working E2EE system
- Message encryption ✓
- File sharing ✓
- Security logging ✓
- All features integrated
Shared Responsibilities (All Members)
Attack Demonstrations (Week 7)
All members collaborate:
- Create MITM attack demonstration
- Script to intercept DH exchange without signatures
- Show how digital signatures prevent MITM
- Create Replay attack demonstration
- Script to replay captured messages
- Show how nonces/timestamps/counters prevent replay
- Capture evidence:
- Wireshark packet captures
- BurpSuite logs
- Screenshots of attacks
STRIDE Threat Modeling (Week 7-8)
All members collaborate:
- Identify threats using STRIDE framework
- Identify vulnerable components
- Propose countermeasures
- Map threats to implemented defenses
- Create threat model diagrams
Documentation (Week 8)
All members contribute:
- Member 1 writes: Authentication section, key generation, key storage
- Member 2 writes: Key exchange protocol, message encryption, replay protection
- Member 3 writes: File sharing, security logging, integration
- All write together: Introduction, problem statement, conclusion, evaluation
Report must include:
- Introduction & problem statement
- Threat model (STRIDE)
- Cryptographic design explanation
- Key exchange protocol diagrams
- Encryption/decryption workflows
- Attack demonstrations with evidence
- Logs and screenshots
- Architecture diagrams
- System evaluation & conclusion
Video Demonstration (Week 8)
All members participate:
- Script the video together
- Each member presents their component
- Demo flow:
- Protocol explanation
- User registration & key generation
- Key exchange demonstration
- Encrypted messaging demo
- Encrypted file upload/download
- MITM attack demo
- Replay attack demo
- Limitations and future improvements
- Duration: 10-15 minutes
GitHub Repository Preparation (Week 8)
All members collaborate:
- Clean code and add comments
- Create comprehensive README.md
- Setup instructions
- Architecture documentation
- Add screenshots
- Include Wireshark/BurpSuite test results
- Ensure equal Git contributions visible
Technology Stack
✅ ALLOWED Technologies
Frontend:
- React.js
- Web Crypto API (SubtleCrypto) - MANDATORY for client-side crypto
- IndexedDB - for private key storage
- Axios - for HTTP requests
- Socket.io-client (optional) - for real-time messaging
Backend:
- Node.js
- Express.js
- MongoDB - for metadata storage only
- Socket.io (optional) - for real-time features
- Node.js crypto module - for backend signatures only
Tools:
- Wireshark - packet analysis
- BurpSuite Community Edition - attack simulation
- OpenSSL CLI - testing
❌ FORBIDDEN Technologies
Strictly NOT allowed:
- Firebase or any third-party authentication
- Third-party E2EE libraries (Signal, Libsodium, OpenPGP.js)
- CryptoJS for RSA/ECC
- NodeForge
- Any pre-built cryptography wrappers
- ChatGPT for generating full code modules
- Pre-built encrypted messaging app code
- Pre-built templates for cryptographic core
⚠️ Limited Use
- ChatGPT/LLMs: Only for conceptual help or debugging, NOT for complete modules
Critical Requirements
Security Constraints (NON-NEGOTIABLE)
- ✅ All encryption MUST occur client-side
- ✅ Private keys NEVER leave the client device
- ✅ No plaintext stored, logged, or transmitted anywhere
- ✅ AES-256-GCM only (NO CBC, NO ECB)
- ✅ RSA key size ≥2048 bits
- ✅ ECC must use NIST curves (P-256 or P-384 only)
- ✅ IVs must be unpredictable and non-repeating
- ✅ All signature verification must include timestamp checks
- ✅ All communication over HTTPS
Implementation Constraints
- ✅ Implement at least 70% of cryptographic logic yourself
- ✅ Each group must create a UNIQUE key exchange protocol variant
- ✅ Provide REAL packet captures from YOUR system
- ✅ Code similarity with other groups must be <35%
Storage Rules
- ✅ Server stores: Encrypted data, IVs, MACs, metadata only
- ✅ Server NEVER stores: Plaintext, private keys, session keys
- ✅ Client stores: Private keys (encrypted in IndexedDB), session keys (memory only)
Implementation Timeline
| Week | Member 1 | Member 2 | Member 3 |
|---|---|---|---|
| 1-3 | 🔨 Setup + Auth + Keys | ⏳ Waiting | ⏳ Waiting |
| 4-6 | ✅ Complete | 🔨 Key Exchange + Messaging | ⏳ Waiting |
| 7-8 | ✅ Complete | ✅ Complete | 🔨 File Sharing + Logging |
| 7 | 🤝 Attack demos (ALL) | 🤝 Attack demos (ALL) | 🤝 Attack demos (ALL) |
| 8 | 📝 Documentation (ALL) | 📝 Documentation (ALL) | 📝 Documentation (ALL) |
| 8 | 🎥 Video (ALL) | 🎥 Video (ALL) | 🎥 Video (ALL) |
Evaluation Criteria (100 Marks)
| Component | Marks |
|---|---|
| Functional correctness | 20 |
| Cryptographic design & correctness | 20 |
| Key exchange protocol | 15 |
| Attack demonstration (MITM, replay) | 15 |
| Threat modeling & documentation | 10 |
| Logging & auditing | 5 |
| UI/UX and stability | 5 |
| Code quality & originality | 10 |
| TOTAL | 100 |
Git Contribution Requirements
- ✅ Repository must be PRIVATE
- ✅ Each member must show EQUAL code contributions
- ✅ Use meaningful commit messages
- ✅ Regular commits throughout development (not bulk commits at end)
- ✅ Each member's work should be clearly visible in Git history
Final Deliverables Checklist
- Working E2EE application (messaging + file sharing)
- Complete project report (PDF)
- Video demonstration (10-15 min)
- GitHub repository with README
- Attack evidence (Wireshark/BurpSuite logs)
- Architecture diagrams
- Protocol flow diagrams
- Security logs screenshots
- STRIDE threat model document
Success Criteria
Your project is successful if:
- Messages and files are NEVER in plaintext outside sender/receiver devices
- Server cannot decrypt any user content
- Key exchange protocol is unique and secure
- MITM and replay attacks are demonstrated and defended against
- All cryptographic operations use correct algorithms and parameters
- System is stable and functional
- Documentation is comprehensive and clear
- Code shows originality and equal contributions
What's inside
5 main sections: task division, shared responsibilities, technology stack, timeline, evaluation criteria
Change this for your project
- Replace
shuja609/E2E_Projectwith your own repository name - Replace
BSSE (7th Semester)with your course and semester - Replace
3 Memberswith your actual team size - Replace
Week 1-3,Week 4-6,Week 7-8with your own timeline
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Sequential handoff with explicit prerequisites and deliverables for each member
- Shared responsibilities for attack demos, documentation, and video to ensure collaboration
- Clear forbidden technologies list to enforce original cryptographic implementation
Related Documents
Project Requirements Document: Long Video Generation Pipeline
Breaks long video prompts into segments, generates keyframes and clips via local or remote models, then stitches them into a final video.
AGENTS.md — ShakkaShell v2.0
Guides AI coding agents through building a CLI that translates natural language into offensive security commands, with a defined tech stack, structure, and implementation order.
SourceAtlas PRD v2.9.6
Defines the product requirements, architecture, and command interface for an AI-powered codebase understanding assistant integrated into Claude Code.
Fleet Management System - Product Requirements Document (PRD)
Defines functional, non-functional, and technical requirements for a fleet management system with compressed GPS tracking and predictive maintenance.