Skip to content

gorecodes/chatuncontrol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat UNcontrol - Python Version

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.

Features

  • 🔒 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

Technical Architecture

Backend (Python)

  • 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

Frontend (JavaScript)

  • 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

Database

  • MongoDB with TTL indexes for automatic data expiration
  • Motor for async database operations

Prerequisites

  • Python 3.8+
  • Docker & Docker Compose (for MongoDB instance)

Installation & Running

Quick Start

git clone https://github.com/gorecodes/chatuncontrol.git
cd chatuncontrol
./run.sh

This script will set up a Python virtual environment, install dependencies, start MongoDB via Docker, and launch the FastAPI server.

Manual Install

  1. Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate  # Linux/macOS
# venv\Scripts\activate  # Windows
pip install -r requirements.txt
  1. Start MongoDB with Docker Compose
docker-compose up -d
  1. Run the server
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
python3 main.py

Usage

  • 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)

Security

  • 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

Configuration

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:

  1. Copy config/config.yaml to your local setup
  2. Adjust the values as needed
  3. 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.

Contribution

Contributions are welcome! Fork the repo, create a new branch, submit pull requests.

License

GPL License


Repository link: https://github.com/gorecodes/chatuncontrol

1

About

Chat UNcontrol is a secure, temporary messaging system with end-to-end encryption (E2E), built in Python using modern web technologies. It was created as a protest against Chat Control 2.0, emphasizing privacy and user autonomy..

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors