Using AI to Expand the Cryptanalytic Frontiers of AEGIS-128L
We used AI to take a sharper measure of the safety margin of AEGIS-128L
We used AI to take a sharper measure of the safety margin of AEGIS-128L, a fast industry-standard cipher. We beat the best published cryptanalysis results on two distinct fronts: Our attacks went further into the cipher than earlier published work, and they needed only a tiny fraction of the data.
The key insight was surprisingly [...] Read More... The post Using AI to Expand the Cryptanalytic Frontiers of AEGIS-128L appeared first on Engineering at Meta .
- We used AI to take a sharper measure of the safety margin of AEGIS-128L, a fast industry-standard cipher. We beat the best published cryptanalysis results on two distinct fronts: Our attacks went further into the cipher than earlier published work, and they needed only a tiny fraction of the data.
- The key insight was surprisingly simple: Where you change the input matters, not just how much of it you change.
- The full-strength cipher remains secure, and there’s no need to stop using it. As is standard practice for measuring a cipher’s safety margin, we attacked deliberately weakened versions that run fewer rounds of scrambling. The complete cipher held up, and we now have a sharper picture of how much margin it has.
- We built a framework for AI models to cross-check each other’s results. One model proposed ideas, a different model was rewarded for proving them wrong, and independent reviews rebuilt the key results from scratch. Only the claims that survived this cross-checking made it into this post. Because each model worked on different tasks, this is not a benchmark of AI models.
- Our goal is to strengthen confidence, not undermine it. Even a significant AI-assisted effort to break it left the full-strength AEGIS-128L unscathed, which is reassuring news these days where AI cryptanalysis continues to advance. By measuring its safety margin more precisely and sharing our methods, we help the industry make better informed decisions about the cryptography it depends on.
Advanced AI models have crossed a threshold worth naming. They no longer merely produce plausible technical prose: They can actively form hypotheses, design a control to try to falsify them, revise when that control fails, write and debug the code validating them, and eventually converge on a set of sound claims. In other words, they can meaningfully advance science.
The experiment described in this post illustrates this potential. Roughly a few weeks of AI-assisted research produced a PhD-chapter-scale body of work, including two cryptanalytic distinguishers that improve on existing literature against AEGIS-128L, an industry-standard cipher and CAESAR winner, and an audited log of validated and refuted claims. A further round of independent clean-room reviews then confirmed a theorem with proof for one of them.
This represents more than a gain in productivity - it expands our knowledge horizon.
Cryptanalysis is an unusually good place to test that scientific capability, and an unusually useful one to get right. The ciphers protecting internet traffic today play a crucial role in modern society, and our confidence in them does not always come from a mathematical proof. Most of the time, it comes from the fact that many skilled researchers have tried to attack them for years and failed. That empirical assurance comes from the scarcity of experts who can do original symmetric cryptanalysis. As a result, most deployed primitives may receive less scrutiny than their importance warrants. If AI can expand that capacity - not replacing the experts, but letting each of them cover far more ground - then the ciphers domain we all depend on can incrementally benefit with each successful defense.
With that in mind, and inspired by Anthropic’s recent work using Claude Mythos Preview for cryptanalysis - which itself traces back to our very own Kristin Lauter et al.’s seminal work attacking lattice cryptography with transformers - we asked several advanced AI models to find weaknesses in AEGIS-128L, a high-speed AES-round-based authenticated cipher standardized in IETF RFC 10032. It makes for a good test case because it is a CAESAR winner that has been backed by active cryptanalysis literature.
First, a brief note on terminology: Because breaking AEGIS completely is unlikely, cryptanalysts measure a cipher’s strength using a distinguisher - a statistical test that differentiates the cipher’s output from random noise. Since ciphers repeat an internal scrambling operation (a round) multiple times, building a distinguisher that works across more rounds represents progress in evaluating the cipher’s security margin. AEGIS-128L uses 10 rounds, and prior to our work the best distinguisher on the cipher’s observable output worked for only two of them.
A Sharper Measure of AEGIS-128L’s Safety Margin
We improved on the published state of the art on two fronts, and produced a sharper measurement of the safety margin of the AEGIS industry-standard cipher.
On the output an adversary actually observes, we reach four of 10 rounds where the best published result (Shiraya et al., IET Information Security, 2023) reaches 2, and we do it with 2¹⁶ queries - 65,536 encryptions - against their 2¹²⁸, which is every nonce the cipher will ever accept.
On an internal level, we match the published six-round reach using 2⁹⁶ times less data, turning a result that previously consumed the entire nonce space into an experiment that runs in minutes.
Both follow from a single observation the literature had not thought to make: Where an attacker varies the input matters.
The campaign additionally turned up an implementation flaw in the most widely used AEGIS library - secret material that is never erased - which we reported to its maintainers along with a proposed fix.
None of our results impacted the full-strength AEGIS. The full 10-round cipher came through the campaign with no cryptanalytic finding against it; every result above is against a deliberately weakened version of the cipher, and all of them assume an adversary who chooses the nonce, which real deployments do not grant.
Structuring an AI-Assisted Cryptanalysis Campaign
The hard problem with AI-generated science is not producing plausible results. It is telling the real ones from the confident-sounding ones. We built the campaign structure around that problem rather than around the cryptanalysis: two cryptanalysis campaigns, followed by two whose only job was to invalidate the claims from the first two.
Campaign 1 - targeting full AEGIS-128L, the null control: We exercised 17 standard attack strategies against full 10-round AEGIS-128L on a shared reference implementation anchored to the RFC’s published test vectors. Result? Nothing. We deliberately ran this first. A system that reports a finding every time you point it at a cipher is generating hallucinations; one that returns a clean null on a well-studied target has earned credibility for when it does report something.
It was not empty, though. Along the way, the investigation noted that libaegis does not erase its internal state after use. If an attacker can already read process memory, the leftover state could help them decrypt or forge the affected data, though not recover the AEGIS key. The maintainers consider clearing this state the caller’s responsibility; we shared a hardening patch upstream that clears it inside the library, so a caller who forgets to do so is no longer exposed.
Campaign 2 - targeting weakened AEGIS-128L, the regime with computable ground truth: We moved to round-reduced variants (i.e., AEGIS-128L using fewer than 10 rounds), where a complete invariant (cube sum) can be computed exhaustively and every claim is checkable rather than arguable. Here the model tried different approaches - sweeping round count, cube dimension, byte placement, keys and nonce bases - and found that byte placement is a free parameter the literature does not vary, and that it buys rounds. In other words, where you place the varying input bytes can yield a more capable distinguisher.
Campaign 3 - the falsifier adversary: A different advanced model, explicitly rewarded for invalidating claims from Campaigns 1 and 2 rather than extending them. It found four genuine defects:
- a weak-key threshold misstated by a factor of 256;
- an algebraic identity presented as independent measurement;
- a minimality ladder with an uncontrolled variable;
- and a screening criterion restated as a result.
Those claims were recorded as refuted.
Campaign 4 - clean-room reconstruction: Three independent reviews, on separate RFC-anchored engines built without reading the originals, tasked with either proving or decisively rejecting the claimed results and proposed mechanisms that would explain them. The first review found a genuinely confounded control in the proof, overinterpreted its replacement, and concluded the proof claim should be refuted. That overarching conclusion was wrong. The two later reviews independently found the error and recovered the correct proof. Had we stopped after the first review, we would have retracted a true theorem.
Models used: Campaigns 1 and 2 ran on Anthropic’s Claude Opus 5; Campaign 3 ran on an internal Meta model; Campaign 4 combined Claude Opus 5 and OpenAI Codex GPT-5.6. We selected models considered advanced at the time of realization of this experiment, without any specific preference. The models were pointed at different sets of tasks, and therefore this should not be read as any type of model benchmark; no conclusion should be drawn about which model is stronger. The lessons came from cross-validating and cross-refuting each other’s claims using independent contexts.
How We Beat the Best Published Results on Round-Reduced AEGIS-128L
In this section we describe the main findings of our investigation. First, we introduce the three concepts needed to follow the results, so that no background in cryptanalysis is required. Then we show that where an attacker varies the input changes how deep the analysis reaches, present the two results that improve on the published literature, prove the first of them, and look at what the automated tooling used by the field makes of the same question. We close with what all of this means for the community.
The Three Ideas Behind the Results
- The nonce is the attacker’s handle: Every message encrypted with AEGIS-128L carries a 16-byte public value called a nonce, whose job is to ensure that encrypting the same text twice does not produce the same output twice. It is not secret, and in the threat model this literature works in, the attacker is allowed to choose it. Those 16 bytes are the only thing an analyst gets to vary.
- The zero-sum test is the distinguisher: Pick a few nonce bytes, encrypt under every combination while holding the rest fixed, and sum the results bitwise. A zero sum across all keys indicates non-random structure, creating a distinguisher. Sweeping these inputs forms a cube (e.g., two bytes costs 2¹⁶ encryptions; four bytes costs 2³²). The more rounds the zero sum survives, the smaller the cipher’s security margin.
- Position of the bytes: AES-style ciphers mix bytes laid out in a 4×4 grid column by column after shifting rows. Four bytes on the same diagonal feed into one column, while four on different diagonals feed into four distinct columns. Input position determines how bytes spread through the cipher and how long balance survives.
Byte Placement Matters
Indexing AEGIS-128L’s 16 nonce bytes by AES diagonal reveals that byte placement significantly affects distinguisher performance. While classical attacks use a diagonal cube (four bytes in one diagonal), selecting a transversal cube - one byte in each of the four diagonals - achieves balance (Σ S[3] = 0) after six rounds at 2³² encryptions, whereas, at the keys we tested, diagonal and partial-diagonal placements fail.
In these tests, every configuration varies four nonce bytes, costing 2³² encryptions: about 4 billion, or a few minutes of one machine’s time. Diagonal coverage measures how many distinct diagonals those four bytes occupy when testing for a zero sum (Σ S[3] = 0) after six rounds on one of the cipher’s internal state words. A zero sum indicates a distinguisher; a non-zero sum means the output appears random.
In these tests, the threshold is sharp at coverage 4 (one varied byte in each of the four diagonals), not a gradient: Three diagonals buy nothing that one diagonal does not. And the winning shape is not a lucky individual choice, but a family - all 256 members of the transversal family balance, and the proof covers every one of them.
The mechanism is simple enough to state in a sentence: Where you place the varied input bytes matters, not just how many you vary. The evaluations vary cube dimension but hold placement fixed. Placement is free, and it is worth rounds.
The Impact of the New Distinguishers
There are two places to run that test, and they are not equally meaningful. The cipher carries eight internal state words that nothing outside the algorithm ever sees, and it produces a keystream, which is the value actually combined with the message and therefore the one an adversary can observe. A result on the keystream is worth more than a result on the internal state. We have one of each, and they improve on different published baselines.
Internal state - six of 10 rounds at 2³² data: The best published integral result reaches the same six rounds, but requires 2¹²⁸ - the entire nonce space, with no data margin above it. Same round count, 4 billion queries instead of all of them. We do not claim to beat the round count; we claim to reach it practically. A distinguisher that consumes every nonce a cipher will ever accept is a statement about the design; one that runs in minutes on a laptop is an experiment. This result is also proved: It holds for every key, every nonce base and every transversal placement, and two independent clean-room reviews reconstructed the proof (Campaign 4).
Observable keystream - four
Comments
No comments yet. Start the discussion.