Pulsars
0 %
Log inSign up

Modern messaging

The Ratchet: Protecting the Past and the Future

Encrypting every message with the same key poses an obvious risk: if that key is stolen, the entire conversation is exposed, including past messages. Modern messaging systems prevent this using a mechanism known as a ratchet.

The idea

The key changes with every message. After use, the old key is deleted, and the new one is derived from the previous one using a one-way function:

K1 --(derivation)--> K2 --(derivation)--> K3 --> ...
(deleted)            (deleted)

The name comes from the mechanism: a ratchet turns in only one direction. Knowing K3, one cannot work backwards to K2, as the derivation is irreversible.

Persistent confidentiality

The immediate consequence is that an attacker who seizes your device today and obtains the current key cannot decrypt yesterday’s messages. The keys that protected them no longer exist anywhere.

This is the same property as that of TLS 1.3, achieved here on a message-by-message basis.

Recovery after compromise

However, the symmetric ratchet is not sufficient on its own. An attacker holding K3 can derive K4, K5, and eavesdrop on the conversation indefinitely.

Hence a second mechanism: at regular intervals, the two devices perform a new Diffie-Hellman exchange and incorporate the result into the derivation.

K3 + (New DH exchange) --> K4'

The attacker, who does not know the new secret exponent, is left out in the cold. The conversation becomes secure again without any user intervention.

This property is known as post-compromise security, or self-healing. The combination of the two locking mechanisms—symmetric and Diffie-Hellman—forms the double lock popularised by the Signal protocol, which has now been adopted by most encrypted messaging services.

What this means in practice

A compromise is no longer permanent in either direction of time: the past remains secure, and the future closes itself off automatically. This is a significant improvement on a fixed-key model, where a single leak would compromise everything, forever.