Secure, temporary messaging system with end-to-end encryption (E2E), built in Python as a protest against Chat Control 2.0, emphasizing privacy and user autonomy.
- 🔒 End-to-End Encryption: Messages are locally encrypted; the server cannot decrypt them
- ⏰ Auto-Deletion: Messages are automatically deleted after a set time
- 🔗 Temporary Links: Each chat has a disposable link for maximum privacy
- 🛡️ Zero-Knowledge: The server never accesses conversation contents
- 🚫 Chat Control Resistant: Architecture designed to resist mass surveillance
- FastAPI for a modern, performant web framework
- WebSockets for real-time bidirectional communication
- Motor async MongoDB driver for high performance
- Cryptography Python library for server-side crypto utilities
- Asyncio for native asynchronous programming
- WebCrypto API for browser-native cryptography
- ECDH (P-256 curve) secure key exchange
- AES-GCM symmetric encryption for messages
- Minimal CSS-based interface without heavy frameworks
- MongoDB with TTL indexes for automatic data expiration
- Motor for async database operations
- Python 3.8+
- Docker & Docker Compose (for MongoDB instance)
git clone https://github.com/gorecodes/chatuncontrol.git
cd chatuncontrol
./run.shThis script will set up a Python virtual environment, install dependencies, start MongoDB via Docker, and launch the FastAPI server.
- Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
pip install -r requirements.txt- Start MongoDB with Docker Compose
docker-compose up -d- Run the server
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
python3 main.py- Open http://localhost:8080 in your browser
- Create a new chat to generate a disposable link
- Share the link with one other person for secure chat
- Messages are encrypted in-browser and auto-delete after 10 minutes (configurable)
- Perfect Forward Secrecy with ephemeral ECDH keys
- Zero-knowledge server architecture (server cannot read messages)
- Automatic message expiration through TTL indexes
- Client-side encryption with AES-GCM 256-bit
The application is configured through config/config.yaml. This file contains all the configurable parameters for the server:
# Server Settings
server:
host: "0.0.0.0" # Server bind address (0.0.0.0 for all interfaces)
url: "localhost" # Public URL for the server
port: 8080 # Server port
protocol: "http" # Server protocol (http/https)
debug: false # Debug mode flag
# MongoDB Settings
mongodb:
host: "localhost" # MongoDB host
port: 27017 # MongoDB port
database: "chatuncontrol" # Database name
username: "chat_admin" # MongoDB username
password: "secure_password_change_me" # MongoDB password (change this!)To modify any settings:
- Copy
config/config.yamlto your local setup - Adjust the values as needed
- Restart the server to apply changes
Important configurations:
- Change the MongoDB password before deployment
- The server.host "0.0.0.0" allows connections from any IP
- server.url defines the public address users will connect to
- Enable debug mode during development by setting server.debug to true
Note: After changing the configuration, make sure both the MongoDB connection and the server URL are accessible from your target environment.
Contributions are welcome! Fork the repo, create a new branch, submit pull requests.
GPL License
Repository link: https://github.com/gorecodes/chatuncontrol