Python ecosystem briefing, state as of 3 Dec 2026
Upgrade the encryption on your connections now. Plan new signing keys next
On 2 Dec 2026 the NSA told operators of US National Security Systems to speed up their move to post-quantum cryptography, after AI companies disclosed unpublished results. No algorithm is publicly confirmed broken, and experts disagree on whether today’s common elliptic curves, P-256 and Curve25519, are weakened. Both camps agree on the first step, and in Python most of it comes free with OpenSSL 3.5 or newer.
How to use this page
- Run the one-line check in every image that makes or accepts TLS connections.
- Work through the three lists below: what to do now, what to plan, and what to leave alone.
- Find your dependencies on the package wall, or open a topic page for the detail behind any item.
The one check that answers most of it
$ python -c "import ssl; print(ssl.OPENSSL_VERSION)"
- OpenSSL 3.5.x or newer
- Offers and prefers hybrid
X25519MLKEM768by default. No code changes. - OpenSSL 3.0.x to 3.4.x
- Classical
X25519and P-256 only. Recorded traffic stays exposed. - LibreSSL
- macOS
/usr/bin/python3. Classical only.
Run it inside every image that terminates or originates TLS. A single set_ecdh_curve() call turns the hybrid off. Which builds pass, and how to verify the negotiated group
Do now#
Encryption, in transit and at rest Someone can record your encrypted traffic today, or copy data you stored encrypted with a public key, and keep it until they can break the maths that protects it. A newer, post-quantum method (ML-KEM) prevents this. For connections (the first three items below), it mostly comes free with OpenSSL 3.5 or newer. Data already stored and secrets already sent (the last two) need work of their own.
- Upgrade every Python runtime to OpenSSL 3.5 or newer. OpenSSL is the library that encrypts Python’s connections, and from 3.5 it adds the post-quantum protection by itself. Run the check in each image and on each server. Debian 12 (
bookworm) images, Ubuntu 22.04 and 24.04 system Pythons, and python.org installers for 3.12 and older are too old. Which builds pass - Delete settings that switch it back off. A
set_ecdh_curve()call in Python, or a fixed list of curves in a proxy config, replaces OpenSSL’s new default with a single old method. Remove them so the default applies. How to find them - Turn it on at your load balancer or proxy. Browsers and API clients usually connect to a load balancer or proxy, not to your Python app, so that is where incoming traffic gets its protection. Cloudflare, CloudFront, Google Cloud and Caddy already do it. AWS load balancers (ALB) need a newer security policy, Envoy needs a config change, and the granian server cannot do it at all, so put a proxy in front of it. How to check
- Re-encrypt stored data that was locked with a public key. This means data encrypted so that only the holder of a private key can read it, with PyNaCl
SealedBoxoragefiles for example. Upgrading OpenSSL does not change data that is already encrypted, so re-encrypt it with a post-quantum scheme such as pyca/cryptography’s HPKE withKEM.MLKEM768_X25519. Data encrypted with a shared secret key, such as Fernet or AES-GCM, does not need this. How - Replace tokens that may have been recorded, starting with GitHub’s. GitHub’s servers still use only the old method, even when your client offers the new one, so tokens and private code sent to GitHub over HTTPS could be read from a recording later. Rotate GitHub tokens, give the new ones short expiry dates, and use git over SSH, which GitHub already protects. Do the same for other secrets sent from machines with an old OpenSSL. Why GitHub
Prepare#
Signatures and identity Certificates, signed tokens and SSH keys prove who sent something. If the maths behind them were broken, someone could forge them from that point on, but could not go back and alter anything already checked. So there is time to replace keys on a schedule: stronger classical keys now, and post-quantum ML-DSA as your tools add support, which few Python libraries have yet.
- Move your own signed tokens to stronger keys. If your service signs JWTs with a key pair (
ES256orEdDSA) so that other services can check them, switch toES384or an RSA key of at least 3072 bits now; common JWT libraries already support both. Move to ML-DSA later: jwcrypto can do it today, while PyJWT’s support is an open pull request (#1256). Tokens signed with a shared secret (HS256) need nothing. Tokens and auth - Reissue HTTPS certificates with stronger keys. Many certificates use P-256 keys. Reissue them as P-384 or RSA-3072, which Let’s Encrypt issues and Python clients already accept. With certbot, ask for the new key type explicitly, because renewals keep the old one. Certificates
- Make room in your database for much larger keys and signatures. An ML-DSA public key is about 2 KB and a signature about 3.3 KB, roughly 30 to 60 times the size of today’s. A column sized for today’s values will reject them, or in some setups silently cut them short, and tests on SQLite will not notice because SQLite ignores column lengths. Widen these columns before the first ML-DSA value arrives. Storage
- Add post-quantum SSH keys next to your current ones. OpenSSH 10.6 can create
ssh-mldsa44-ed25519keys, which combine a post-quantum and a classical signature. Keep your existing keys too: Python SSH libraries such as paramiko and asyncssh cannot use the new ones yet. SSH - Try ML-DSA first where you control both ends. Internal certificates, such as a private certificate authority or service-to-service mTLS, are the easiest place to start, because you decide what the clients accept. cryptography 49 or newer can sign ML-DSA certificates, and 50 or newer can verify chains of them. Private PKI
- Do not rely on package signatures alone. PyPI’s attestations (PEP 740) show which repository and workflow built a release, but they are signed with P-256. Also pin the exact SHA-256 hash of every dependency, in a lockfile or with
pip --require-hashes, which does not depend on signatures at all. Supply chain
Leave alone#
Passwords, shared secrets and hashes These rely on a secret that both sides already hold, or on a one-way hash, not on the public-key maths in question. Nothing in the advisory touches them, so spend no emergency effort here. The one thing to check is how their keys reached you.
- Tokens and sessions signed with a shared secret.
HS256JWTs and the signed session cookies in Starlette, Flask and Django use HMAC: the same secret signs and checks them, and no public key is involved. Keep the secret at least 32 random bytes, and rotate it if it leaks. Details - Password hashes. Argon2, bcrypt, scrypt and PBKDF2 hashes involve no public keys, so stored hashes do not need to be recomputed.
- Data encrypted with a shared key. AES-GCM, ChaCha20-Poly1305 and Fernet are not affected. The key, though, is only as safe as the way it arrived: a Fernet key fetched over a connection without post-quantum protection shares that connection’s risk. Key delivery
- Hash pins in lockfiles. SHA-256 hashes in
uv.lock,pylock.tomlor apip --require-hashesrequirements file make sure you install exactly the file you expected, and a broken curve does not change that. Supply chain - PyPI API tokens. They are Macaroons, which are built on HMAC, so the token format is safe. A long-lived token sent from a machine with an old OpenSSL may still have been recorded on the way, so rotate those, as under Do now. Details
- Why these are safe, and what still matters around them
Key exchange mostly has a path. Signatures mostly do not.
Each tile is a package or family, ordered by monthly downloads. Its two bars match the first two lists above: the left one rates encryption in transit and at rest (key exchange and public-key encryption), the right one signatures and identity. Open a tile for the details.
41 of 60
packages that do key exchange or public-key encryption have a post-quantum path today
16 of 72
packages that sign or verify have a post-quantum signature path today
24
can only offer a classical stopgap (P-384, RSA-3072) for signatures
24
ratings where a package is exposed by default with no path yet
- PQ by default
- PQ with action
- Stopgap only
- No path yet
- Not affected
- Unknown
- boto3 +12.4B
- requests1.49B
- cryptography1.38B
- PyJWT763M
- Starlette739M
- FastAPI567M
- google-auth447.8M
- itsdangerous219M
- Flask182M
- pyOpenSSL180M
- PyNaCl170M
- keyring166.2M
- Authlib161M
- docker +1157.1M
- joserfc154M
- azure-identity +1145.3M
- paramiko111.5M
- pycryptodome87.4M
- pycryptodomex56.5M
- Django52.6M
- ecdsa +142.1M
- python-jose30.6M
- hvac23.0M
- Ansible19.2M
- jwcrypto19M
- asyncssh17.5M
- google-cloud-kms15.6M
- pywebpush +114.9M
- python-gnupg +113.2M
- Fabric8.1M
- web3.py +25.4M
- coincurve3.0M
- josepy2.9M
- pyrage2.8M
- acme2.6M
- solders +12.4M
- trustme2.1M
- fastapi-users +41.41M
- certbot1.2M
- netmiko +11.0M
- matrix-nio +1823.8K
- python-bitcoinlib +1576.4K
- stem492.3K
- pqcrypto +4399K
- M2Crypto310K
- kyber-py +1251K
- liboqs-python56K
- quantcrypt2.5K
- aiohttp
- aioquic
- argon2-cffi +3
- asyncpg +2
- awscrt
- certifi
- conda +2
- CPython ssl module
- curl_cffi +1
- Daphne
- Granian
- grpcio
- Gunicorn
- HTTPX
- Hypercorn
- niquests +2
- pip
- pixi +1
- poetry +1
- Psycopg 3
- py-ecc +2
- py_webauthn
- PycURL
- pypi-attestations
- python-fido2
- python-tuf +1
- sigstore-python
- tink-py
- Tornado
- truststore
- Twisted
- urllib3
- uv
- Uvicorn
- Waitress
Read by layer
- The advisoryThe NSA advisory names no broken algorithm, no company and no new deadline
- Expert readingExperts split on whether 256-bit curves are weakened but agree on what to do first
- Ecosystem responseUpstream TLS and SSH stacks already default to hybrids; few vendors changed plans
- TLS and interpretersHybrid PQ key exchange in Python depends on the linked OpenSSL, not the Python version
- Crypto librariespyca/cryptography already ships ML-KEM and ML-DSA; most other primitive libraries do not
- FastAPI and authFastAPI has no crypto of its own; its auth stack and TLS hops decide exposure
- Supply chainPython's package transport is post-quantum; its signatures still rest on P-256
- InfrastructureSSH, ACME and cloud tools can do PQ key exchange; PQ authentication keys mostly lag