--- title: "Cryptography and Transport" weight: 55 type: docs --- This part of the specification sets the cryptographic algorithms, transport requirements, metadata protections, encryption at rest, password authentication and anonymous trust tokens that apply across every Taper API. Where it conflicts with older text elsewhere in the specification, this part takes precedence. The key words MUST, MUST NOT, SHALL, SHOULD and MAY are used as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119). MUST and SHALL mean the same thing. ## Algorithm policy {#algorithm-policy} Taper follows the US National Institute of Standards and Technology (NIST) post-quantum transition guidance as published in late 2026, which CISA's post-quantum guidance defers to for configuration: * [NIST IR 8547](https://csrc.nist.gov/pubs/ir/8547/final) (final, October 2026): quantum-vulnerable public-key algorithms, including ECDH (X25519) and EdDSA (Ed25519), are **deprecated after 2030 and disallowed after 2035**. ML-KEM-768 is NIST's default post-quantum key-establishment parameter set. Hybrid schemes are acceptable as temporary measures if at least one component is approved. * [NIST SP 800-227](https://csrc.nist.gov/pubs/sp/800/227/final): hybrid key combiners. * [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final) (ML-KEM) and [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final) (ML-DSA). * CISA's [product categories for post-quantum cryptography](https://www.cisa.gov/resources-tools/resources/product-categories-technologies-use-post-quantum-cryptography-standards), which lists collaboration software (including messaging) as a category where post-quantum products are widely available and should be required. The most urgent threat is **harvest now, decrypt later**: traffic recorded today and decrypted once a quantum computer exists. Key establishment is therefore hybrid now. Signatures can only be forged in real time, so they follow on NIST's schedule. ### Required algorithms | Use | Taper requirement | Notes | |-----|-------------------|-------| | TLS key exchange | TLS 1.3 only. Servers and clients MUST offer and prefer `X25519MLKEM768` ([RFC 10024](https://datatracker.ietf.org/doc/rfc10024/), codepoint `0x11EC`). `X25519` alone MAY be accepted as a fallback until the end of 2030. | Pure ML-KEM groups are NOT RECOMMENDED (IANA marks them "Recommended: N"). Certificates stay classical until post-quantum WebPKI certificates exist. | | Olm pairwise handshake | Hybrid: the existing X25519 exchanges plus an ML-KEM-768 encapsulation to a one-time ML-KEM prekey (or a signed last-resort ML-KEM key), in the style of Signal's PQXDH. | See [Hybrid key combiner](#hybrid-key-combiner). Defined in a future revision of the Olm specification; until then, sessions are classical and clients MUST say so in their security details. | | Olm ratchet | SHOULD add periodic ML-KEM ratchet steps (in the style of Signal's sparse post-quantum ratchet), so that post-quantum forward secrecy survives past the first message. | Design choice beyond NIST guidance. | | Signatures on keys | Device keys, cross-signing keys and server signing keys: hybrid Ed25519 + ML-DSA-65, where **both** signatures MUST verify. New keys MUST be hybrid from the revision that defines the format, and all keys MUST be hybrid before the end of 2030. Ed25519 components MUST NOT be relied on after 2035. | Pure ML-DSA, not the pre-hash variant (HashML-DSA). SLH-DSA-SHA2-128s MAY be used for long-lived root keys. | | Symmetric encryption and MACs | AES-256, HMAC-SHA-256 or stronger. Nothing below 128-bit security. | AES-256 meets NIST's highest post-quantum category. | | Hashing | SHA-256, or SHA-384/SHA-512 where long-term collision resistance matters. | | | Password authentication | [OPAQUE](#password-authentication-opaque). | | | Anonymous tokens | [Privacy Pass](#trust-tokens-privacy-pass). | | A **CNSA 2.0 profile** MAY be offered for deployments that need it: TLS group `SecP384r1MLKEM1024`, ML-KEM-1024 in Olm, ML-DSA-87 signatures, SHA-384 or SHA-512. ### Hybrid key combiner {#hybrid-key-combiner} Where Taper combines a classical and a post-quantum shared secret, it uses a key derivation over **both** secrets and **all** public inputs, as permitted by SP 800-227 section 4.6 when one input comes from an approved scheme: K = HKDF-SHA-256( salt = 0, IKM = K_mlkem || K_x25519, info = "taper-hybrid-v1" || ct_mlkem || ek_mlkem || pk_x25519_sender || pk_x25519_recipient) The order of the secrets is fixed. Implementations MUST NOT skip either input, and MUST abort if either step fails. ### What post-quantum does not cover yet * **Deniability.** Hybrid key exchange gives post-quantum *confidentiality*. Post-quantum *deniable* authentication exists only in research. Recent work has also shown that the deniability arguments for X3DH-family handshakes, which Olm uses, don't hold against a malicious verifier ([Fiedler and Langrehr, CRYPTO 2025](https://eprint.iacr.org/2025/470)). Deniability in Taper rests mainly on removing signatures from content (see [room version 13](/rooms/v13)), not on the handshake. * **Identity keys** (OpenPGP and Ariadne) remain classical until those formats standardise post-quantum keys. They sign only identity statements, never messages. * **OPAQUE and Privacy Pass** are classical. Both run inside post-quantum hybrid TLS, which protects recorded transcripts. Privacy Pass blinding hides which token is which unconditionally, so a future quantum attacker could forge tokens but not link them to users. ### Implementations {#implementations} "Not your keys, not your crypto" applies to implementers too. Implementations: * MUST use maintained, publicly reviewed cryptographic libraries, and MUST NOT implement cryptographic primitives themselves; * MUST use constant-time implementations of operations on secret data; * SHOULD use libraries that have had an independent audit, and MUST pass the published test vectors for every algorithm they implement. For Olm and Megolm, clients SHOULD use [vodozemac](https://github.com/matrix-org/vodozemac) (audited) or an implementation of equal assurance. libolm is deprecated and MUST NOT be used in new implementations. ## Transport {#transport} All Taper traffic runs over WebSocket connections inside TLS 1.3. The transport is designed to be hard to block and hard to fingerprint, while still running on ordinary web hosting so that anyone can operate a server. Censors no longer rely only on blocklists. They block traffic that "looks like nothing" (fully encrypted streams with no recognisable protocol), probe suspected servers actively, fingerprint TLS handshakes, and enumerate servers from public lists. Taper's answer is to look like an ordinary HTTPS website, because blocking all of those is expensive. ### Baseline (every server) {#transport-baseline} * **TLS 1.3 on port 443,** with an ordinary certificate (for example from ACME) and the key exchange required by the [algorithm policy](#algorithm-policy). Plain `ws://` MUST be refused except on loopback addresses. * **HTTP versions.** The gateway MUST be reachable with WebSocket over HTTP/1.1, SHOULD also be reachable over HTTP/2 ([RFC 8441](https://www.rfc-editor.org/rfc/rfc8441)), and MAY be reachable over HTTP/3 ([RFC 9220](https://www.rfc-editor.org/rfc/rfc9220)). Over HTTP/2 and HTTP/3, the socket shares one connection with ordinary page loads instead of standing out as a lone long-lived connection. * **A cover website.** The server's host MUST serve an ordinary website (the operator's own, or a static default page). Any request that isn't a valid gateway handshake gets that site's normal response (its page, or its ordinary 404) with the same behaviour and timing. The server MUST NOT return a protocol-specific error, banner or header to an unauthenticated request. * **A secret gateway path.** The gateway's path SHOULD be chosen by the operator and contain at least 128 bits of randomness. It is given to users in invite links and through [discovery](#discovery-and-enumeration), not derived from a fixed pattern. * **No identifying strings** before authentication: no `Server` header naming Taper, no Taper-specific paths at fixed locations. * **No compression** (`permessage-deflate` MUST NOT be negotiated). Compressing before encryption leaks plaintext through ciphertext length. * **Mainstream TLS fingerprints.** Clients outside a browser, and servers making federation connections, SHOULD use a mainstream TLS stack whose ClientHello matches a common browser, and MUST NOT use a distinctive custom TLS configuration. Browser clients get this for free. * **No TLS inside TLS.** Taper MUST NOT tunnel another TLS session inside the gateway connection; nested handshakes are detectable even when padded. ### Padding {#padding} Message lengths and timing reveal a great deal, even when content is encrypted. Research has identified the members and administrators of encrypted group chats from timing and size alone. In an era of cheap large-scale traffic analysis, Taper treats lengths as metadata to protect. Taper pads with **Padmé** (Nikitin et al., PETS 2019), which costs at most about 12% and leaks only O(log log L) bits of a length L: padme(L): E = floor(log2(L)) S = floor(log2(E)) + 1 Z = E - S # number of low bits to round away mask = (1 << Z) - 1 return (L + mask) & ~mask with a minimum padded length of 256 bytes. * **Frames.** Every text frame sent on the gateway, in either direction, MUST be padded so that its UTF-8 length equals `padme(max(L, 256))`, by adding a top-level `pad` property containing filler characters. Receivers MUST ignore `pad`. * **Encrypted payloads.** Before encrypting a Megolm or Olm plaintext, clients MUST add a `pad` property to the payload so that its serialized length equals `padme(max(L, 256))`. Ciphertext lengths then reveal a length bucket, not the message length. * **Media** MUST be transferred in fixed-size chunks of 64 KiB (the last chunk padded), and encrypted media MUST be padded to `padme` of its size before encryption. * Servers SHOULD use TLS 1.3 record padding ([RFC 8446 section 5.4](https://www.rfc-editor.org/rfc/rfc8446#section-5.4)) where their TLS stack allows it. ### Timing {#timing} * **Heartbeats** MUST NOT run at a fixed interval. Servers MUST give each connection its own heartbeat interval, and clients MUST add random jitter of at least ±20% to each heartbeat. * **Batching.** Servers SHOULD batch dispatches to a connection over a short random window (for example 50 to 200 milliseconds), so delivery timing doesn't mirror sending timing exactly. * **High-risk mode.** Clients MAY offer a mode that sends padded `{"op": "noop"}` frames at random (Poisson) intervals while the app is open. Servers accept `noop` silently (bounded only by the connection's rate limit). This defeats cheap classifiers. It does not defeat an adversary who can watch the whole network, and it costs bandwidth and battery. ### Discovery and enumeration {#discovery-and-enumeration} Tor's disguised bridges were lost mainly to *enumeration*, not to traffic analysis: censors collected the addresses from public distribution channels. A public list of servers is a ready-made blocklist. Therefore: * Servers MUST NOT publish lists of other servers, and the protocol defines no public directory of servers. * Servers MAY serve `/.well-known/taper/client` for convenience. Operators who need stealth SHOULD disable it and distribute the gateway address and path out of band, for example in invite links. * Servers SHOULD publish their available transports in **signed server metadata**, given to authenticated users and federating servers only. ### Optional transports {#optional-transports} Advertised in signed server metadata. None is required. | Transport | What it gives | Costs | |-----------|---------------|-------| | **Tor onion service (v3)** | Hides the server's location; the address is the key, so no CA or DNS is needed; built-in proof-of-work defence against connection floods. Servers at risk SHOULD offer one, for clients and federation. | Latency; running Tor; onion addresses are themselves blocked in some places unless bridges are used. | | **Behind another site** | The gateway path lives on a popular site the operator already runs, or behind a CDN, in the style of Tor's WebTunnel. | Defeated by enumeration, so pair it with private distribution. | | **Encrypted Client Hello** ([RFC 9849](https://www.rfc-editor.org/rfc/rfc9849)) | Hides the server name, but only when the server sits behind a large CDN that serves ECH for many sites. | A lone server's ECH stands out. Russia blocks some ECH; China and Iran block ECH configuration lookups. Never rely on it alone. | | **Tor pluggable transports** | obfs4, Snowflake or WebTunnel can wrap the connection using the Tor pluggable-transport interface, reusing tools that are already maintained. | Each transport adds testing and support load. | Taper does not specify a mode that impersonates a third party's website during the TLS handshake (as Xray's REALITY does). It is strong against some censors, but it isn't browser-compatible, it depends on fragile choices of target site, and it impersonates other organisations. Operators may still run such a proxy in front of a server; that is outside the protocol, and the deployment guide in the repository (`deploy/README.md`) covers what it takes to do it without undoing the protections above. ### Onion services {#onion-services} A server MAY be reachable as a Tor onion service (version 3), alongside or instead of its ordinary address. Onion services hide where the server is, hide who connects to it, need no DNS or certificate authority, and resist connection floods with Tor's proof-of-work defence. **Names.** A server whose only address is an onion service SHOULD use its onion address as its [server name](/appendices/#server-name), so user IDs look like `@alice:<56 characters>.onion`. Version 2 onion addresses MUST NOT be used. **Encryption.** An onion service connection is encrypted end to end, and the address itself authenticates the server, so TLS is OPTIONAL there and plain `ws://` is allowed to onion addresses. It is not allowed anywhere else except loopback: a connection through a Tor exit can be read and changed by the exit. Tor's own handshakes are not post-quantum yet (they use X25519 and Ed25519), so traffic recorded today could be decrypted by a future quantum computer. Operators for whom that matters SHOULD also run TLS with the key exchange required by the [algorithm policy](#algorithm-policy) inside the onion service. **Discovery.** Version 3 onion addresses can't be enumerated from Tor's directory, but they can leak like any link. Servers SHOULD still use a [secret gateway path](#transport-baseline), MAY require Tor's client authorization so that only invited users can reach the service at all, and SHOULD NOT link their ordinary site to the onion service (for example with an `Onion-Location` header) unless the operator wants the two connected publicly. **Floods.** Servers SHOULD enable Tor's proof-of-work defence for onion services (`HiddenServicePoWDefensesEnabled`), and SHOULD limit streams per circuit. **Federation over Tor.** A server that federates through Tor: * MUST send every outbound federation connection, including key document fetches, through Tor's SOCKS5 port, with the destination as a host name (address type 3). It MUST NOT resolve peer names itself, so nothing leaks to DNS; * SHOULD put each peer on separate circuits, using Tor's stream isolation by SOCKS username and password; * MUST refuse a peer address with plain `ws://` unless it is an onion or loopback address. Without TLS there is no channel binding, so the `channel` value in the [federation handshake](/server-server-api/#mutual-authentication) is the empty string. The handshake stays safe against relaying because the signed transcript names both servers, and the onion address authenticates the destination. **Clients.** Native clients SHOULD connect through Tor's SOCKS port with stream isolation, as servers do. In Tor Browser, the Safer and Safest security levels block WebAssembly (enforced by NoScript since Tor Browser 15.0). Taper's web client needs WebAssembly for Olm and Megolm and for [OPAQUE](#password-authentication-opaque), so it runs only at the Standard level. Clients SHOULD say so plainly rather than failing silently. Users who need the stricter levels should use a native client. **Where Tor is blocked.** Some censors (China among them) block Tor's public relays. Users there need Tor bridges: Snowflake, WebTunnel or obfs4. Bridges are configured in the user's Tor client, not in Taper. ## Metadata minimization {#metadata} Besides [padding](#padding) and [timing](#timing): * Servers MUST NOT persist ephemeral data units (typing notifications, read receipts, presence) beyond delivering them, except the latest read receipt per user and room, which clients need. * Clients SHOULD let users turn off sending read receipts and typing notifications, and SHOULD make the choice easy to find. * Push notifications carry only event IDs (see the [Push Gateway API](/push-gateway-api)). * Servers keep counters, not logs (see [Scraping Resistance](/client-server-api/#counters-not-logs)). * Clients fetching identity keys or proofs from third parties (keyservers, Web Key Directories, ASP servers) SHOULD cache them and MAY fetch through Tor or a proxy, because each fetch tells that third party whom the user is looking up. ## Encryption at rest {#encryption-at-rest} Servers MUST encrypt all stored event content, media and derived data at rest, and MUST use crypto-shredding to enforce [message retention](/client-server-api/#message-retention): * Data MUST be encrypted with keys that rotate at least once per day. * Each key MUST be destroyed once every item it protects has expired. That makes every copy unreadable at once, including copies in replicas and backups. * Encryption keys MUST NOT be stored alongside the data they protect, or in the same backups. They SHOULD be held in a hardware security module or a separate key-management service. * Backups MUST be encrypted, and MUST NOT contain the keys needed to read them. Clients have equivalent requirements (see [local storage](/client-server-api/#local-storage)). ## Password authentication (OPAQUE) {#password-authentication-opaque} Taper uses **OPAQUE** ([RFC 9807](https://www.rfc-editor.org/rfc/rfc9807)), an augmented password-authenticated key exchange. The server never receives the password, or anything from which it could be computed without a dictionary attack, and a stolen server database doesn't allow precomputed dictionary attacks. Servers MUST NOT offer `t.login.password`, and clients MUST NOT send a password to a server in any form. RFC 9807 is an Informational document from the IRTF's Crypto Forum Research Group. Taper makes it normative: compliance means implementing its normative text in full, as listed below. ### Configuration The Taper configuration, `taper-opaque-v1`, is: | Parameter | Value | |-----------|-------| | OPRF | `ristretto255-SHA512` ([RFC 9497](https://www.rfc-editor.org/rfc/rfc9497), modeOPRF) | | KDF | HKDF-SHA-512 | | MAC | HMAC-SHA-512 | | Hash | SHA-512 | | KSF | Argon2id with S = zeroes(16), p = 4, T = Nh, **m = 2^16 (64 MiB)**, t = 3, v = 0x13, K = nil, X = nil, y = 2 | | Group | ristretto255 | | Context | the empty string | This is the first configuration RFC 9807 recommends, except for the KSF's memory and passes. The RFC's m = 2^21 means 2 GiB of memory on the client, which phones and browsers can't reliably provide. 64 MiB with three passes is the second recommended option of [RFC 9106](https://www.rfc-editor.org/rfc/rfc9106). Changing any part of the configuration requires every user to register again, so it is versioned. The context is empty because the audited WebAssembly build of opaque-ke (`@serenity-kit/opaque`) doesn't let applications set it. Cross-protocol separation still holds: the key exchange binds `server_identity`, which is the server name, and the configuration has its own version. A future configuration SHOULD set the context to its own name once the libraries allow it. ### Identities and credential identifier * `credential_identifier` is the user's full user ID. It MUST NOT be shared between users. * `client_identity` is the user ID and `server_identity` is the server name. Both are fixed for the life of the record, so both MUST be included in the key exchange. * The server's OPRF seed is global and MUST be persisted, together with the server's AKE key pair. ### Flows OPAQUE messages are carried as unpadded URL-safe base64 in gateway requests. The server keeps the state between the two halves of each flow for at most 60 seconds. | Method | Request | Response | |--------|---------|----------| | `t.opaque.register.start` | `username`, `registration_request`, plus whatever registration needs (token, invite, challenge response) | `registration_response`, `registration_id` | | `t.opaque.register.finish` | `registration_id`, `registration_record` | `user_id`, `access_token`, `device_id` | | `t.opaque.login.start` | `username`, `ke1` | `ke2`, `login_id` | | `t.opaque.login.finish` | `login_id`, `ke3` | `user_id`, `access_token`, `device_id` | | `t.opaque.password.change` (authenticated) | runs the registration flow again | replaces the record | **Re-authentication.** Some operations need fresh proof of the password, for example replacing a [cross-signing](/client-server-api/#cross-signing) identity. The client runs `t.opaque.login.start`, then sends `{"type": "t.login.opaque", "login_id", "ke3"}` as the operation's `auth` instead of calling `t.opaque.login.finish`. The server verifies KE3 exactly as for a login, checks that it belongs to the requesting user, and issues no token. Each proof is single use. Clients MUST obtain the proof before changing any local key material, so a wrong password leaves the device's state untouched. ### Compliance Implementations MUST: 1. Validate every peer public key (a valid group element, not the identity), and abort if a shared secret is the identity element (RFC 9807 sections 5 and 10.7). 2. Default any identity that isn't given to the party's public key (section 4). 3. Delete all intermediate values after an envelope recovery error (section 4.1.3). 4. On the server, verify the KE3 MAC before using the session key, and never release a session key or token if it fails (section 6.4). 5. On the client, not use `export_key` before the server has been authenticated (section 6). 6. **Prevent client enumeration**: respond to login attempts for unknown users with a fake record, as in section 6.3.2.2. Lookups and the fake path MUST take the same time as real ones (sections 6.3.2.2 and 9.1). 7. Check the size of every received message and reject malformed ones (section 9.3). 8. Pass the test vectors in RFC 9807 Appendix C for the components they implement. 9. Count a login that never sends KE3 as a failed attempt for rate limiting, because the client learns the outcome from KE2 (section 9.2), and rate-limit registration, which can't hide whether a username exists (section 10.9). 10. Run registration only over the TLS-protected gateway, because the masking key must stay confidential (section 10.10). Servers SHOULD NOT enforce password policies, which OPAQUE prevents them from checking properly (section 10.11). Clients enforce them before registering. ### Identity recovery {#identity-recovery} A user's [cross-signing](/client-server-api/#cross-signing) identity must survive new devices, or every login looks like an identity change and verification loses its meaning. Taper keeps the identity's private keys on the server, sealed with a key that only the user's password can produce: * The client derives a key with HKDF-SHA-512 from OPAQUE's `export_key`, with salt `"t.secrets.v1.aes-gcm"` and info `"identity recovery|"` followed by the user ID, and uses it for AES-256-GCM with a random 96-bit IV and the user ID as additional data. * The plaintext is the JSON object `{master, self_signing, user_signing}` (the private key seeds, unpadded base64), [padded](#padding) with `pad`. * The sealed object is `{"algorithm": "t.secrets.v1.aes-gcm", "iv", "ciphertext"}` (standard base64, unpadded), at most 16 KiB. | Method | Request | Response | |--------|---------|----------| | `t.secrets.get` (authenticated) | `{}` | `{secrets}`, or `{secrets: null}` | | `t.secrets.put` (authenticated) | `{secrets, auth?}` | `{}` | Storing the first copy needs only the session. Replacing a stored copy needs [re-authentication](#password-authentication-opaque) in `auth`, so a stolen access token can't destroy it. Servers MUST NOT interpret the contents. When a client logs in on a new device and the account already has an identity, it MUST try recovery before offering to replace the identity: open the copy, import the keys (checking that they match the published master, self-signing and user-signing keys), and sign its own device. Only if that fails may it replace the identity, and it then stores the new one. `export_key` MUST NOT leave the client, and clients MUST NOT use it before the server has authenticated itself (section 6 of RFC 9807). An attacker with the server's database still can't open the copy without guessing the password and running OPAQUE against the server's OPRF key, which is held apart from the data (see [encryption at rest](#encryption-at-rest)). Changing the password changes `export_key`, so a [password change](#password-change) stores a newly sealed copy in the same step. Room keys are not part of this copy. They have their own, with a shorter life: see [room-key backup](#room-key-backup). As of late 2026, the most mature implementation of the final RFC is opaque-ke 4.x (Rust; also compiled to WebAssembly as `@serenity-kit/opaque`, which 7ASecurity reviewed). The NCC Group audit of opaque-ke, in 2021, covered an earlier draft, so implementations SHOULD verify it against the RFC test vectors themselves. The WebAssembly build exposes no way to run them with fixed randomness; run them against opaque-ke itself, at the same version. `@serenity-kit/opaque` 1.1.0 can be pushed into a broken state by malformed input, fixed in a later release. Item 7 above (check the size of every message before using it) protects against this, and servers MUST NOT skip it. ### Password change {#password-change} OPAQUE registration is interactive, so a change takes two requests, both by an authenticated session: | Method | Request | Response | |--------|---------|----------| | `t.password.change.start` | `{auth, key_auth?, registration_request}` | `{registration_response, change_id}` | | `t.password.change.finish` | `{change_id, registration_record, secrets, backup}` | `{}` | `auth` is a fresh proof of the *old* password (the `t.login.opaque` object used for any [re-authentication](#password-authentication-opaque)), and `key_auth` a [security key](#security-keys) touch when the account has keys. In `finish`, `secrets` is the [identity copy](#identity-recovery) and `backup` the [room-key backup](#room-key-backup) parts, each sealed again under the *new* `export_key`. The server checks all of it, then replaces the OPAQUE record, the identity copy and the backup together, or changes nothing. Login proofs begun before the change are void: a login flow remembers the OPAQUE record it started against, and flows are also dropped on suspension, unlock and deletion. A change that leaves out `secrets` when a copy exists is refused: the old copy would no longer open. Every other device is then signed out: its token is revoked and its device keys are forgotten. The device that made the change stays signed in. ### Room-key backup {#room-key-backup} A device that logs in later can read the messages still within [retention](/client-server-api/#message-retention) if it can get their Megolm keys. The server keeps them, sealed under a key it can't make: * The key is 32 bytes from HKDF-SHA-512 over `export_key`, with salt `"t.backup.v1.aes-gcm"` and info `"room key backup|"` followed by the user ID. It is not the identity key. * A *part* is an AES-256-GCM seal of `{keys}`, where `keys` is a JSON string of exported room keys, [padded](#padding) with `pad`. Its additional data is the user ID, `"|"`, and the part's name. A part holds at most 512 KiB of ciphertext; an account at most 200 parts and 8 MiB. * A part is named for the UTC day it was uploaded and a number, `2026-01-31.0`. Servers accept only today's and yesterday's day, and drop each part 21 days (the retention period) after its day begins, so a key does not outlive the messages it opens by more than the days between receiving it and uploading it. Stored parts are encrypted at rest under the period key, like events. * A part is written once: `t.backup.put` for a name that exists fails with `T_PART_EXISTS`, and the client takes the next number. Two devices on the same day therefore can't overwrite each other's keys. | Method | Request | Response | |--------|---------|----------| | `t.backup.put` | `{part, blob}` | `{}` | | `t.backup.get` | `{}` | `{parts: {name: blob}}` | | `t.backup.clear` | `{}` | `{}` | Clients upload new keys soon after receiving or making them, import every part at login, and let users turn the backup off, which calls `t.backup.clear`. Backed-up keys are as safe as the password: someone who has the server's OPAQUE record and key can guess a password offline, and with it open the last 21 days. Users who can't accept that turn the backup off. ### Security keys {#security-keys} Users may register FIDO2/WebAuthn authenticators, such as a YubiKey. A key confirms sensitive actions, can be required at login, and can back a public indicator. It is not a proof of humanity: it shows that someone once held a device, not that a person wrote a message. Servers, clients and documents MUST NOT describe it as one. Servers verify WebAuthn Level 2 registrations and assertions with the algorithms ES256, EdDSA and RS256. The relying party is the web page's own host name: the origin comes from the WebSocket handshake, it MUST be `https` (or `http` for `localhost` and `.onion`), and an IP address is not a valid relying party. A key works only on the site it was registered on. Challenges are 32 random bytes, single use, valid 60 seconds, and bound to the account and the origin. A signature counter that goes backwards (when it is not always zero) is refused as a cloned key. **Attestation.** Registration asks for `direct` attestation. The server reads the `packed` and `fido-u2f` formats and sets the key's *level*: * `attested`: the attestation certificate chain verifies up to a root the operator trusts (`TAPER_WEBAUTHN_ROOTS`, a directory of PEM files), the signature is valid, and the credential isn't backup-eligible (a synced passkey). * `unattested`: anything else, including no attestation, self-attestation, an untrusted chain, and formats the server doesn't verify. A software authenticator can reach this level. The server then discards the certificate, the AAGUID and everything else about the device's make: they identify its model, and a model is a fingerprint. It stores only the credential ID, the public key, the signature counter, a nickname, the level, the creation time and the relying party. | Method | Request | Response | |--------|---------|----------| | `t.webauthn.list` | `{}` | `{keys: [{id, nickname, level, created_ts}], show_indicator, login_requires_key}` | | `t.webauthn.challenge` | `{}` | `{challenge_id, options}` (for a touch; pass `{challenge_id, credential}` as `key_auth`) | | `t.webauthn.register.start` | `{auth, key_auth?, attachment?}` | `{challenge_id, options}` | | `t.webauthn.register.finish` | `{challenge_id, credential, nickname?}` | `{id, level}` | | `t.webauthn.remove` | `{id, auth, key_auth?}` | `{}` | | `t.webauthn.settings` | `{show_indicator?, login_requires_key?, auth?, key_auth?}` | the new settings | | `t.webauthn.login` (before login) | `{ticket, credential}` | the login result | **Step-up.** Replacing the identity copy or the cross-signing identity, changing the password, adding or removing a key, deleting the account, and changing `login_requires_key` all need `auth` (the password) and, if the account has any key, `key_auth` (a touch). `key_auth` may also sit inside `auth`. The error `T_FORBIDDEN` with `needs: "security_key"` says a touch is missing. **Login.** When `login_requires_key` is on, `t.opaque.login.finish` returns `{second_factor: {type: "t.webauthn", ticket, options}}` instead of a token. The client answers with `t.webauthn.login`. **The indicator.** With `show_indicator` on, the user's server includes `hardware_keys: {user_id: level}` in key query responses to users who are both *joined* to a room with them (an invitation is not enough), and to peers asking about its users. Turning `show_indicator` on needs `auth` and `key_auth`; turning it off needs only the session. A server speaks only for its own users, and only the two levels are valid. Clients show a small badge and MUST say what it means: that the person's server says they hold a key, that `unattested` could be software, and that it proves nothing about who writes. The default is off, and turning it off removes it at once. ### Account deletion and device management {#account-deletion} `t.account.delete`, with `auth` and any `key_auth`, removes the account: it leaves its rooms, revokes its tokens, forgets its devices and their keys, deletes its identity copy, security keys, cross-signing keys and backup, and reserves the user ID so nobody can register it later and pass for the old owner. It does not remove events the user already sent: they expire with everything else. To revoke a single lost or compromised device without changing the password: | Method | Request | Response | |--------|---------|----------| | `t.devices.list` | `{}` | `{devices: [{device_id, issued_ts, expires_ts, current, has_keys}]}` | | `t.devices.delete` | `{device_id, auth, key_auth?}` | `{}` | `t.devices.delete` needs fresh `auth` (and `key_auth` if the account has security keys), revokes every token for `device_id`, forgets its device keys (notifying shared rooms so contacts rotate Megolm sessions), and closes its live connections. ## Trust tokens (Privacy Pass) {#trust-tokens-privacy-pass} [Scraping Resistance](/client-server-api/#scraping-resistance) asks some users to solve [challenges](/client-server-api/#challenges). Users a server trusts can skip them by spending **trust tokens**: anonymous tokens issued with Privacy Pass ([RFC 9576](https://www.rfc-editor.org/rfc/rfc9576), [RFC 9577](https://www.rfc-editor.org/rfc/rfc9577), [RFC 9578](https://www.rfc-editor.org/rfc/rfc9578)). Trust stays useful without becoming a way to track people. ### Trust Each server decides locally how much to trust an account. A server: * MAY base trust on account age, its history of staying within [read budgets](/client-server-api/#read-budgets), contact with [canaries](/client-server-api/#canaries), and entries on subscribed [moderation policy lists](/client-server-api/#moderation-policy-lists); * MUST NOT base trust on device or browser fingerprints, location, contact lists or message content; * MUST NOT share trust scores with other servers. ### Issuance and redemption * Token type `0x0001` (VOPRF with P-384 and SHA-384, privately verifiable) is used, because each server issues and redeems its own tokens. * `t.trust.tokens` takes a batch of Privacy Pass `TokenRequest` structures and returns `TokenResponse` structures, as unpadded URL-safe base64. Servers decide how many tokens each account may hold, by trust. * A [challenge](/client-server-api/#challenges) MAY include a Privacy Pass `TokenChallenge` with an empty `redemption_context`. The client may answer with a `token` instead of solving the challenge. * Servers MUST reject tokens that have already been spent. ### Keeping tokens unlinkable Here the same server issues tokens, redeems them, and knows which account asked. RFC 9576 section 4.1 warns that this can link tokens to accounts unless issuance and redemption are separated. Therefore: * Clients MUST fetch tokens in batches ahead of need, and MUST NOT redeem a token in the same session or connection that fetched it. * Clients SHOULD wait a random interval before first redeeming a newly fetched batch. * Servers MUST publish one token issuance key at a time, in signed server metadata. Clients MUST check that the key they were issued under matches the published key fetched without authentication, and MUST discard tokens that don't. That stops a server from tagging individual users with their own keys. ## Group encryption {#group-encryption} No deployed or standardised system provides deniability together with strong recovery from key compromise for large groups (see the [research summary](#group-encryption-research) below). Taper keeps Megolm, whose deniability rests on deniable pairwise channels, and tightens it: * Clients MUST rotate their outbound Megolm session whenever any member leaves or is removed from the room, and whenever a member's device list changes. * `rotation_period_ms` MUST NOT exceed 86400000 (one day), and `rotation_period_msgs` MUST NOT exceed 100. * Session keys are shared only over Olm, which becomes post-quantum hybrid as described under [algorithm policy](#algorithm-policy). * **No unsigned devices.** Clients MUST NOT share room keys with devices that are not cross-signed by their owner's identity, and MUST reject messages, encrypted state, and Olm to-device messages from non-cross-signed devices (defeating malicious-homeserver ghost-device impersonation). * **No in-band room key forwarding.** Clients MUST disable automatic `t.room_key_request` and `t.forwarded_room_key` handling, preventing key-share confusion attacks and retention bypasses. Multi-device recovery uses only the OPAQUE-sealed, retention-bounded [room-key backup](#room-key-backup). * **Verified-only rooms.** Clients SHOULD offer a per-room verified-only mode that refuses to encrypt messages or state to any unverified member, defeating silent member injection by a hostile homeserver. * **One-time key exhaustion defence.** Servers MUST meter `t.keys.claim` and `t.fed.keys.claim` and throttle repeated claims by one requester against a single target device, stopping attackers from draining a device's one-time keys onto its static fallback key. ### Research summary {#group-encryption-research} Informative. | Design | Deniability | Recovery after compromise | Scale | Maturity | |--------|-------------|---------------------------|-------|----------| | Pairwise fan-out (every message sent over each member's pairwise session) | Strongest (MACs only) | Per pair, only when that pair exchanges messages | O(n) per message | Deployed by Signal until 2021 | | Megolm / Signal Sender Keys | Depends on the pairwise handshake | Weak (rotation only) | O(1) per message | Deployed | | MLS ([RFC 9420](https://www.rfc-editor.org/rfc/rfc9420)) | None: every message is signed | Strong | Thousands | Standard | | MLS with ephemeral signing keys bound over deniable pairwise channels | Plausible, unproven | Strong | Thousands | Suggested in RFC 9750; no proof | | MLS with epochal signatures (Hülsing and Weber, IEEE S&P 2021) | Deniable after each epoch | Strong | Thousands | Research only | The most promising future direction is a hybrid: pairwise fan-out for small groups, and MLS with post-quantum ciphersuites for large ones, where each member's signing keys are ephemeral, rotated with every update, and bound to their identity only over deniable pairwise channels. Neither half is proven to give deniability and strong compromise recovery together, and running two modes adds complexity and room for downgrade attacks. A future room version will make this choice.