PQ Python

Symmetric ciphers, hashes, MACs and password hashes need no change, but key channels do

Nothing in the three US documents implicates AES, SHA-2, HMAC or password hashing. Leave them alone during triage, and check instead how their keys were delivered: a symmetric key is only as safe as the channel that carried it.

State as of 3 Dec 2026

In short

  • The advisory’s inventory list covers public-key algorithms only; CNSA 2.0 keeps AES-256 and SHA-384/512 (details).
  • Leave password hashes, HMAC sessions and CSRF tokens, single-service HS256 JWTs, SHA-256 hash pins and AWS SigV4 alone (details).
  • Check the channel instead: a Fernet key fetched over X25519-only TLS inherits the key-exchange exposure (details).
  • Some tools look symmetric but have a public-key side in scope, such as python-gnupg’s RSA-2048 keys and certbot’s RSA-2048 account keys (details).
  • Do not weaken working controls in the rush: keep MFA, host-key checking and certificate verification on (details).

Nothing in the advisory implicates symmetric cryptography, hashes or MACs#

The advisory’s inventory list is limited to public-key algorithms, and CNSA 2.0 retains AES-256 and SHA-384/512 (advisory PDF). Symbolic Software finds no public evidence against AES or hashes (Symbolic Software). AES-encrypted data with independently protected keys, HMAC-only cookies, Argon2 password hashes and SHA-256 artifact digests are not 256-bit elliptic curves.

No authoritative source states explicitly that HS256 or HMAC is unaffected. That conclusion comes from scope: symmetric primitives are simply not on the list (what the documents say).

Caveat. CNSA 2.0 prefers 256-bit symmetric keys in the long term, because of Grover’s algorithm. That is a long-standing quantum consideration, not part of this alert (details).

Leave these alone during emergency triage#

All three reports tell teams not to spend triage time here. The AGY report’s explicit list of what not to touch during emergency triage is the short version:

  • Password hashing (argon2-cffi, pwdlib, bcrypt, passlib, Django/FastAPI password hashers) (password hashing).
  • Symmetric encryption and MACs (AESGCM, ChaCha20Poly1305, Fernet, PyNaCl SecretBox/Aead, hashlib, hmac, secrets).
  • Cookie, CSRF and session signing (itsdangerous, Starlette SessionMiddleware, Flask sessions, Django Signer/CSRF).
  • Single-service FastAPI HS256 JWTs, provided the signing secret has ≥ 256 bits of entropy.

The ASTRA report adds that a migration alert does not justify rotating these: “Do not rotate on this alert alone.” The Claude report’s longer list adds SHA-256 hash pinning, AWS SigV4 request signing, PyPI Macaroon and Trusted Publishing tokens, keyring, and data at rest under KMS data keys, each with a caveat below.

Tablethe Claude report's component-by-component list, with caveats
Component Why it is unaffected Caveat
AES-GCM, ChaCha20-Poly1305 (pyca AESGCM, ChaCha20Poly1305) Symmetric; not on the list. AES-256 is CNSA 2.0 Anthropic’s July 2026 attack was on 7-round AES, not full AES (Anthropic)
Fernet (AES-128-CBC + HMAC-SHA256) Symmetric CNSA 2.0 specifies AES-256 for National Security Systems, so Fernet is not CNSA-compliant, but it is not flagged. 51.0.1 fixes 51.0.0’s Fernet parsing regressions (Fernet docs)
SHA-2 and SHA-3 hashes; HMAC Not on the list. SHA-384/512 are CNSA 2.0
HS256/HS384/HS512 JWTs (the FastAPI tutorial’s choice; the fastapi-users, simplejwt and Flask-JWT-Extended default) HMAC. “HMAC is fine… not on the urgent list” (DEV, jamilxt) Keep SECRET_KEY ≥32 random bytes and rotate if exposed
Starlette/FastAPI SessionMiddleware, Flask sessions (itsdangerous HMAC-SHA1) HMAC Signed, not encrypted. Starlette has no built-in key fallback for rotation
Django signing (Signer HMAC-SHA256 default), CSRF tokens HMAC / random tokens base64_hmac()’s default changes from sha1 to sha256 in “Django 2028” (django signing.py). The CSRF assessment is based on design knowledge, not re-verified
Password hashing (pwdlib/Argon2; Django PBKDF2, Argon2, bcrypt, scrypt) No public-key crypto. No rehash needed
HMAC-signed webhooks HMAC Ed25519/ECDSA webhook signatures should move
AWS SigV4 request signing (boto3/botocore default) HMAC-derived key SigV4a (multi-region) is ECDSA
PyPI Macaroon tokens; Trusted Publishing tokens HMAC; 15-minute lifetime Long-lived tokens sent over X25519-only links could be harvested
SHA-256 hash pinning (--require-hashes, uv.lock, pylock.toml, repodata checksums) Hashes Only as good as the index view the lock was produced from
keyring OS secret stores; no asymmetric crypto
ML-KEM, ML-DSA (and the hybrids that include them) Endorsed by NSA. The lattice result is “galactic” and NCSC says it is no threat CIRG expects improvements and advises the highest security level each application can support
RSA-3072+ and P-384 Retained by the advisory as interim options Prince says to assume RSA is affected; this is unverified
Symmetric data at rest under KMS data keys Symmetric The TLS channel to the KMS and any ECDH key wrapping are not exempt
Evidencethe AGY report's unaffected classes, library by library

The AGY report’s threat-model table marks AES-128/256-GCM, ChaCha20-Poly1305, Fernet, Cobblestone, SHA-2 / SHA-3 / BLAKE2, HMAC, HKDF and Argon2id / bcrypt / scrypt / PBKDF2 as unaffected by this ECC threat, with the note that CNSA 2.0 prefers 256-bit symmetric keys long-term for Grover’s algorithm. Its advice is not to spend emergency triage cycles migrating them.

  • cryptography, unaffected, do not rewrite: Fernet / MultiFernet, Cobblestone128/256, AESGCM, AESGCMSIV, ChaCha20Poly1305, HMAC, HKDF, PBKDF2HMAC, Scrypt, Argon2id, SHA256/384/512/SHA3_*/BLAKE2*/SHAKE*. Long-term CNSA 2.0 prefers 256-bit symmetric keys like AESGCM(256) or Cobblestone256 over Fernet’s AES-128, but Fernet is safe against this ECC threat.
  • PyNaCl: leave nacl.secret.SecretBox, Aead, hash and pwhash untouched (all symmetric). Only the public-key classes need migrating.
  • pyrage: pyrage.passphrase uses scrypt and is unaffected.
  • Stdlib and password hashers: hashlib, hmac, secrets, argon2-cffi (25.1.0), pwdlib (0.4.2), bcrypt (5.1.0), and the revived passlib (1.9.6, Dec 3, 2026, under notypecheck/passlib).
  • Sessions: Starlette SessionMiddleware (itsdangerous 2.2.0) uses TimestampSigner, which is HMAC-SHA1. Flask 3.1.3 sessions also use itsdangerous HMAC-SHA1; Django 6.1.4 Signer, sessions and CSRF use HMAC-SHA256.
  • JWT defaults (auth frameworks): fastapi-users 15.0.5, djangorestframework-simplejwt 5.5.1 and Flask-JWT-Extended 4.7.4 default to HS256. A single-service FastAPI backend using HS256 (with a ≥256-bit secret) plus pwdlib Argon2id is unaffected at the application-auth layer.

A symmetric key is only as safe as the channel that delivered it#

The symmetric data layer is unaffected; how keys move is not. A Fernet key fetched from a secrets manager over X25519-only TLS, or a Megolm key delivered over an Olm channel, inherits the key-exchange exposure. The ASTRA report puts it as an instruction: inspect how these keys, transports and software updates are protected instead of rotating the primitives.

Check three things. The TLS channel to the KMS or secrets manager is a key-exchange problem (fix the runtime). Any asymmetric key wrapping matters: keep RSA-OAEP wrapping at ≥3072 bits and migrate ECDH-based wrapping. For an encrypted archive, ask what wrapped its data key, because changing TLS does not change an old envelope (re-encrypt envelopes).

Edge caseschannels that undo a safe primitive
  • Long-lived tokens. PyPI Macaroon tokens are HMAC, but a long-lived pypi- token sent to upload.pypi.org from a client without ML-KEM could be harvested and replayed later (rotate harvested credentials).
  • GitHub HTTPS. Tokens and PATs sent over GitHub HTTPS travel on X25519-only key exchange (supply-chain page).
  • Hash pins. A lockfile is only as good as the index view it was produced from; a digest learned from the same untrusted source as the file is not an independent approval.
  • Messaging. Megolm session keys are delivered over Olm (X25519 and Ed25519), which has no PQ mechanism; recorded Olm traffic is retroactively exposed if X25519 weakens (infrastructure page).
  • Passwords and cookies. Investigate the channels carrying cookies, passwords and keys rather than resetting every user password (ASTRA).

Some tools look symmetric but have a public-key side in scope#

Several components pair a safe symmetric core with a public-key part the advisory does cover. The Claude report places two of them in Valsorda’s “legacy” tier: python-gnupg’s RSA-2048 default for generated keys, and certbot’s RSA-2048 ACME account keys.

Looks safe Public-key part in scope
AWS SigV4 (HMAC) SigV4a, used for multi-region requests, is ECDSA (boto3)
HMAC-signed webhooks Ed25519 or ECDSA webhook signatures should move
Trusted Publishing upload tokens (HMAC Macaroons) The OIDC tokens that mint them are RS256 with mostly RSA-2048 keys: safe from a curve break, but a stopgap
python-gnupg Wrapper default key is RSA-2048; the gpg binary defaults to Ed25519 + Cv25519
certbot New ACME account keys are RSA-2048; new certificates default to P-256
KMS-encrypted data at rest The TLS channel to the KMS and any ECDH key wrapping

Caveat. HS256 is HMAC, not ECC, but every holder of the verification secret can mint tokens. Do not replace an external issuer’s public-key verification with a shared secret as a shortcut ASTRA.

The post-quantum algorithms and the larger classical sizes are retained, with caveats#

ML-KEM and ML-DSA, and the hybrids that include them, are endorsed by NSA (CNSA 2.0 names ML-KEM-1024 and ML-DSA-87). Anthropic’s November lattice result is “galactic”, and the UK NCSC says it is no threat to the standardized schemes. The CIRG still expects the attack to improve and advises choosing the highest security level each application can support (how experts read it).

RSA-3072+ and P-384 are retained by the advisory as interim options, and RSA-2048 only where legacy support requires it. Neither is quantum-resistant, and the AGY report calls them “interim only”, still subject to improving attacks. Cloudflare’s CEO says to assume RSA is affected; that claim is unverified (unknowns).

Backgroundwhy a hybrid survives a classical X25519 break

RFC 9954, which RFC 10024 builds on, states the design goal: a shared secret “that remains secure as long as one of the component key exchange mechanisms remains unbroken”. If X25519 fell, X25519MLKEM768 would degrade to ML-KEM-768-only confidentiality, which is still secure as long as ML-KEM holds. The AGY report makes the same point: X25519MLKEM768 remains secure via its ML-KEM-768 component even if X25519 were broken. What the hybrid loses is its defense in depth against a lattice break, and it does not cover authentication (how experts read it).

HS256, Fernet and HMAC-SHA1 are fine now; CNSA 2.0 prefers 256-bit keys later#

HMAC-SHA1 remains a secure MAC. Starlette, Flask and Django sessions are signed, not encrypted, so they never promised confidentiality and there is nothing for PQC to break. Fernet (AES-128-CBC plus HMAC-SHA256) is not CNSA-compliant, because CNSA 2.0 specifies AES-256 for National Security Systems, but the advisory does not flag it.

Replacing all Fernet keys because the word cryptography appears in a lockfile is not supported by the alert ASTRA. The AGY report lists an optional, non-urgent P2 step for ultra-conservative CNSA 2.0 compliance: phase Fernet (AES-128) to Cobblestone256 / AESGCM(256) and HS256 to HS384/HS512 (action plan).

Edge caseshygiene items that still apply
  • HS256 secrets. Keep SECRET_KEY at least 32 random bytes (the FastAPI tutorial uses openssl rand -hex 32) and rotate it if exposed. The AGY report states the same floor as ≥256 bits of entropy.
  • Session key rotation. Starlette has no built-in key fallback for rotation, so plan rotation hygiene separately.
  • Django. base64_hmac()’s default changes from sha1 to sha256 in “Django 2028”. The CSRF assessment is based on design knowledge, not re-verified.
  • cryptography 51.0.0. Fernet and MultiFernet have two non-security regressions in 51.0.0, fixed in 51.0.1; the AGY report pins cryptography>=50.0.2 until 51.0.1 ships (cryptography page).
  • Reduced-round AES. Anthropic’s July 2026 post reported a 200–800× faster attack on 7-round AES, not full AES (Anthropic).

Do not weaken working controls in the rush#

A migration alert is not a package CVE or a breach notification. Continue routine security patching, investigate actual compromise indicators separately, and do not declare a breach based on an inventory. The ASTRA report lists several changes that would make things worse while looking like progress:

  • Do not disable phishing-resistant MFA or passkeys on the strength of this alert; passkeys still beat passwords, and forging an assertion is an online, per-key attack.
  • Do not turn off SSH host-key checking, and never use verify=False to make a TLS migration succeed.
  • Do not globally remove public roots or deploy an untrusted ML-DSA public-site certificate to meet an internal deadline.
  • Do not replace an external issuer’s public-key verification with a shared secret, and do not locally re-sign an IdP token: it does not strengthen the original identity proof.
  • Keep Trusted Publishing and current Sigstore verification; do not wait without controls, and do not claim a valid attestation proves code safety.
  • Do not require ML-DSA passkeys yet: that would lock out almost every platform authenticator (Claude).
Sources cited on this page 6
  1. advisory PDF web.archive.org
  2. Symbolic Software symbolic.software
  3. Anthropic anthropic.com
  4. Fernet docs cryptography.io
  5. DEV, jamilxt dev.to
  6. django signing.py github.com

All sources across the guide