CryptanalysisBench: Can LLMs do Cryptanalysis?

Lukas Fluri, Avital Shafran, Nicholas Carlini, Matthew Jagielski, Milad Nasr, Orr Dunkelman, Eyal Ronen, Florian TramèrarXiv 2026

TL;DR

This paper introduces CryptanalysisBench, a rigorous new benchmark designed to evaluate whether Large Language Models (LLMs) can independently find flaws in real-world cryptographic primitives. The authors find that frontier models are increasingly capable cryptanalysts: they successfully break a large majority of historically vulnerable schemes and, remarkably, have uncovered entirely novel, previously undocumented design flaws in full-strength cryptographic standards.

What Problem Does This Paper Address?

Cryptanalysis—the art and science of breaking cryptographic codes—is a uniquely high-stakes domain. Unlike standard software vulnerabilities that can be patched line-by-line, a single flaw in a cryptographic primitive invalidates every system relying on it, often retroactively. Historically, finding these flaws has been the exclusive domain of a small cadre of human experts.

While LLMs have shown rapid progress in mathematical reasoning and software security, previous evaluations of their cryptographic abilities relied on toy ciphers (like the Vigenère cipher) or artificial Capture-The-Flag (CTF) challenges with intentionally injected bugs. This paper addresses the lack of a realistic, automated, and rigorous framework to evaluate AI capabilities against real-world, expert-scrutinized cryptographic designs.

Methods

The authors built CryptanalysisBench on top of an agent evaluation framework where LLMs operate inside an isolated sandbox. The evaluation process mimics a real-world security audit:

  1. Code and Documentation Inspection: The LLM agent is given access to the target primitive's raw C source code and official specifications.
  2. Game Selection: The agent identifies a potential vulnerability and selects an appropriate formal security game to exploit (e.g., Target Key Recovery, Indistinguishability under Chosen-Ciphertext Attack (IND-CCA), or hash collision).
  3. Automated Interaction: The agent writes a self-contained attack script that interacts with an isolated "challenger" container via an HTTP API. This challenger holds the secret keys and handles oracle queries, preventing the LLM from cheating via side channels.
  4. Rigorous Verification: To eliminate lucky guesses in statistical games, the attack script is re-run against fresh randomness across 20 independent instances; it must win at least 17 to be marked successful.
Figure 1: Overview of an agent’s workflow on a CryptanalysisBench task, illustrated for the Edon-K KEM. (1) The agent inspects the algorithm’s source code and supporting documentation. (2) Based on its analysis, it identifies a candidate attack and proposes the corresponding security game. (3) The agent submits an attack script that interacts with the game controller, which holds all secret material and serves oracle queries over an HTTP API. (4) Verification re-runs the script against fresh randomness; the task is recorded as broken if the script wins the security game.

Datasets

The authors introduced CryptanalysisBench, a dataset comprising 191 tasks spanning six primitive families (block ciphers, stream ciphers, hash functions, AEADs, KEMs, and digital signatures). The targets are drawn primarily from four major NIST standardization competitions (AES, SHA-3, Lightweight Cryptography, and Post-Quantum Cryptography).

The benchmark is divided into three distinct difficulty tiers:

  • Tier 1 (49 primitives): Schemes with known, historically documented practical breaks. This tier calibrates current capabilities and tests memorization vs. rediscovery.
  • Tier 2 (142 primitives): Schemes with no known practical breaks. To make evaluation feasible, the authors created scaled-down variants (reducing rounds or key sizes) alongside the full-strength versions.
  • Challenge Set: Production-grade ciphers at the absolute frontier of human cryptanalytic knowledge (e.g., 7-round AES).

Key Insights and Ideas

  • AI Can Discover Novel Cryptanalysis: Most surprisingly, LLMs didn't just regurgitate known papers. Two models independently discovered a brand-new, 128-bit key-recovery attack on the unmodified SpoC AEAD cipher by exploiting an initialization flaw handling empty messages. Another model exposed an error in the published mathematical security proof of the KINDI key-encapsulation mechanism.
  • Execution, Not Analysis, is the Bottleneck: When models failed, it was rarely due to a lack of cryptographic understanding. Traces showed that LLMs routinely identified the correct vulnerability class but exhausted their time or token budgets while trying to compile complex mathematical attacks into working C or Python code.
  • More Time Yields Better Code, Not Better Math: Boosting the test-time compute budget from 2 hours to 16 hours significantly increased success rates. However, the extra time was spent debugging solvers and optimizing code rather than deriving fundamentally new mathematical insights.
  • The Limits of Memorization: By using the 2026 AIMer cipher attack (published after the models' training cutoffs) as a control case, the authors proved that models can genuinely re-derive algebraic attacks from source code, though they do not yet invent entirely new mathematical frameworks from scratch.

Key Results

The authors evaluated five frontier models: Claude Opus 4.8, Claude Sonnet 5, Claude Mythos 5, GPT-5.5, and the open-weights GLM-5.2.

  • Tier 1 Performance: Models successfully broke between 65.3% (GLM-5.2) and 85.7% (Mythos 5) of the historically vulnerable schemes.
  • Tier 2 Performance: At full strength, models broke 6 to 12 schemes. Across all scaled-down variants, they solved between 24 and 61 tasks.
  • Compute Scaling: When allowed a 16-hour budget, the leading model (Mythos 5) saw its Tier 1 success rate jump to 95.9%, and its Tier 2 total solved variants climbed from 119 to 164.
Figure 2: Per-task performance of several models on our benchmark (Tier 1 and Tier 2), conditioned on runtime (left), cost (middle), and token budget (right). Claude Mythos 5 shows considerably higher performance compared to the other models when allowed enough test-time compute.

Limitations and Future Work

  • Compute and Verification Walls: The benchmark can currently only verify practical, executable attacks. Highly complex, theoretical attacks that require $2^{80}$ operations cannot be executed or verified in a standard container environment.
  • Implementation Bugs vs. Design Flaws: A meaningful fraction of LLM successes stemmed from exploiting simple coding blunders in reference implementations (e.g., buffer overflows or uninitialized matrices) rather than breaking the underlying mathematical design.
  • Future Directions: The authors propose extending the benchmark to theoretical attacks by integrating formal proof systems, allowing AI agents to attack the mathematics of a cipher directly through code verification rather than execution.

Summary updated

BibTeX
@misc{fluri2026cryptanalysisbench,
  author = {Lukas Fluri and Avital Shafran and Nicholas Carlini and Matthew Jagielski and Milad Nasr and Orr Dunkelman and Eyal Ronen and Florian Tramèr},
  title = {{CryptanalysisBench: Can LLMs do Cryptanalysis?}},
  year = {2026},
  eprint = {2607.18538},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.18538},
}
Figure