A secure, real-time chat application in which all messages are encrypted end‑to‑end (E2EE). Even the server infrastructure will not be able to read message contents. Users register devices, authenticate via JWT, and establish private session keys through X3DH and Signal ratchet protocols.
Encryption:
* X3DH key agreement (ECDH secp521r1) with identity keys, signed pre‑keys, and one‑time pre‑keys
* Signal double‑ratchet for forward secrecy
* AES‑256‑GCM for message encryption/decryption (with IV, AAD, and Auth Tag)
* Key derivation via HKDF
Real-Time Transport: WebSockets (using ws or socket.io)
* Secure key‑exchange handshake (key-exchange event)
* Encrypted message flow (encrypted event)
* Session management and per‑connection session keys