Insight
What the server can see
Encryption hides what a message says, not that it was sent; following one message from phone to phone shows what each machine on the way holds, and what each can learn from it.
A server that carries encrypted messages cannot read them, and that is where most descriptions stop. It still handles every message: it knows that one arrived, when, for whom and roughly how large. This piece follows one f|gment message from the device that writes it to the device that reads it, and states what each machine on the way holds.
Before it leaves
On the sender's device the message is padded to a size class, the smallest of a ladder of sizes that double from half a kilobyte, so a two-word reply and a few lines of text leave at the same size. It is then sealed with AES-256-GCM as two payloads of equal size, each under a key derived for that message alone, and the envelope's authenticated data binds the conversation, the message's position and every payload, so nothing in it can be altered on the way without the recipient noticing.
At the server
The device deposits the sealed envelope with the storage server, which keeps it until the recipient's devices collect it. To deliver it, the server records which account sent it, which account it is for, which conversation it belongs to and when it arrived. It sees the size class rather than the length, it can count messages, and because a key exchange adds a ciphertext of fixed size every few messages, it can tell where in the conversation those exchanges fall. It holds no key that opens either payload, and nothing in the envelope says which payload a device will open.
- Readable by that machine
- Present, but sealed
Someone watching the network between the two sees less: a transfer, its moment, its size class and the addresses at each end. A handle can loosen the link between typing and sending, so that a send waits a random delay of up to two seconds, or is held and released with every other send of the same minute.
The wake-up, and the end
The recipient's device is woken by a push notice that carries no message: its body is sealed and authenticated, and the push service sees only the device it wakes, the moment, and the opaque identifiers that route it. The device collects the envelope, opens the payload meant for it, and checks it against the conversation's history. Once the conversation's devices have confirmed delivery and a grace period has passed, the server deletes its copy.
Taking the sender off the record
The server's record of who wrote to whom is the part encryption does not touch, and it is what the relay is designed to remove. The sender seals the message twice: an inner layer to the recipient's handle and an outer layer to a relay key the recipient publishes. The relay opens only the outer layer and passes the inner one on, so the store holds a message for whoever holds that relay key, from no one it can name.
- Outer layer, to the relay's key
- Inner layer, to the recipient's handle
The relay is on for every new handle from the moment the handle is created, and one-to-one messages travel through it, so the server's view of those is the relayed one drawn here. Group messages do not yet pass through the relay; for a group, the store still records the sender's account.