peer-to-peer encrypted chat that runs in your terminal. you host, you control. close the window β everything's gone.
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.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SRP AUTHENTICATION β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β CLIENT SERVER β
β β β β
β ββββββββ POST /srp/init {username, A} ββββββββΊ β β
β β (A = client public ephemeral) β β
β β β β
β ββββββββββββ {user_id, B, salt} ββββββββββββββ β β
β β (B = server public ephemeral) β β
β β β β
β β β β
β β [both sides compute shared 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] β |
β β β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ENCRYPTED CHAT β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β β β
β ββββββββ WebSocket /ws/chat?user_id ββββββββββΊ β β
β β (authenticated session) β β
β β β β
β βββββββββββββ AES-encrypted messages βββββββββΊ β β
β β (Fernet = AES-128-CBC + HMAC) β β
β β β β
β β β β
β β [on disconnect: keys wiped from RAM] β β
β β β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
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.
git clone https://github.com/emilycodestar/cmd-chat.git
cd cmd-chat
python -m venv venv && source venv/bin/activate && pip install -r requirements.txtwindows:
python -m venv venv ; .\venv\Scripts\activate ; pip install -r requirements.txtstart server:
python cmd_chat.py serve 0.0.0.0 3000 --password mysecretconnect:
python cmd_chat.py connect SERVER_IP 3000 username mysecret- ram only β nothing touches disk
- rsa + aes β key exchange + symmetric encryption
- no central server β direct p2p connection
- srp auth β password never sent over network
MIT
