Post-quantum security
did:guardian v1.0.0 is post-quantum. Every key in the method is an ML-DSA-44 key, and every proof in a log is an ML-DSA-44 signature. The reference registrar signs every access token with ML-DSA-44 too. This page lists what each part uses, how to check it, and what limits remain.
What post-quantum means here
A large quantum computer could break the elliptic-curve and RSA algorithms that most systems use today. It could forge signatures for any published public key, and it could decrypt recorded traffic that used classical key agreement.
The did:guardian method uses signatures and hashes only. It has no key agreement and no encryption. Logs are public and contain no secrets, so recording them today gives an attacker nothing to decrypt later. The risk to the method is forgery. A party that could forge a signature for a published key could forge any operation for that identity, including one that replaces its keys.
For that reason the method uses ML-DSA-44 (FIPS 204) for every signature and SHA-256 for every hash. Both are designed to resist attacks by quantum computers. ML-DSA-44 targets NIST security category 2. See Section 12, "Quantum computers" of the specification.
ML-KEM, the post-quantum key agreement algorithm, is not part of the method. It appears only in TLS, which Cloudflare terminates for the registrar.
What each part uses
| Part | Algorithm | Standard | Quantum status |
|---|---|---|---|
| Method keys and proofs | ML-DSA-44, cryptosuite mldsa44-jcs-2024 |
FIPS 204; W3C Quantum-Resistant Cryptosuites v1.0 (Working Draft) | Post-quantum |
| Hashes (operation hashes, anchors, signed data) | SHA-256 | FIPS 180-4 | Designed to resist quantum attacks |
| Registrar-held private keys at rest | AES-256-GCM | FIPS 197, SP 800-38D | Symmetric, 256-bit key |
| Passwords and login secrets | PBKDF2-HMAC-SHA256 | SP 800-132 | Symmetric |
| Client secrets, registration access tokens, refresh tokens | 256-bit random values, stored as SHA-256 digests | FIPS 180-4 | Symmetric |
| OIDC access tokens | JWS, ML-DSA-44 | RFC 9964, FIPS 204 | Post-quantum |
| OIDC ID tokens | ML-DSA-44 or ES256, chosen per client | RFC 9964, FIPS 204; FIPS 186-5 for ES256 | Post-quantum with ML-DSA-44. Not post-quantum with ES256. |
| TLS to the registrar | Hybrid X25519 + ML-KEM-768, negotiated by Cloudflare | Set by Cloudflare | Post-quantum key agreement with clients that support the hybrid |
Method keys and proofs
A key is an ML-DSA-44 public key of 1312 bytes, encoded as a Multikey. The encoding is the multicodec header 0x90 0x24 (code 0x1210) followed by the key, encoded as base64url without padding, with the multibase prefix u. Every key therefore starts with ukC. After the prefix u, a key has 1752 base64url characters. See Section 5.3.
A proof is a W3C Data Integrity proof with the cryptosuite mldsa44-jcs-2024. The signature is 2420 bytes. proofValue is the signature in base64url with the prefix u. See Section 5.4.
The method has no other key type. A verifier reports a log that contains a key of a type it does not implement as unsupported (REQ-8-1), never as valid.
Registrar-held keys
The reference registrar holds keys for identities that have not taken custody of their own key. It stores each private key as a 32-byte ML-DSA-44 seed, encrypted with AES-256-GCM under the deployment's KEY_ENCRYPTION_KEY. The stored value has the form v1.<key id>.<iv>.<ciphertext>. The key id is the first 8 bytes of the SHA-256 digest of KEY_ENCRYPTION_KEY, in hex. Each value is bound, as GCM additional data, to its DID and public key, or for an OIDC signing key, to its algorithm and public key. A ciphertext moved to another row fails to decrypt.
Passwords and secrets
The registrar hashes passwords and login secrets with PBKDF2-HMAC-SHA256 and a 16-byte random salt. The iteration count is PBKDF2_ITERATIONS. The default is 100,000, which fits the Workers Free plan. OWASP recommends 600,000, which suits a paid plan. The registrar rejects values below 100,000. On a successful login, a hash with fewer iterations than the current count is hashed again. The root identity's ROOT_WARD_LOGIN_SECRET is hashed the same way.
Client secrets, registration access tokens and refresh tokens are 256-bit random values. The registrar stores only their SHA-256 digests and compares them in constant time.
OIDC tokens
Access tokens, including tokens issued by token exchange, are always JWS signed with ML-DSA-44 (RFC 9964: JWK kty "AKP", alg "ML-DSA-44", public key in pub, empty context string). The registrar accepts only ML-DSA-44 access tokens, including from federated registrars. Refresh tokens are opaque.
ID tokens are signed with the algorithm each client chooses at registration: "ES256" or "ML-DSA-44". The default is ES256, because most relying-party libraries cannot verify ML-DSA-44 yet. An operator can set OIDC_ES256 to "disabled". All ID tokens are then ML-DSA-44. See Sign in via custom OIDC.
Size and cost
ML-DSA-44 keys and signatures are larger than elliptic-curve ones. A public key is 1312 bytes and a signature is 2420 bytes. A create with one key, one proof and the registrar's attestation is about 12.5 KB, so logs are much larger than logs with P-256 keys would be.
Signing is fast. On Cloudflare Workers with the built-in ML-DSA-44, one signature costs about 0.15 to 0.25 ms of CPU. This fits the Workers Free plan's limit of 10 ms of CPU per request.
The reference library uses the runtime's Web Crypto ML-DSA-44 where it exists: Node.js 24.7 or later, Cloudflare Workers with the webcrypto_modern_algorithms compatibility flag, and recent Chromium. Elsewhere it uses @noble/post-quantum. Its tests check that the two interoperate. The registrar's Wrangler configuration sets the compatibility flag. Without it, the registrar falls back to @noble/post-quantum, which works but uses more CPU.
Check it yourself
Each check below runs against code or data you can inspect.
Run the clean-room suite. interop_tests/cleanroom is an independent Python verifier, written from the specification text alone. It uses pyca/cryptography with OpenSSL for ML-DSA-44. It needs pyca/cryptography 48 or later, built against an OpenSSL with ML-DSA. From a clone of the repository:
cd interop_tests/cleanroom && python3 -m venv .venv && .venv/bin/pip install cryptography && .venv/bin/python run.py
It runs 428 conformance vectors. It also verifies the W3C mldsa44-jcs-2024 test vector: the proof in Appendix A, Example 22 of the W3C draft.
Run the reference library's tests. From the repository root:
npm test --workspace=packages/lib
The reference library and the clean-room verifier agree on all 428 vectors. The library also verifies the W3C test vector.
Resolve any DID. Fetch a log:
curl https://guardianspec.org/.well-known/guardian/_/log
Every key starts with u, and every proof has "cryptosuite": "mldsa44-jcs-2024". The DID document at /.well-known/guardian/<name> lists each key as a Multikey whose publicKeyMultibase starts with u.
Read the OIDC keys.
curl https://guardianspec.org/.well-known/jwks.json
The JWKS has a key with "kty": "AKP" and "alg": "ML-DSA-44". Unless the operator disabled ES256, it also has a key with "kty": "EC" and "alg": "ES256". /.well-known/openid-configuration lists "id_token_signing_alg_values_supported": ["ML-DSA-44", "ES256"], or only ["ML-DSA-44"] when ES256 is disabled.
FIPS-approved algorithms
did:guardian and the reference registrar use only FIPS-approved algorithms:
- ML-DSA-44 (FIPS 204), for method proofs, access tokens and ML-DSA-44 ID tokens.
- SHA-256 (FIPS 180-4), for hashes and stored secret digests.
- AES-256-GCM (FIPS 197, SP 800-38D), for registrar-held keys at rest.
- PBKDF2 (SP 800-132), for passwords and login secrets.
- ECDSA P-256 (FIPS 186-5), only for ES256 ID tokens, when a client chooses them.
This is not a claim of FIPS 140-3 validation. Neither the Workers runtime's Web Crypto nor @noble/post-quantum is claimed as a validated cryptographic module.
Limits
ES256 ID tokens. A client that keeps the default, or asks for ES256, receives ID tokens signed with ECDSA P-256. Those signatures are not post-quantum. Access tokens are not affected. Request "id_token_signed_response_alg": "ML-DSA-44" at registration if your library supports it. An operator can remove ES256 with OIDC_ES256 set to "disabled".
Relying parties that validate access tokens. A relying party that validates access tokens itself needs a JOSE library that supports ML-DSA-44.
A draft cryptosuite. mldsa44-jcs-2024 is defined in a W3C Working Draft, which can change. REQ-5-12 defines the exact steps this method uses, so a change to the draft does not change the method.
Future key types. A later version of the specification can add key types to Table 1. A verifier that does not implement a new key type reports a log that uses it as unsupported (REQ-8-1).
A break of ML-DSA-44. A party that could forge ML-DSA-44 signatures could forge any operation for any published key, including an operation that replaces keys. Replacing keys after such a break would not help. A later version of the specification would then add a key type to Table 1, and identities would replace their keys with keys of that type before the break became practical. The hash chain, anchors and recorded versions depend on SHA-256 whatever the key type. See Section 12.
Encryption key rotation. The registrar does not yet support rotating KEY_ENCRYPTION_KEY. A changed key makes every stored private key unreadable.