03 / PROJECTSecurity · Real-Time Systems
ChatPulse
A messaging server that cannot read its own traffic
End-to-end encrypted messaging where the private key never leaves the browser. The server relays ciphertext and wrapped session keys, and holds nothing it could decrypt.
Architecture
Client
Sender
Generates the RSA-OAEP key pair in-browser; the private key stays in IndexedDB.
Sender → AES-GCM → Ciphertext + Wrapped Session Key → Socket.io → Server → Recipient
The problem
Most chat applications encrypt in transit and then store readable messages. If the server can read the conversation, a server compromise is a conversation compromise.
Engineering challenge
Delivering real-time messaging while making it structurally impossible for the server — or anyone who compromises it — to read message contents.
Approach
Key generation happens in the browser with WebCrypto and the private key is persisted only to IndexedDB. Each message is encrypted with a fresh AES-256-GCM session key, which is then RSA-wrapped for the recipient. The server relays ciphertext and wrapped keys, and MongoDB TTL indexes expire ephemeral records without intervention.
- WebCrypto
- Native browser primitives — no hand-rolled cryptography, no key material in application code.
- IndexedDB
- Origin-scoped local persistence for a private key that must not be transmitted.
- AES-256-GCM
- Authenticated encryption — tampering is detected, not just hidden.
- Socket.io
- Bidirectional real-time transport with reconnection handling.
Engineering detail
- 01RSA-OAEP key pair generated in the browser via WebCrypto
- 02Private key stored only in IndexedDB — it is never transmitted
- 03Per-message AES-256-GCM encryption with a fresh session key
- 04RSA key wrapping, so the session key travels encrypted to the recipient
- 05Server receives ciphertext only and has no path to plaintext
- 06Zero-knowledge server architecture as a structural property, not a policy
- 07MongoDB TTL indexes expiring ephemeral data automatically
Engineering practices
- Threat model stated first; the architecture follows from it.
- Server trust minimised by design rather than by configuration.
- Ephemeral data expires through TTL indexes, not cleanup scripts.
Features
- Browser-generated RSA-OAEP key pairs.
- Per-message AES-256-GCM with RSA key wrapping.
- Ciphertext-only server storage.
- TTL-expired ephemeral records.