Python's Crypto Library Now Ships Post-Quantum Algorithms by Default
pyca/cryptography 48 adds NIST-standard ML-KEM and ML-DSA support, putting quantum-resistant primitives one pip install away for one of PyPI's most-downloaded packages — with no emergency forcing the move.
Key Takeaways
- pyca/cryptography version 48 adds Rust-backed support for ML-KEM (key establishment) and ML-DSA (digital signatures), the NIST-standardized post-quantum primitives, funded by the Sovereign Tech Agency.
- pyca/cryptography is the eleventh most-downloaded package on PyPI, with roughly 1.2 billion downloads in the past month, so this ships quantum-resistant crypto to a huge share of the Python ecosystem at once.
- ML-DSA-65 and ML-KEM-768 keys and signatures are far larger than their classical equivalents (e.g. a 1,952-byte ML-DSA-65 public key vs. 32 bytes for Ed25519), which breaks length-prefix and buffer-size assumptions baked into existing code.
- A June 22, 2026 White House order set federal deadlines — post-quantum key establishment by December 31, 2030 and signatures by December 31, 2031 — giving the release practical urgency beyond general crypto hygiene.
As covered by Bruce Schneier, pyca/cryptography — the library underpinning TLS, certificate handling, and most cryptographic operations across the Python ecosystem — now ships NIST-standard post-quantum primitives out of the box. As of version 48, ML-KEM (key establishment) and ML-DSA (digital signatures) are available via Rust bindings, with funding from the Sovereign Tech Agency and implementation work led by Trail of Bits.
Why this release matters more than a typical library update
pyca/cryptography isn't a niche dependency. Trail of Bits notes it's currently the eleventh most-downloaded package on PyPI, pulling roughly 1.2 billion downloads in the past month alone. When a library at that scale adds post-quantum support directly — rather than leaving it to a fragmented ecosystem of third-party bindings — the effective floor for what's easy to implement moves for a huge share of Python services overnight.
The release adds AWS-LC as a supported cryptographic backend alongside the existing OpenSSL-based path, and includes cross-binding API surface and test coverage for both ML-KEM and ML-DSA.
The migration isn't just a primitive swap
Trail of Bits is explicit that treating this as a drop-in replacement is a mistake. Post-quantum keys and signatures are substantially larger than their classical equivalents:
- ML-KEM-768 public key: 1,184 bytes, versus 32 bytes for X25519
- ML-DSA-65 public key: 1,952 bytes, versus 32 bytes for Ed25519
- ML-DSA-65 signature: 3,309 bytes, versus 64 bytes for Ed25519
Code that assumes fixed-size buffers, hardcoded length prefixes, or fits keys into a QR code or a database column sized for classical crypto will break. ML-KEM also works differently in kind, not just in size — it uses encapsulation and decapsulation rather than a Diffie-Hellman-style exchange, which has implications for anywhere key-exchange logic is hand-rolled rather than delegated to a higher-level protocol library.
No emergency, but a real deadline
Schneier's framing — "the reason to do this now is because there's no emergency" — is a deliberate contrast with most security migrations, which happen under incident pressure. There is, however, a concrete policy driver: a June 22, 2026 White House order directs U.S. federal agencies to accelerate post-quantum migration, with post-quantum key establishment required by December 31, 2030 and digital signatures by December 31, 2031. Organizations with federal supply-chain exposure, or that simply want to avoid a rushed migration later, now have a maintained, mainstream path to start testing against.
What this means for teams running Python services
This release is an opportunity to build crypto-agility rather than an immediate mandate to re-key production systems. Practical next steps: inventory where your services do key exchange or signing with cryptography today, check that transport and storage assumptions (message sizes, certificate chain lengths, protocol buffers) can absorb ML-KEM/ML-DSA's larger payloads, and treat any near-term adoption as hybrid — pairing post-quantum primitives with existing classical ones — until surrounding protocol stacks (TLS libraries, HSMs, PKI tooling) catch up. Verify version and backend support directly against the pyca/cryptography documentation before relying on any third-party summary, including this one.
How PyramidLedger helps
For clients assessing where post-quantum migration intersects with existing key management, TLS configuration, and certificate infrastructure, this kind of dependency-level change is exactly the sort of thing worth surfacing in a security review before it becomes an emergency-driven scramble.
Frequently Asked Questions
What are ML-KEM and ML-DSA?
They are NIST-standardized post-quantum cryptographic algorithms: ML-KEM is used for key establishment (replacing Diffie-Hellman-style exchanges like X25519), and ML-DSA is used for digital signatures (replacing algorithms like Ed25519 or ECDSA). Both are designed to resist attacks from sufficiently powerful quantum computers.
Do I need to migrate my Python code to post-quantum crypto right now?
Not urgently for most organizations — there's no active quantum threat forcing immediate action. But if you're subject to federal supply-chain requirements, the relevant deadlines are key establishment by December 31, 2030 and signatures by December 31, 2031, per the June 2026 White House order. Everyone else benefits from starting to test now, since the larger key and signature sizes require code changes beyond swapping one function call for another.
Does this replace TLS or certificate infrastructure automatically?
No. `pyca/cryptography` 48 adds the underlying primitives (ML-KEM, ML-DSA) as Rust-backed bindings, but broader adoption in TLS libraries, PKI tooling, and certificate authorities is a separate, ongoing effort. Treat this as a foundation for hybrid classical/post-quantum deployments, not a finished migration path.
Sources
- 1Python Now Has a Post-Quantum Encryption Library — Schneier on Security
- 2Shipping post-quantum cryptography to Python — Trail of Bits