Post-quantum cryptography in Workers

Cloudflare announced that its Workers platform now supports post-quantum-resistant algorithms within the Web Crypto API. These algorithms are defined in the Modern Algorithms in the Web Cryptography API draft community group report.

Which algorithms are supported?

  • ML-KEM-768 and ML-KEM-1024: For key encapsulation
  • ML-DSA-44, ML-DSA-65 and ML-DSA-87: For digital signatures
  • encapsulateBits(), decapsulateBits(), encapsulateKey(), decapsulateKey() functions
  • getPublicKey() and SubtleCrypto.supports() support
  • JWK import and export for these algorithms

Why it matters

Post-quantum migration is not a single switch. Many protocols such as TLS, SSH, HPKE and JWT need to learn new primitives. OpenSSH added support for mlkem768x25519 in 2024, and the IETF published RFC 9964 for ML-DSA. Cloudflare added the necessary cryptographic primitives to Web Crypto so developers can test these protocols on Workers.

How to use it

The support is available behind the webcrypto_modern_algorithms compatibility flag while the specification is still moving. With these opt-in APIs, developers can experiment with ML-KEM and ML-DSA without bundling a separate cryptographic implementation. Cloudflare notes that these are not a full migration path, but building blocks to validate your integration.