4 min read Field note for CluTerm
Post-Quantum Is a Ratchet, Not a Feature
CluTerm had hybrid post-quantum key agreement in August. Having it meant little until nothing could talk its way out of it, and a model checker had a go at the protocol around it.
CluTerm has had post-quantum key agreement since the first of August. For the first two months, that sentence was true and nearly worthless.
The threat it answers is simple to state. Someone records your encrypted sessions today and keeps the recording. In some number of years a machine exists that breaks the elliptic-curve exchange those sessions started with, and everything you typed into a terminal in 2026 becomes readable. The defence is to agree on keys in a way that machine cannot undo.
CluTerm uses X-Wing for this: a hybrid of X25519, the curve everyone already trusts, and ML-KEM-768, the lattice scheme NIST standardised. The two secrets are hashed together, so the session key holds if either half does. It costs bytes: a public key is 1,216 of them where X25519 alone is 32, and the opening frame of a handshake grew to 1,357.
That shipped in August as something a connection could do.
Optional cryptography is a downgrade attack with a release note
If both ends support the strong handshake and the weak one, the security of the system is whatever decides between them. In August that decision leaned on a version number the control plane handed out. The control plane is the website. In CluTerm’s threat model the website is the adversary: it is exactly the party the end-to-end encryption exists to keep out. An unsigned hint from it was choosing the cryptography.
So the autumn’s work was not adding post-quantum. It was removing every way to not use it, in an order that could never strand a device:
- October 9. Machine-to-machine sessions require X-Wing by default.
- October 19. Every initiator dials X-Wing, on every client: the agent, the browser, the glasses, the handsets. The server’s version hint now decides nothing.
- November 2. Every responder refuses a classical opening frame at parse time, from any source. A device the mesh already knows, by a pinned key or a root-signed certificate carrying its ML-KEM key, cannot be talked down. The refusal runs before the trust-on-first-use gate, so a downgrade cannot hide behind “new device.”
Initiators first, then responders. Each step is only safe because the one before it had already shipped everywhere. That is why I call it a ratchet: it turns one way.
Keeping it turned
The failure I was guarding against is not a clever attack. It is me, in March, adding one more transport and forgetting that it also needs the refusal.
So there is a test that reads the source. Every path by which a session can attach has to appear in a table with its own downgrade decision, and a transport that is not in the table turns the build red. Refusals are counted and shown by the diagnostics command, so “is anything still trying to speak the old way” has a number. And each of these controls was run once against the code with the change reverted, to watch it fail. A guard that has never been seen to fire is not known to work.
Asking a prover instead of a person
The claim at the centre of CluTerm is that the relay carries your traffic and can read none of it. That is a claim about every possible sequence of messages, and people are bad at “every.”
So the protocol is written down in Tamarin, a symbolic model checker, with an adversary that owns the network, the relay, the website and the database. Four model families: the handshake, the record channel, the trust chain, authorisation. Around 580 lemma results in all. Every rule in the model cites the file and line of the code it stands for, and each attack the prover finds gets replayed as a test against the real implementation.
Two things about doing this honestly.
The models found real problems. Six root causes in the protocol as it shipped. The ones I can describe are closed: the owner’s co-signature covered a bare key with no role or device bound to it; the handshake proved possession of a key without binding whose handshake it was, which allows an unknown-key-share through a compromised device of your own; the relay would accept a token algorithm it had no business accepting. Those became a second version of the co-signature, a second version of the handshake with no change to the wire format, and one fewer algorithm.
A proof can be vacuous. A lemma that says “the attacker never learns the key” also passes if the model accidentally makes it impossible for anyone to finish a handshake. So the suite lints itself. Every verified lemma needs a mutant, a deliberately broken copy of the protocol, on which the same lemma fails. For the post-quantum property the mutant drops the ML-KEM half, and the “recorded sessions stay secret against a quantum adversary” lemma duly falls over. If it had not, the original proof would have meant nothing.
What I am not claiming
Identity keys and signatures are still classical. That is deliberate: a recorded session can be decrypted later, but a signature cannot be forged retroactively into a conversation that already happened. Authentication is the next ratchet, not this one.
The model idealises ML-KEM. It proves the protocol uses the primitive correctly, not that lattices are hard.
The full proof suite takes about four hours on one machine and runs there, not in CI. Only its lint runs on every change.
I have sizes, not timings, for the handshake on the microcontroller handsets.
And a model is also where the open items live. There are some. I am not going to list unfixed findings in a blog post, and I would be suspicious of any security writeup that claims to have none.
What I can say is narrower and I think more useful: on this mesh, as of November 2, there is no message a server can send that talks two machines that know each other into a key a quantum computer could later recover. Not because the feature exists. Because the alternative no longer parses.