A secure, real-time chat application with end-to-end encryption using the Signal Protocol (libsignal).
Final Year College Project - Computer Science/Engineering
Academic Year: 2025-2026
- π End-to-End Encryption using Signal Protocol (X3DH + Double Ratchet)
- π¬ Private Chat - Secure 1-to-1 messaging
- π₯ Group Chat - Multi-user encrypted conversations
- π File Sharing - Share encrypted files, images, videos (up to 16MB)
- π€ Voice Messages - Record and send audio messages
- π± Device Linking - QR-based secure multi-device support
- π Server-Wide Chat - Public chat room
- β¨οΈ Typing indicators
- β Read receipts (sent/delivered/read)
- π’ Online/offline status
- π Message reactions
- βοΈ Edit/delete messages
- π Dark/light mode
- π± Responsive design (mobile-friendly)
- π Emoji picker (200+ emojis)
- π¬ GIF picker (GIPHY integration)
- π Rich text formatting (markdown)
βββββββββββββββ Encrypted ββββββββββββββββ Key Exchange βββββββββββββββ
β Client A β βββββββMessagesββββββΊβ Server ββββββ& Message RelayββββΊβ Client B β
β (libsignal) β (ciphertext) β Flask+Socket β (public keys) β (libsignal) β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β β
β βΌ
βΌ ββββββββββββββββ
βββββββββββββββ β MongoDB β
β IndexedDB β β - Users β
β (private β β - Messages β
β keys) β β - Groups β
βββββββββββββββ ββββββββββββββββ
Backend:
- Flask (Python web framework)
- Flask-SocketIO (WebSocket support)
- MongoDB (Database)
- libsignal (Signal Protocol implementation)
- bcrypt (Password hashing)
Frontend:
- HTML5, CSS3, JavaScript (ES6+)
- TailwindCSS (Styling)
- @signalapp/libsignal-client (E2E encryption)
- Socket.IO client (Real-time communication)
- Dexie.js (IndexedDB for key storage)
- Python 3.9 or higher
- MongoDB 6.0+ (local or Atlas)
- Modern web browser (Chrome, Firefox, Edge)
- Git
git clone https://github.com/yourusername/chatify.git
cd chatifypython -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory:
# Flask Configuration
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=your-secret-key-here-change-in-production
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/chatify
# Or use MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/chatify
# Server Configuration
HOST=0.0.0.0
PORT=5000
DEBUG=True
# File Upload
MAX_FILE_SIZE=16777216 # 16MB in bytes
UPLOAD_FOLDER=uploads- Option A (Local): Install MongoDB Community Edition
- Option B (Cloud): Create free cluster on MongoDB Atlas
To enable the GIF picker feature:
- Go to GIPHY Developers
- Create a free account
- Create a new app (choose "SDK" type)
- Copy your API key
- Open
templates/chat.htmland replaceYOUR_GIPHY_API_KEY_HEREwith your actual API key
Note: The app works without this - GIF picker just won't load GIFs until configured.
python app.pyThe application will be available at: http://localhost:5000
chatify/
βββ app.py # Main Flask application
βββ config.py # Configuration settings
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (create this)
βββ .gitignore # Git ignore rules
β
βββ app/
β βββ __init__.py # App initialization
β βββ models.py # Database models
β βββ routes/
β β βββ __init__.py
β β βββ auth.py # Authentication routes
β β βββ chat.py # Chat routes
β β βββ keys.py # Key management routes
β β βββ files.py # File upload/download routes
β β
β βββ socket_events.py # Socket.IO event handlers
β βββ utils/
β βββ __init__.py
β βββ database.py # Database utilities
β βββ security.py # Security utilities
β
βββ static/
β βββ css/
β β βββ style.css # Custom styles
β βββ js/
β β βββ app.js # Main JavaScript
β β βββ crypto.js # libsignal wrapper
β β βββ socket.js # Socket.IO client
β β βββ ui.js # UI management
β β βββ storage.js # IndexedDB management
β βββ assets/
β βββ images/
β
βββ templates/
β βββ base.html # Base template
β βββ index.html # Landing page
β βββ register.html # Registration page
β βββ login.html # Login page
β βββ chat.html # Main chat interface
β
βββ uploads/ # File uploads directory
β βββ .gitkeep
β
βββ tests/ # Test files
β βββ test_auth.py
β βββ test_crypto.py
β βββ test_socket.py
β
βββ docs/
βββ API.md # API documentation
βββ ARCHITECTURE.md # Architecture details
βββ SECURITY.md # Security analysis
- Signal Protocol (X3DH + Double Ratchet)
- Forward Secrecy - Each message uses unique keys
- Post-Compromise Security - Future messages remain secure after key compromise
- Zero Knowledge Server - Server never sees plaintext messages
- bcrypt Password Hashing - Secure credential storage
- TLS/SSL - All transport encrypted (HTTPS/WSS)
- File Integrity Verification - SHA-256 checksums
- Phase 0: Project Setup β
- Phase 1: Authentication
- Phase 2: libsignal Integration
- Phase 3: Private Chat
- Phase 4: Real-Time Features
- Phase 5: Group Chat
- Phase 6: File Sharing
- Phase 7: Message Enhancements
- Phase 8: Device Linking
- Phase 9: UI Polish
- Phase 10: Testing & Documentation
See plan.md for detailed roadmap.
# Run all tests
pytest
# Run with coverage
pytest --cov=app tests/
# Run specific test file
pytest tests/test_auth.py- Development Plan - Detailed project roadmap
- API Documentation - REST and Socket.IO API reference
- Architecture Guide - System design and components
- Security Analysis - Threat model and countermeasures
This project demonstrates:
- β Full-stack web development
- β Real-time communication systems
- β Applied cryptography (Signal Protocol)
- β Database design (MongoDB)
- β Security best practices
- β Modern software architecture
This is an academic project. If you'd like to suggest improvements:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - See LICENSE file for details
Your Name
Final Year Project - Computer Science/Engineering
University Name - 2025-2026
- Signal Protocol - Open Whisper Systems
- Flask & Socket.IO communities
- MongoDB documentation
- My project supervisor and peers
For questions or demo requests:
- Email: your.email@example.com
- LinkedIn: [Your Profile]
- GitHub: [@yourusername]
Built with β€οΈ for secure communication