Insight
A key for every message
Each message is sealed under a key derived for it alone, so one exposed key opens one message, and a regular post-quantum key exchange cuts off anyone holding a stolen chain.
Many messengers protect a conversation with keys that last: one key, or one key a day, seals everything sent under it, and whoever obtains that key reads all of it. f|gment gives every message a key of its own and destroys the key once it has been used.
A chain that only runs forward
A conversation's keys live in epochs. Each epoch starts from secrets established with ML-KEM-1024, and from them each sender keeps a chain key. Every message advances that chain one step through HKDF-SHA512, a one-way function: the next chain key is computed from the current one, and nothing computes the current one from the next. From each step the sender derives a message key for that position alone, seals the message with AES-256-GCM under it, and wipes the key from memory. The recipient walks the same chain to the same position and derives the same key.
- Chain key, one step per message
- Message key or key exchange
- Exposed key
- Opened message
Because each message key comes from its own position in the chain, under its own label, a message key that leaks, from a device compromised at the wrong moment or a flaw that exposes one value, opens exactly one message. It says nothing about the keys before it or after it.
A fresh exchange, as often as the conversation chooses
A chain that only runs forward protects the past: a chain key stolen today does not run back to yesterday's messages. By itself it does not protect the future, since whoever holds today's chain key can follow the chain forward. So every few messages the sender performs a fresh ML-KEM-1024 key exchange with the recipient's published key and folds the new shared secret into the chain. A thief who holds the chain key but not the recipient's secret loses the chain at that point.
- Chain key
- Post-quantum key exchange
- Stolen chain key
- Readable by the thief
How often that happens is the conversation's choice. Four settings run from Maximum, a fresh exchange with every message, through Advanced, every third, and Enhanced, every tenth and the default, to Essential, every fiftieth. When the two sides prefer different settings, the conversation uses the stricter one; in a group the setting belongs to the group. A more frequent exchange shortens the time a stolen chain stays useful, at the cost of a larger message: each exchange adds about one and a half kilobytes.
Epochs, and what is kept
Above the chain, the epoch itself is replaced on a schedule, by time and by message count, at once when a member leaves a group, and whenever someone asks. Each new epoch starts from fresh secrets, its record joins a chain of epochs that every party can check, and retired keys are destroyed on every device that held them.
The result is a bound on any single exposure: one leaked message key opens one message, and one stolen chain key opens the messages up to the next exchange and none before it.