{"slug": "did-claude-break-ml-kem-or-rsa-2048-i-read-the-lean-theorem-and-checked-my-own", "title": "Did Claude break ML-KEM or RSA-2048? I read the Lean theorem and checked my own TLS", "summary": "A software engineer examined Anthropic's November 2026 release of four lattice-cryptography papers, including a Lean 4 formalization, and concluded that neither ML-KEM nor RSA-2048 has been broken. The engineer notes that one paper describes an attack on structured module lattices used by ML-KEM, while three are reductions strengthening plain lattice encryption, and that the Cryptography Incident Review Group's assessment puts the attack's cost at 2^1000 quantum operations, far beyond feasibility for even the smallest parameter sets.", "body_md": "On 30 November 2026 Anthropic released four papers on lattice cryptography, found by unreleased Claude models, with a Lean 4 proof of the results. Within hours my feed was full of people asking whether Claude had broken the post-quantum encryption everyone has been rolling out. Some asked about RSA-2048 too. The short answer is no to both. The longer answer is more useful, because the formal statement is public and you can read exactly what it claims.\n\nI am a software engineer, not a cryptographer. So I did what I would do with any scary dependency advisory: read the actual claim, plugged real parameters into it, then checked what my own servers negotiate. This post is those three steps.\n\n**Tip:** ML-KEM, ML-DSA and RSA-2048 are not broken. No change to a key size or a protocol is urgent today. If a message tells you to move funds or reinstall a wallet because of this news, it is a scam.\n\nThe [release](https://github.com/anthropics/formal-math/tree/main/lattices) has four PDFs and one Lean project. They do not all point the same way, which most of the headlines missed.\n\n*One paper is an attack. Three are reductions that put plain lattice encryption on firmer ground.*\n\nAnthropic shared drafts with outside cryptographers on 16 November. That group published [its own assessment](https://cirg.org/statements/1/) as the Cryptography Incident Review Group (CIRG). It says the attack on today's NIST standards needs vastly more computation than attacks we already knew, and those were already out of reach. Its figure for scale: 2^1000 quantum operations would be far below the cost against the smallest parameter sets, ML-KEM-512 and ML-DSA-44, even with assumptions that favour the attacker.\n\nCIRG also reports that Anthropic found no improvement in classical attacks on any mainstream lattice system, and none in quantum attacks on unstructured ones.\n\nPlain LWE hides a secret behind a big random matrix. The matrix is expensive to send, so ML-KEM uses a structured one. Its entries are polynomials modulo x^256 + 1, and each polynomial stands in for a 256 by 256 block.\n\nThat saves a lot of space. It also gives the lattice a symmetry: multiplying by x rotates the coefficients and flips one sign. The length never changes. A few lines of Python show both sides of the trade:\n\n`structure.py`\n\n``` python\nimport random\nrandom.seed(1)\nn, q = 256, 3329\n\ndef mul_x(p):              # multiply by x in Z[x]/(x^n + 1)\n    return [-p[-1]] + p[:-1]\n\ns = [random.choice([-1, 0, 1]) for _ in range(n)]\nnorm = sum(c * c for c in s)\nseen, p = set(), s\nfor _ in range(n):\n    p = mul_x(p)\n    seen.add(tuple(p))\n    assert sum(c * c for c in p) == norm\nprint(\"one short vector gives\", len(seen), \"short vectors, all squared norm\", norm)\nprint(\"ML-KEM-768 matrix, structured:  \", 3 * 3 * n, \"numbers\")\nprint(\"same size, unstructured:        \", (3 * n) ** 2, \"numbers\")\n```\n\n`output`\n\n```\none short vector gives 256 short vectors, all squared norm 172\nML-KEM-768 matrix, structured:   2304 numbers\nsame size, unstructured:         589824 numbers\n```\n\nSo structure buys a 256x smaller matrix, and the price is that every short vector arrives with 255 siblings. Paper 1 defines a module lattice by exactly this property: multiplication by x acts as an isometry. The attack uses that ring action to compute something called the canonical filtration, a chain of unusually dense sublattices. For a Module-LWE instance, the paper builds an embedding lattice in which the densest piece contains the secret.\n\nThe unstructured version has no such action, so this method says nothing about it. The paper states that plainly: its bounds give no sub-exponential result for ordinary LWE or SIS.\n\nThe best file in the repo is `PaperDefs/P01/Cases.lean`. It states eight results in short form. This is the one about recovering keys from schemes like ML-KEM:\n\n`PaperDefs/P01/Cases.lean`\n\n```\ndef KeyRecoveryInFamiliesTheorem : Prop :=\n  ∃ program : QuantumProgram, ∃ c : ℕ, ∀ p ∈ parameterSets,\n    ∀ n ≥ 2 ^ 29, n.isPowerOfTwo → ∀ q ∈ Set.Icc (13 * n) (2 ^ n), q.Prime →\n      program.SolvesAllInstancesButFraction (keyRecovery p n q) (told := [n, p.rank])\n        (time := 2 ^ (c * n.log2 ^ 2)) (fraction := 2 ^ (-(n : ℝ) / 2 ^ 17))\n```\n\nYou do not need Lean to read it. There is one quantum program and one constant `c`. For each of the three ML-KEM parameter sets, for every power of two `n` from 2^29 up, and for every prime `q` of at least `13 n`, the program finds the secret key for almost all keys in 2^(c (log n)^2) steps.\n\nTwo things jump out. `c` exists but has no value, so you cannot turn the bound into a number. And `n` starts at 2^29. The real standard fixes `n` at 256.\n\n*The promise in the Lean statement begins about two million times above the degree used in practice.*\n\n**Warning:** A threshold in a theorem says where the guarantee starts. It is not a proof that the method fails below it. The evidence that it is useless at n = 256 is the cost, which comes next.\n\nThe paper also has a general result, Theorem 9.1, with explicit conditions on the modulus and the noise. In Lean they are two inequalities:\n\n```\nlargeModulus : 2 * (10 * (log x.n + 2)) ^ x.k ≤ (x.q : ℝ) ^ ((x.d * x.m : ℝ) / x.k)\nsmallNoise   : 3 * x.σ * √(x.k * x.n) ≤ (x.q : ℝ) ^ ((x.m : ℝ) / x.k)\n```\n\nHere `d` is the rank of the secret, `m` the number of samples, and `k = d + m`. Every other value is in FIPS 203 and 204, so I checked all six sets:\n\n`check_params.py`\n\n``` python\nfrom math import log, sqrt\n# name, n, q, d (secret rank), m (samples), sigma^2 of the secret/error coefficients\nsets = [\n  (\"ML-KEM-512\",  256, 3329,    2, 2, 1.5),   # centered binomial, eta = 3\n  (\"ML-KEM-768\",  256, 3329,    3, 3, 1.0),   # eta = 2\n  (\"ML-KEM-1024\", 256, 3329,    4, 4, 1.0),\n  (\"ML-DSA-44\",   256, 8380417, 4, 4, 2.0),   # uniform on [-2, 2]\n  (\"ML-DSA-65\",   256, 8380417, 5, 6, 20/3),  # uniform on [-4, 4]\n  (\"ML-DSA-87\",   256, 8380417, 7, 8, 2.0),\n]\nprint(f\"{'set':12} {'largeModulus':>13} {'smallNoise':>11}  log2(lhs/rhs) of each\")\nfor name, n, q, d, m, var in sets:\n    k = d + m\n    l1 = log(2, 2) + k * log(10 * (log(n) + 2), 2); r1 = d * m / k * log(q, 2)\n    l2 = log(3 * sqrt(var) * sqrt(k * n), 2);       r2 = m / k * log(q, 2)\n    print(f\"{name:12} {'ok' if l1<=r1 else 'fails':>13} {'ok' if l2<=r2 else 'fails':>11}  {l1-r1:+.1f}  {l2-r2:+.1f}\")\nset           largeModulus  smallNoise  log2(lhs/rhs) of each\nML-KEM-512           fails       fails  +14.2  +1.0\nML-KEM-768           fails       fails  +20.9  +1.0\nML-KEM-1024          fails       fails  +27.5  +1.2\nML-DSA-44            fails          ok  +4.9  -3.9\nML-DSA-65            fails          ok  +6.9  -3.9\nML-DSA-87            fails          ok  +8.7  -4.2\n```\n\nNo real parameter set meets the conditions of Theorem 9.1. For ML-KEM-768 the modulus condition misses by a factor of about 2^21. The margin also grows with the security level inside each family. ML-DSA has a further problem: its public key is rounded, and Theorem 9.1 does not cover rounded samples at all.\n\nTheorem C is the more general version, and the paper uses it to cover the scaled-up families. For the real ML-KEM-512 it gives a concrete sense of cost: some steps would run a Gaussian sampler on lattices of rank above 256^(52 x 25), which is 2^10,400. The observable universe has roughly 2^266 atoms.\n\nThe same remark gives a formula, n^(52 k^2), where k is the rank of the lattice the filtration is computed on (`d + m + 1`). The first row below is the paper's number and the other two are mine from the formula:\n\n`sampler-rank.txt`\n\n```\nML-KEM-512    k = 2 + 2 + 1 = 5    rank above 2^10,400\nML-KEM-768    k = 3 + 3 + 1 = 7    rank above 2^20,384\nML-KEM-1024   k = 4 + 4 + 1 = 9    rank above 2^33,696\n```\n\nThis shows why the knob matters. The attack's speedup is in `n`. NIST raises security by adding components while `n` stays at 256, and the component count is in the part of the exponent that hurts the attacker. That is the reasoning behind CIRG's advice to pick the highest level you can afford.\n\nFalcon, the basis of the coming FN-DSA standard, scales the other way: 512 to 1024 is a larger degree at a fixed small rank. I saw posts conclude that Falcon is now the weak one. The paper does not say that. Its NTRU result covers keys of norm below the square root of q, computes the dense submodule and stops before the key, and states that the keys of Falcon are not treated. It is a fair place to watch. It is not a result.\n\nRSA-2048 is a different problem. It rests on factoring a 2048-bit number, not on lattices, and none of the four papers mention an improvement there. It still belongs in this post, because it is the thing you would be falling back to if you turned ML-KEM off.\n\nIt is also probably in your stack right now. The key exchange and the certificate are separate parts of a TLS handshake, and the certificate on my own site uses an RSA-2048 key:\n\n`cert-key.sh`\n\n``` bash\n$ echo | openssl s_client -connect mahmadmanzoor.com:443 -servername mahmadmanzoor.com 2>/dev/null \\\n    | openssl x509 -noout -text | grep 'Public-Key'\nPublic-Key: (2048 bit)\n```\n\nSo my handshake has a post-quantum key exchange and an RSA-2048 signature. That is a sensible split for now. Recorded traffic can be decrypted years later, so key exchange had to move first. A signature only has to hold at the moment it is checked, so forging one later does not help with an old session.\n\nCompare the two columns. Against RSA-2048 the best quantum attack is thousands to a million qubits for days. Against ML-KEM-512 the new one is past 2^1000 operations. That gap is why CIRG says delaying the migration prolongs reliance on systems that fall to far fewer quantum resources.\n\nAI-written mathematics at this scale is hard to referee. Paper 1 alone runs past 270 pages. That makes the formalization the interesting engineering part. I counted what is in the repo at commit 487d559:\n\n`line-counts.txt`\n\n```\nCryptoDefs        1,035 lines   the machine, resources, problems\nConsistencyDefs     367 lines   Turing machines and circuits it is compared to\nPaperDefs         6,717 lines   the main theorems\nPaperDetails     13,892 lines   190 further statements\nproof           870,854 lines   everything else\n\nsorry: only in Challenge/ (3 files, by design)\naxiom declarations: 0\n```\n\n*The design point: shrink what a person has to read, and let a kernel read the rest.*\n\nThe pattern is worth stealing for any agent output you cannot review line by line. `Challenge/` holds each theorem with `sorry` in place of its proof. `Solution/` holds the proved version. A tool called Comparator checks that the statements match, that only `propext`, `Classical.choice` and `Quot.sound` are used, and replays the proof in Lean's kernel and in a second one written independently. The `lakefile.toml` labels each library as trusted or untrusted in a comment.\n\nWhat a kernel cannot do is tell you that a Lean statement means what the PDF says. The README is direct about this: that judgment is for the reader, and so far AI readers have compared them. A wrong definition of the quantum machine would make a perfect proof of the wrong thing. The repo answers part of this with 63 theorems tying its machine to standard P, BPP, PSPACE and BQP.\n\n**Note:** I read the statements and scanned the sources for `sorry` and `axiom`. I did not rebuild the proofs. The README puts a full build at a little over an hour on 12 cores, 12 GB of memory and 21 GB of disk, and compiling Lean runs its macros with your user's rights, so use a throwaway machine.\n\nCIRG's advice for the rest of us is four items: keep moving to post-quantum, use the highest level you can, use hybrids, and make schemes replaceable. The first question is what you run now. OpenSSL 3.5 or newer can ask for one key exchange group at a time:\n\n`probe.sh`\n\n``` bash\n$ echo | openssl s_client -connect example.com:443 -servername example.com \\\n    -groups X25519MLKEM768 -brief 2>&1 | grep -iE 'negotiated|alert'\n$ echo | openssl s_client -connect example.com:443 -servername example.com \\\n    -groups SecP384r1MLKEM1024 -brief 2>&1 | grep -iE 'negotiated|alert'\n```\n\nA `Negotiated TLS1.3 group` line means yes. A handshake failure alert means the server refused that group. I ran both against five hosts on 1 December 2026:\n\n`results.txt`\n\n```\nhost                 X25519MLKEM768    SecP384r1MLKEM1024\nmahmadmanzoor.com    yes               refused\nvercel.com           yes               refused\ncloudflare.com       yes               refused\ngoogle.com           yes               refused\ngithub.com           refused           refused\n```\n\nMy site gets hybrid for free because Vercel terminates TLS. Nobody in the list offers the ML-KEM-1024 hybrid on the public web, so for browser traffic \"choose the highest level\" is not a switch you hold today. Where you run both ends, it is.\n\n*Hybrid is the reason a surprise in lattice theory is news and not an incident.*\n\nIn Node the group list is one option. I tested this on Node 24.21 (OpenSSL 3.6.4), and `ecdhCurve` takes the names in order of preference:\n\n`server.mjs`\n\n``` python\nimport https from 'node:https';\nimport { readFileSync } from 'node:fs';\n\nhttps.createServer({\n  key: readFileSync('k.pem'),\n  cert: readFileSync('c.pem'),\n  minVersion: 'TLSv1.3',\n  ecdhCurve: process.env.TLS_GROUPS ?? 'X25519MLKEM768:SecP384r1MLKEM1024:X25519',\n}, (req, res) => res.end('ok')).listen(8444);\n```\n\nI probed it locally, one group at a time:\n\n`probe output`\n\n```\nX25519MLKEM768       TLSv1.3   Negotiated TLS1.3 group: X25519MLKEM768\nSecP384r1MLKEM1024   TLSv1.3   Negotiated TLS1.3 group: SecP384r1MLKEM1024\nX25519               TLSv1.3   ok (no post-quantum part)\nsecp256r1            handshake failure, not in the list\n```\n\nFor service-to-service traffic, put `SecP384r1MLKEM1024` first and drop the plain `X25519` fallback once every client is upgraded. A fallback left in place means an old client still gets a classical handshake, and recorded classical traffic is what a future quantum computer reads. The list comes from an environment variable so that the next surprise is a config change.\n\nCost is small. An ML-KEM-768 public key plus ciphertext is 1184 + 1088 bytes. ML-KEM-1024 is 1568 + 1568. FrodoKEM, the unstructured option that the new papers support, is about 15.6 KB in each direction at a comparable level to ML-KEM-768. That gap is the real price of dropping structure.\n\nTLS gets swapped for you. Data you encrypt yourself does not. Backups, sealed tokens and end-to-end messages stay in whatever scheme you picked. This is a hybrid envelope on Node's built-in crypto (`encapsulate` needs Node 24.7 or newer), with the suite name stored in every message:\n\n`hybrid.mjs`\n\n``` python\nimport crypto from 'node:crypto';\n\n// One entry per suite. A break means adding a line here and re-wrapping, not editing call sites.\nconst SUITES = {\n  'x25519+ml-kem-1024': { classical: 'x25519', pq: 'ml-kem-1024' },\n};\nconst DEFAULT = 'x25519+ml-kem-1024';\nconst raw = (key) => key.export({ type: 'spki', format: 'der' });\n\nexport function newRecipient(alg = DEFAULT) {\n  const { classical, pq } = SUITES[alg];\n  return { alg, c: crypto.generateKeyPairSync(classical), p: crypto.generateKeyPairSync(pq) };\n}\n\n// Both secrets go in, plus everything public, so neither half can be swapped.\nconst derive = (alg, ssC, ssP, ...transcript) =>\n  Buffer.from(crypto.hkdfSync('sha512', Buffer.concat([ssC, ssP]), Buffer.alloc(0),\n    crypto.createHash('sha256').update(Buffer.concat([Buffer.from(alg), ...transcript])).digest(), 32));\n\nexport function seal(to, plaintext) {\n  const { classical } = SUITES[to.alg];\n  const eph = crypto.generateKeyPairSync(classical);\n  const ssC = crypto.diffieHellman({ privateKey: eph.privateKey, publicKey: to.c.publicKey });\n  const { sharedKey: ssP, ciphertext: kem } = crypto.encapsulate(to.p.publicKey);\n  const key = derive(to.alg, ssC, ssP, raw(eph.publicKey), kem, raw(to.c.publicKey), raw(to.p.publicKey));\n  const iv = crypto.randomBytes(12);\n  const aes = crypto.createCipheriv('aes-256-gcm', key, iv);\n  const body = Buffer.concat([aes.update(plaintext), aes.final()]);\n  return { alg: to.alg, eph: raw(eph.publicKey), kem, iv, body, tag: aes.getAuthTag() };\n}\n\nexport function open(me, m) {\n  if (!SUITES[m.alg] || m.alg !== me.alg) throw new Error(`unsupported suite ${m.alg}`);\n  const ephPub = crypto.createPublicKey({ key: m.eph, type: 'spki', format: 'der' });\n  const ssC = crypto.diffieHellman({ privateKey: me.c.privateKey, publicKey: ephPub });\n  const ssP = crypto.decapsulate(me.p.privateKey, m.kem);\n  const key = derive(m.alg, ssC, ssP, m.eph, m.kem, raw(me.c.publicKey), raw(me.p.publicKey));\n  const aes = crypto.createDecipheriv('aes-256-gcm', key, m.iv);\n  aes.setAuthTag(m.tag);\n  return Buffer.concat([aes.update(m.body), aes.final()]);\n}\nx25519+ml-kem-1024 | opens: backup key | kem bytes: 1568\ntampered kem: Unsupported state or unable to authenticate data\n```\n\n`alg` is checked against an allow list and the recipient's own key.\n**Warning:** This shows the shape. For production, use a reviewed construction such as X-Wing or HPKE with a hybrid KEM, and have someone who does this for a living look at it.\n\n`ml-kem`, `kyber`, `x25519` and `secp256r1` outside one module. Each hit is a place you cannot change quickly.\nThe part I keep thinking about is the process. A lab's model found a real asymptotic result, the lab gave outside experts two weeks, the limits were printed next to the claim, and anyone can open a Lean file and see `n ≥ 2 ^ 29`. The first version of an attack is rarely the best one, and CIRG expects improvements soon. If you build so that one line of config changes the algorithm, you can read that next paper with interest.\n\nNo. The algorithm is asymptotic, needs a large quantum computer, and costs far more than 2^1000 operations on the smallest ML-KEM set according to CIRG. Known attacks are cheaper, and those are already infeasible.\n\nNo. The lattice papers have nothing on factoring. The largest RSA number factored in public is RSA-896, and RSA-2048 is far beyond that for classical machines. A large quantum computer would break it, which is why NIST deprecates it after 2030 and disallows it after 2035.\n\nNot against a quantum computer. RSA-2048 falls to Shor's algorithm with published estimates under a million qubits. ML-KEM-768 has no practical attack, classical or quantum. Use ML-KEM in a hybrid with X25519.\n\nNo. Wallets and most bank connections use elliptic curves, RSA, hashes and AES. The papers are about lattice problems and do not improve any attack on those.\n\nNo. CIRG and Anthropic both recommend continuing, with hybrids and the highest practical security level. Stopping leaves traffic on RSA and elliptic curves, which quantum computers break more easily.\n\nIts theoretical footing got stronger, and it has no ring structure for this kind of attack to use. Both remain unbroken. FrodoKEM costs roughly fourteen times the bandwidth of ML-KEM-768, so for most web traffic a hybrid with ML-KEM is still the practical choice.\n\nYes. Install elan, run `lake exe cache get`, `lake build`, then `lake env lean scripts/PrintAxioms.lean` in the lattices folder. Read the statements in PaperDefs yourself, because the checker cannot judge whether they match the papers.\n\n*Originally published on [my site](https://mahmadmanzoor.com/blog/did-claude-break-ml-kem-rsa-2048). More posts and projects at [mahmadmanzoor.com](https://mahmadmanzoor.com).*", "url": "https://wpnews.pro/news/did-claude-break-ml-kem-or-rsa-2048-i-read-the-lean-theorem-and-checked-my-own", "canonical_source": "https://dev.to/ahmad_dogar_7d098f5e48f72/did-claude-break-ml-kem-or-rsa-2048-i-read-the-lean-theorem-and-checked-my-own-tls-14mc", "published_at": "2026-12-02 05:05:58+00:00", "updated_at": "2026-12-02 05:13:12.521124+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-research", "ai-safety"], "entities": ["Anthropic", "Claude", "Cryptography Incident Review Group", "ML-KEM", "ML-DSA", "RSA-2048", "NIST"], "also_reported_by": [], "takeaway": "Anthropic's lattice attack requires roughly 2^1000 quantum operations against ML-KEM-512 and ML-DSA-44, so no key-size or protocol change is warranted today.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/did-claude-break-ml-kem-or-rsa-2048-i-read-the-lean-theorem-and-checked-my-own", "markdown": "https://wpnews.pro/news/did-claude-break-ml-kem-or-rsa-2048-i-read-the-lean-theorem-and-checked-my-own.md", "text": "https://wpnews.pro/news/did-claude-break-ml-kem-or-rsa-2048-i-read-the-lean-theorem-and-checked-my-own.txt", "jsonld": "https://wpnews.pro/news/did-claude-break-ml-kem-or-rsa-2048-i-read-the-lean-theorem-and-checked-my-own.jsonld"}}