Skip to content

My ISP tried to block this repo. 🀐 A truly peer-to-peer, end-to-end encrypted CLI chat that leaves NO logs. Perfect for... sensitive discussions. πŸ”₯ Get it before it gets taken down

License

Notifications You must be signed in to change notification settings

emilycodestar/cmd-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🀐 CMD-CHAT

encrypted terminal chat. no servers. no logs. ram only.

License: MIT Python 3.8+


peer-to-peer encrypted chat that runs in your terminal. you host, you control. close the window β€” everything's gone.

why

every "secure" messenger still stores metadata somewhere. this doesn't. it's just two terminals talking over an encrypted tunnel. nothing written to disk, ever.

how it works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        SRP AUTHENTICATION                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  CLIENT                                         SERVER           β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    │─────── POST /srp/init {username, A} ───────► β”‚              β”‚
β”‚    β”‚         (A = client public ephemeral)        β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    │◄──── {user_id, B, salt, room_salt} ───────── β”‚              β”‚
β”‚    β”‚         (B = server public ephemeral)        β”‚              β”‚
β”‚    β”‚         (room_salt = E2E key derivation)     β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    β”‚  [client derives room_key via HKDF:          β”‚              β”‚
β”‚    β”‚   room_key = HKDF(password, room_salt)]      β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    β”‚  [both sides compute SRP session key         β”‚              β”‚
β”‚    β”‚   using password + ephemeral values]         β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    │─────── POST /srp/verify {user_id, M} ──────► β”‚              β”‚
β”‚    β”‚         (M = client proof)                   β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    │◄────────── {H_AMK, session_key} ──────────── β”‚              β”‚
β”‚    β”‚         (H_AMK = server proof)               β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    β”‚  [password never transmitted]                β”‚              β”‚
β”‚    β”‚  [MITM can't derive session key]             β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                      E2E ENCRYPTED CHAT                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    β”‚                                              β”‚              β”‚
β”‚    │═══════ WebSocket /ws/chat?user_id ═════════► β”‚              β”‚
β”‚    β”‚         (authenticated session)              β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚  β”Œβ”€β”΄β”€β”                                        β”Œβ”€β”€β”΄β”€β”€β”            β”‚
β”‚  β”‚ C │──── encrypt(msg, room_key) ───────────►│  S  β”‚            β”‚
β”‚  β”‚ L β”‚                                        β”‚  E  β”‚            β”‚
β”‚  β”‚ I │◄─── ciphertext (broadcast) ────────────│  R  β”‚            β”‚
β”‚  β”‚ E β”‚                                        β”‚  V  β”‚            β”‚
β”‚  β”‚ N β”‚     decrypt(ciphertext, room_key)      β”‚  E  β”‚            β”‚
β”‚  β”‚ T β”‚                                        β”‚  R  β”‚            β”‚
β”‚  β””β”€β”¬β”€β”˜                                        β””β”€β”€β”¬β”€β”€β”˜            β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    β”‚  [server stores ONLY ciphertext]             β”‚              β”‚
β”‚    β”‚  [server CANNOT read messages]               β”‚              β”‚
β”‚    β”‚  [all clients with same password             β”‚              β”‚
β”‚    β”‚   derive identical room_key]                 β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    β”‚  Encryption: Fernet (AES-128-CBC + HMAC)     β”‚              β”‚
β”‚    β”‚  Key derivation: HKDF-SHA256                 β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β”‚    β”‚  [on disconnect: keys wiped from RAM]        β”‚              β”‚
β”‚    β”‚                                              β”‚              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      KEY HIERARCHY                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  password ──┬──► SRP ──► session_key (per-user, auth only)       β”‚
β”‚             β”‚                                                    β”‚
β”‚             └──► HKDF(password, room_salt) ──► room_key (shared) β”‚
β”‚                                                                  β”‚
β”‚  room_salt: generated once at server start                       β”‚
β”‚  room_key:  deterministic, same for all clients with same pwd    β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

SRP (Secure Remote Password) β€” password is never sent over the network. both sides prove they know it via zero-knowledge proof, then derive identical session keys.

install

git clone https://github.com/emilycodestar/cmd-chat.git
cd cmd-chat
python -m venv venv && source venv/bin/activate && pip install -r requirements.txt

windows:

python -m venv venv ; .\venv\Scripts\activate ; pip install -r requirements.txt

usage

start server:

python cmd_chat.py serve 0.0.0.0 3000 --password mysecret

connect:

python cmd_chat.py connect SERVER_IP 3000 username mysecret

Example

features

  • ram only β€” nothing touches disk
  • rsa + aes β€” key exchange + symmetric encryption
  • no central server β€” direct p2p connection
  • srp auth β€” password never sent over network

license

MIT

About

My ISP tried to block this repo. 🀐 A truly peer-to-peer, end-to-end encrypted CLI chat that leaves NO logs. Perfect for... sensitive discussions. πŸ”₯ Get it before it gets taken down

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages