Post-quantum key agreement
Calls from a Tauri app agree their keys with hybrid X25519MLKEM768 whenever the other side supports it. A page chooses per connection how strict to be.
The postQuantum option
new RTCPeerConnection({ iceServers, postQuantum: 'prefer' }); // 'off' | 'prefer' | 'require'
The member is not W3C. Browsers ignore it, so the same page code runs everywhere.
| Policy | Media and data channels (DTLS) | TURN over TLS |
|---|---|---|
off | DTLS 1.2, classical groups | Classical groups |
prefer (default) | DTLS 1.3 with X25519MLKEM768 when the peer supports it, DTLS 1.2 otherwise | X25519MLKEM768 first, classical groups after |
require | DTLS 1.3 with post-quantum groups only; other peers fail to connect | TLS 1.3 with post-quantum groups only |
The default is prefer when the plugin is built with pq-moduletto or pq-hybrid, which is the default build. Without either, a policy other than off makes the connection's methods reject with NotSupportedError.
What the other side needs
| Other side | Under prefer |
|---|---|
| Another app with this plugin, or any qrtc peer | X25519MLKEM768 over DTLS 1.3 |
Chromium 141 with the WebRTC-ForceDtls13 and WebRTC-EnableDtlsPqc field trials | X25519MLKEM768 over DTLS 1.3 |
| Browsers with default settings, and SFUs such as LiveKit | DTLS 1.2, classical |
| A TURN server on OpenSSL 3.5 or later (coturn built against it, for example) | X25519MLKEM768 for the TLS connection to the server |
With an SFU, each leg is negotiated separately: the app to the SFU, and the SFU to every other participant. A post-quantum leg protects only its own hop. LiveKit's end-to-end encryption still protects the media across the SFU, with keys that Matrix distributes.
Checking what was agreed
const stats = await pc.getStats();
for (const s of stats.values()) if (s.type === 'transport') console.log(s.tlsGroup); // "X25519MLKEM768"
tlsGroup is absent after a classical DTLS 1.2 handshake.
Choosing a policy
prefersuits calls with arbitrary peers. It never breaks a call that would work without it.requiresuits closed deployments where every peer and TURN server is known to support the hybrid. A peer without it fails to connect, after the ICE and DTLS timeouts.offreproduces a classical browser exactly, for comparison or debugging.