cryptography (pyca)
Official wheels ≥48.0.0 already provide ML-KEM, ML-DSA and hybrid HPKE, but only on an OpenSSL ≥3.5, AWS-LC or BoringSSL backend, and the X.509 verifier still accepts P-256 and RSA-2048.
- PyPI
cryptography- Version cited
- 51.0.0(changelog 1 Dec 2026; PyPI 2 Dec 2026 00:08:59 UTC). 51.0.1, fixing Fernet regressions, prepared 2 Dec but not on PyPI as of 3 Dec
- Downloads
- 1.38B/mo
Key exchange and encryption
PQ with action
ML-KEM, HPKE on capable backend
Signatures and identity
PQ with action
ML-DSA ≥48; no SLH-DSA
What to do
Pin cryptography>=48 (>=50 for ML-DSA path validation, >=51 for SSH composite keys; AGY suggests >=50.0.2), use official wheels, feature-detect UnsupportedAlgorithm, and move ECDH/X25519 to HPKE and ECDSA/Ed25519 to mldsa.
Since 1 Dec 2026 51.0.0 reached PyPI at 00:08 UTC on 2 Dec 2026, before the advisory, as a routine release. 51.0.1 (Fernet fixes, PRs #16119/#16120) was prepared 2–3 Dec, not on PyPI as of 3 Dec. HPKE context PR #16094 opened 1 Dec. No statement on the advisory.
Details
ML-KEM, ML-DSA, HPKE verifier accepts P-256, RSA-2048 no SLH-DSA
pyca/cryptography is a primitives library with no algorithm defaults of its own. It exposes P-256, X25519 and Ed25519 with no deprecation warnings, alongside ML-KEM-768/1024, ML-DSA-44/65/87 and PQ-hybrid HPKE. It is downloaded 1,384,688,995 times per 30 days (pypistats, 3 Dec 2026; pypistats), roughly as often as requests. It is a hard dependency of pyOpenSSL, paramiko, authlib, joserfc, jwcrypto and google-auth, and an optional one for PyJWT ([crypto]) and python-jose. It is not the TLS engine for most Python programs: the ssl module uses the interpreter’s own OpenSSL (TLS).
Exposed classical APIs (AGY report): SECP256R1, SECP256K1, Ed25519, X25519, DSA, DH.
What each release enabled#
| Release | PQ capability | Wheel OpenSSL |
|---|---|---|
| 47.0.0 (24 Apr 2026) | mlkem, mldsa on AWS-LC/BoringSSL only; HPKE with MLKEM768_X25519 (X-Wing) and MLKEM1024_P384 |
4.0.0 |
| 48.0.0 (4 May 2026) | ML-KEM and ML-DSA on OpenSSL ≥3.5.0, so in official wheels | 4.0.x |
| 49.0.0 (12 Jun 2026) | ML-DSA X.509 certificate, CSR and CRL signing; external mu; no x86_64 macOS or 32-bit Windows wheels | 4.0.1 (AGY) |
| 50.0.0 (31 Jul 2026) | Stable x509.verification admitting ML-DSA-44/65/87; MLDSAMuHasher; FFDH deprecated |
4.0.1 (AGY); 4.0.2/4.0.3 in 50.0.1/50.0.2 |
| 51.0.0 (1–2 Dec 2026) | ssh-mldsa44-ed25519 keys; PKCS#8 v2; ML-KEM keys in certificates (AGY); DSA deprecated |
4.1.1 |
The full release table, the 51.0.1 Fernet regressions (#16108/#16109, #16110/#16116) and the 51.0.0 test log are on the cryptography page. 50.0.0 also fixed CVE-2026-69247, a Bleichenbacher oracle in pkcs7_decrypt_der Claude.
Backend dependence#
backend.mlkem_supported() and mldsa_supported() are true only on AWS-LC, BoringSSL or OpenSSL ≥3.5 (including 4.x). LibreSSL and OpenSSL 3.0–3.4 raise UnsupportedAlgorithm. That catches distro packages on Debian 12 and Ubuntu 22.04/24.04, OpenBSD and other LibreSSL systems, and Intel Macs, which have had no x86_64 wheels since 49.0.0 and build from source against whatever OpenSSL they have. FIPS builds disable X25519, so MLKEM768_X25519 is unavailable there. Details and a feature-detection snippet: backend.
API summary#
- ML-KEM:
MLKEM768/MLKEM1024key classes, seed-only PKCS#8, no ML-KEM-512 (#14671 reverted, #15333 won’t-do). mlkem and mldsa. - ML-DSA:
MLDSA44/65/87, optional context up to 255 bytes, external mu viaMLDSAMuHasher; no HashML-DSA (#14827) or deterministic mode (#15442). - HPKE:
hpke.SuitewithKEM.MLKEM768_X25519orKEM.MLKEM1024_P384, single-shot; multi-message context in PR #16094. HPKE. - X.509: ML-DSA signing with
algorithm=None(≥49), path validation (≥50); the verifier still admits P-256 and RSA-2048 with no knob. X.509. - Gaps: no SLH-DSA (#14419), no ML-DSA in PKCS#7/CMS (PR #16054), no ML-KEM in CMS, no PQ keys in PKCS#12. Gaps.
Dependency floors#
Dependents allow versions as old as 3.3 (paramiko >=3.3), so pin cryptography>=48 yourself; see floors. The AGY report recommends upgrading to >=50.0.2, or 51.0.1 once published, and avoiding OS-packaged cryptography linked to OpenSSL below 3.5.
Release provenance#
The 51.0.0 sdist’s PEP 740 provenance names publisher pyca/cryptography and workflow pypi-publish.yml, with an ECDSA P-256 Fulcio leaf valid for ten minutes (2 Dec, 00:08:37–00:18:37 GMT) and a Rekor v1 entry (logIndex 4204685437) (integrity API). 1,271 of the project’s 3,804 files carry provenance (simple API). What that means for P-256 exposure is on the supply-chain page.
Response#
No issue, PR, release note, docs statement or social post from Alex Gaynor or Paul Kehrer references the advisory; see no response.
Full discussion: Crypto libraries
Sources cited on this page 3
- pypistats pypistats.org
- integrity API pypi.org
- simple API pypi.org