The Raazdar protocol
in full
Exactly how Raazdar encrypts, delivers and verifies, for security reviewers, auditors and the curious. Version 1, 29 November 2026.
This document describes what the code on GitHub does. If the two ever disagree, the code is right and this page is a bug: please tell us. Plain-language summaries are on the Security page.
Contents
- Goals
- Identity and IDs
- Prekeys
- Starting a conversation
- Double ratchet
- Sealed sender envelope
- Delivery
- Files
- Calls
- Safety numbers and call codes
- On the device
- The server
- Blind Plus codes
- Known limitations
1. Goals
Only the people in a conversation can read it. The server learns as little as possible: not who you are, not what you say, and not who is talking to whom. A server that turns hostile can stop delivering messages but cannot read them, forge them, or silently put itself in the middle. All primitives are standard and run through the browser's WebCrypto, except ML-KEM-768 and the blind-code curve maths, which use audited open-source libraries bundled with the app.
2. Identity and IDs
- Each account has an identity signing key (ECDSA P-384) and an identity Diffie-Hellman key (ECDH P-384), made on the device.
- The Raazdar ID is derived from the signing key: the first 10 bytes of SHA-384(signing public key), written as 16 base32 characters (about 79 bits). Nobody, including the server, can give you a different key for an ID without the mismatch being detected.
- The identity DH key is signed by the signing key. Clients reject a key bundle whose ID, signature or prekey signature does not check out.
- Sign-up requires a small proof of work (SHA-256 with 18 leading zero bits over the public key) to make bulk account creation expensive.
3. Prekeys
Each device publishes a signed prekey: an ECDH P-384 key together with an ML-KEM-768 (NIST FIPS 203) encapsulation key, both signed with the identity key over id ‖ ecdh_pub ‖ kem_pub. It rotates every 24 hours; old prekey private keys are destroyed after 9 days. There are no one-time prekeys; the sender's fresh ephemeral key and the ratchet provide per-session freshness.
4. Starting a conversation
To start a session with Bob, Alice fetches and verifies his key bundle, then computes:
e = fresh ECDH P-384 key pair (Alice) dh1 = ECDH(e, Bob.prekey) dh2 = ECDH(Alice.identity_dh, Bob.prekey) (ct, ss) = ML-KEM-768.Encaps(Bob.prekey_kem) SK = HKDF-SHA-384(ikm = dh1 ‖ dh2 ‖ ss, salt = e_pub, info = "gc4-x3dh", 32 bytes)
An attacker must break both P-384 and ML-KEM-768 to recover SK. Because dh2 uses Alice's identity key, only the real Alice can produce a session Bob accepts as hers. The handshake values ride along with Alice's messages until Bob replies.
5. Double ratchet
Sessions follow the Signal double ratchet:
- Root key step:
HKDF-SHA-384(dh_output, salt = root_key, info = "gc4-ratchet")→ new root key and chain key. - Chain step: message key = HMAC-SHA-384(chain, 0x01)[0..32], next chain = HMAC-SHA-384(chain, 0x02)[0..32].
- Each message is AES-256-GCM encrypted with its own message key; the additional data binds the sender ID, recipient ID and the ratchet header.
- A new ECDH P-384 ratchet key is used on every turn of the conversation, giving forward secrecy and recovery after a compromise. Up to 300 skipped message keys are kept for out-of-order delivery; at most 3 sessions per contact.
- A message that fails to decrypt is dropped silently. It never resets the session, so forged or replayed messages can't disrupt a chat.
- Post-quantum ratchet. About once an hour (or every 50 messages) in an active chat, each phone advertises a fresh ML-KEM-768 key in its ratchet header. At its next ratchet step the other phone encapsulates a new secret to that key and mixes it into the root key together with the ECDH output:
RK, CK = HKDF-SHA-384(salt = RK, ikm = ECDH ‖ ML-KEM secret, info = "gc4-ratchet"). The KEM private key is destroyed once used. So the conversation keeps forward secrecy and recovers after a compromise even against an attacker who can break P-384. It is only used once the other phone has advertised a key, so older apps keep working.
6. Sealed sender envelope
Every ratchet message is wrapped again so the server cannot see the sender:
e' = fresh ECDH P-384 key pair
dh1' = ECDH(e', Bob.prekey)
(ct', ss') = ML-KEM-768.Encaps(Bob.prekey_kem)
outer_key = HKDF-SHA-384(dh1' ‖ ss', salt = e'_pub, info = "gc3-outer")
envelope = AES-256-GCM(outer_key, pad({ from: Alice.id, ratchet message }), aad = e'_pub ‖ ct')
The server sees only the recipient ID and the envelope. The sender's ID is inside, and is authenticated by the ratchet session (section 4), not by trust in the envelope: a forged "from" fails to decrypt. Plaintexts are padded to fixed sizes (1, 4, 16 and 64 KB, then larger steps), so short and long messages look the same.
7. Delivery
- Each device keeps two WebSocket connections. The inbox socket proves it owns an ID by signing a random server challenge (
"gc2-auth:" ‖ nonce) and receives envelopes for that ID. The drop socket sends envelopes and never identifies itself. - The app also sends random cover traffic (sealed envelopes to itself, discarded on arrival) so real activity is harder to see.
- Messages are deleted from the server once the recipient acknowledges them, or after 7 days if never delivered.
Linked devices
- An ID can be open on its main phone and up to 4 linked devices. As with Signal, linked devices share the ID's identity key (so the safety number doesn't change), but each device makes its own signed prekeys and keeps its own double-ratchet session with every contact device. Nothing of the phone's sessions or prekeys is copied.
- Senders seal a separate envelope for every device of the recipient and address it
ID.device; each device has its own queue and authenticates its inbox socket with the device name added. - The device list is signed by the identity key (
"rzdevs1|" ‖ ID ‖ "|" ‖ time ‖ "|" ‖ devices), and each device's prekey id begins with its 6-letter device name and is signed too. Apps ignore devices the identity didn't sign and never accept an older list, so the server can't add a device or bring back a removed one. - Linking uses the same one-time, 10-minute, end-to-end encrypted transfer as moving a phone: the key is in the link (after "#") and never reaches the server, and the account copy is still locked with the passcode. Messages you send on one device are copied to your other devices through the same sealed, per-device sessions.
- Removing a device publishes a new signed list; the server drops that device's queue and connections at once and it erases itself. Panic on the main phone also erases every linked device.
8. Files
Files over 1 MB are encrypted on the device with a fresh random AES-256-GCM key. The ciphertext is uploaded to the server; the key and a hash travel only inside the end-to-end encrypted message. Uploaded files are deleted after 7 days or after their downloads run out. Photos are re-encoded to remove location and camera data before sending.
9. Calls
Calls use WebRTC with DTLS-SRTP, so audio and video are encrypted between the two devices. The call set-up messages, including both DTLS certificate fingerprints, travel inside end-to-end encrypted Raazdar messages, so the server cannot substitute its own. Every call is forced through our relay (TURN, relay-only), so neither person learns the other's IP address; the relay forwards encrypted packets it cannot decrypt and keeps no logs. Calls are not offered over Tor.
10. Safety numbers and call codes
- Safety number: SHA-384 of the two signing public keys, sorted and joined, shown as 12 groups of 5 digits. Both people see the same number only if each holds the other's real key. Marking a contact verified pins their key.
- Call code: SHA-256 of
"raazdar-call|"and the two DTLS fingerprints of that call, sorted, shown as 4 pictures from a set of 64. If someone relays the call in the middle, each side sees different pictures.
11. On the device
- All app data (keys, contacts, chats, settings) is stored encrypted with AES-256-GCM under a key derived from your passcode with PBKDF2-SHA-384, 600,000 iterations. In browsers without WebCrypto (some Tor browsers), PBKDF2-SHA-256 is used with iterations tuned to about 3 seconds on that device.
- Encrypted backups use the same scheme with a passcode you choose. We hold no copy and cannot recover a lost passcode.
- Panic, duress passcode and auto-erase delete the local keys and data. With remote erase on, the app also sends each contact an end-to-end encrypted instruction to delete your conversation; their app carries it out when it next connects. This depends on their app and cannot undo screenshots or copies saved outside Raazdar.
12. The server
The relay keeps users' public keys, queued envelopes and uploaded encrypted files in memory only. It writes no logs of users' requests, IDs or IP addresses. On disk it keeps only: what billing needs, none of it linked to an ID (the serial numbers of used office codes, the random part of used Plus codes, random certificate numbers of removed Work seats, and 7-day payment references); the list of IDs removed for serious abuse; and 180 days of security logs about the server itself (server logins, connections the firewall blocked, and owner-panel actions, including which ID was looked up or removed in answer to a legal request or abuse report). The server signs plan passes (ECDSA P-384) that the app shows to unlock Plus limits; Work seats are certificates signed by the firm's own organisation key, which the server never holds.
13. Blind Plus codes
Paying for Plus must not tell us who you are in Raazdar. Plus codes therefore use a verifiable oblivious pseudorandom function (VOPRF) on P-384, the idea behind Privacy Pass:
Server key per plan: k (secret), K = k·G (published)
Buyer's browser: t = 12 random bytes, r = random scalar
B = r·H(plan, t) H = hash-to-curve (RFC 9380, P-384)
Server (paid order): Z = k·B, plus a DLEQ proof that log_G(K) = log_B(Z)
Browser: checks the proof, N = r⁻¹·Z = k·H(plan, t)
y = SHA-384("RZD-OPRF-v1|plan|" ‖ t ‖ N)[0..12]
Code: RZP- ‖ base32(version ‖ plan ‖ t ‖ y)
- The server only ever sees B, which is unrelated to t, so when the code is later redeemed it cannot tell which payment it came from, even if it kept every record.
- The DLEQ proof (Chaum-Pedersen, Fiat-Shamir with SHA-384) shows the server used its one published key, so it can't use a different key per buyer to recognise them later. Current key fingerprints:
/api/vkeys. - Each plan has its own key, so a 1-month payment can't be turned into a 12-month code. Each order can be signed only once, and each code redeemed only once (the server keeps t, never the ID).
- Work codes are invoiced to a firm and are ordinary signed codes: a Work purchase is linked to the firm and to the admin who redeems it, never to the colleagues they add.
14. Known limitations
- Linked devices share the identity key (as in Signal). A linked device that is stolen while unlocked can act as you until you remove it, and reactions, edits and deletions don't yet sync between your own devices.
- No independent audit yet. Our own tests (32 server, 11 user and 23 hostile-server attacks) run on every change; an external audit is planned and will be published.
- Code delivery on the web and desktop. The web app is loaded from our server, and the desktop apps currently load it too; a hostile server could change that code. The Android app (and the upcoming iPhone app) carries its code inside.
- Traffic records kept by mobile operators. Indian operators keep IP detail records (IPDR) for two years: when a phone connected to which address and how much data moved. Calls are relayed through our TURN server and can't run over Tor, so two watched phones' records can show a call starting and ending together. Messages ride a long-lived connection and, with Tor, show only a Tor session.
- Metadata the server still sees: which IDs are online, the recipient of each envelope, approximate sizes and timing, and IP addresses unless you use Tor (not logged).
- Identity signatures are not post-quantum. Key exchange, every envelope and the ratchet are hybrid post-quantum; signatures (ECDSA P-384) are classical.
- No one-time prekeys. Session start relies on the sender's fresh ephemeral key and the identity DH. A replayed message fails to decrypt and is dropped (this is in our tests).
Found a problem? Write to privacy@raazdar.app (see also security.txt). We answer every report.