<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Omer on Medium]]></title>
        <description><![CDATA[Stories by Omer on Medium]]></description>
        <link>https://medium.com/@omer_72679?source=rss-c38e52b69e07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UmgIIR6ek_k5iOvJ</url>
            <title>Stories by Omer on Medium</title>
            <link>https://medium.com/@omer_72679?source=rss-c38e52b69e07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:47:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omer_72679/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Finding the First 38-Step SHA-256 Collision with AI Agents]]></title>
            <link>https://medium.com/@omer_72679/finding-the-first-38-step-sha-256-collision-with-ai-agents-5abff3b360d9?source=rss-c38e52b69e07------2</link>
            <guid isPermaLink="false">https://medium.com/p/5abff3b360d9</guid>
            <category><![CDATA[hash-function]]></category>
            <category><![CDATA[sha-256]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Omer]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 12:54:12 GMT</pubDate>
            <atom:updated>2026-11-25T12:54:12.833Z</atom:updated>
            <content:encoded><![CDATA[<h3>We used AI agents to turn theoretical reduced-step SHA-256 attacks into two new collision records: the first known collisions for 37- and 38-step SHA-256 from the standard IV. Getting there took a month of mathematical research, custom algorithms, and GPU engineering, but the hardest part was knowing when to trust the agents and when to send them back</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8VypBdyt1KFYrCCPgn4gg.gif" /></figure><p>I’ve always found cryptography fascinating, and hash functions especially. Hashes help verify software downloads, support digital signatures, and efficiently identify stored data by its contents. The usefulness of hash functions depends in part on how difficult it is to find two different inputs with the same output - this is what we call a hash-collision, or simply a collision.</p><p>The thing I find especially intriguing is that collisions are mathematically unavoidable: by the <a href="https://en.wikipedia.org/wiki/Pigeonhole_principle">pigeonhole principle</a>, mapping a larger set of inputs into a smaller set of outputs guarantees that some inputs will collide. Hash-functions accept an input of any length, and therefore with an unlimited input space and a finite set of outputs, there must be infinitely many colliding inputs. We know they’re there, yet no matter how hard we try - we cannot seem to find even a single colliding pair. I still find that mind-boggling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTp--6Rt0-g5vLapdVCtQQ.png" /><figcaption>Five messages and four possible hash values: at least two messages must share a hash.</figcaption></figure><p>This blog post aims to unveil some of the work that went into building the state-of-the-art attacks on SHA-256 that we developed. In October 2026, we found the first known collisions for 37- and 38-step SHA-256 using the standard starting values. In order to understand what that means, we first need to learn a little about the structure of SHA-256, and about hash-collision attacks.</p><p>SHA-256 normally processes each block of data through 64 steps: essentially, a loop that runs 64 times, mixing the internal state at each iteration. Studying versions with fewer steps lets us follow how little changes to an input spread through the calculation, and look for ways to make their effects cancel out. We also keep the standard initial value, or IV: the starting values specified by the algorithm. Choosing those ourselves would give us extra freedom, so the distinction matters.</p><p>But before getting into how we found the collisions, a quick detour on how cryptographers measure the complexity of an attack.</p><h3>A note on practical computability</h3><p>In cryptography, we often describe the cost of an attack as the number of “basic operations” that one needs to perform in order to execute the attack, commonly written as a power of 2. This is convenient because each extra “bit” (that is, +1 in the exponent) doubles the work. Going from 2⁶⁰ to 2⁷⁰ means roughly a thousand times as much work. Ten bits don’t sound like much, until you’re paying for them. For readability, I’ve rounded the attack-cost exponents to whole numbers. The papers give the more precise estimates.</p><p>The definition of a “basic operation” matters, though. In hash-attack papers, it is common that “basic operation” is defined as one evaluation of the hash function, which itself is already a substantial computation: it takes modern CPUs thousands of arithmetic operations to complete a single hash evaluation.</p><p>To get a feeling for the scale, the GPU in a MacBook Pro with an M5 Pro chip can calculate roughly 0.5–1.5 billion SHA-256 hashes of short messages per second. Taking one billion per second, which is approximately 2³⁰, as a round figure, 2⁴⁰ evaluations take about 18 minutes, and 2⁵⁰ take about 13 days. A thousand machines would bring those 13 days down back to about 18 minutes. Four thousand machines sustaining that rate for a month would get us roughly 2⁶³ evaluations. Even at a rental price of just 17–35 cents per machine-hour, that month would cost approximately $500,000–$1 million. Adding another ten bits of work means doing the whole thing roughly a thousand times over.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*hg7pRf6wdpn_qU9vtLoIJA.gif" /></figure><h3>Back to collision attacks on SHA-256</h3><p>For an ideal hash function with an output of <em>n</em> bits, there exists a generic collision-attack algorithm that needs about the square root of 2ⁿ hash evaluations, called the <a href="https://en.wikipedia.org/wiki/Birthday_attack">birthday attack</a>. It is generic in the sense that it works no matter the hash function. For SHA-256, that gives us a baseline of about 2¹²⁸ evaluations. A cryptanalytic attack tries to exploit the specific function’s structure to improve on that baseline. An attack can beat it by an enormous factor and still be far too expensive to run - such an attack is usually called a “theoretical attack”.</p><p>Progress on SHA-256 collisions has come in bursts. In 2013, <a href="https://www.iacr.org/archive/eurocrypt2013/78810260/78810260.pdf">Mendel, Nad and Schläffer</a> demonstrated practical collisions for 28 steps and described a theoretical 31-step attack costing about 2⁶⁶ SHA-256 evaluations. The practical record stayed at 28 steps for more than a decade. In 2024, <a href="https://doi.org/10.1007/978-981-96-0941-3_8">Li, Liu, Wang, Dong and Sun</a> produced the first practical 31-step collision, reporting 1.2 hours on 64 threads.</p><p>Then things started moving. In 2026, <a href="https://eprint.iacr.org/2026/1080">Li, Liu, Wang and Shi</a> produced an actual 35-step collision. <a href="https://eprint.iacr.org/2026/1120">Subsequent work by Li and colleagues</a>, revised in September 2026, supplied the first actual 36-step collision pair, an improved 37-step estimate of 2⁷⁹, and a theoretical 38-step attack costing approximately 2¹⁰⁴.</p><p>Our goal was to be the first to find an actual 37-step colliding pair of messages, and then also find a 38-step collision. We used mostly Claude Opus 5.5 for the research and GPT-6.1-Sol for verification throughout the research, alongside open-source mathematical solvers and custom CPU and GPU code. The work involved finding useful patterns in the mathematics, constructing solutions that followed them, and making the resulting search run efficiently enough on real hardware.</p><h3>Using agents to lead the research</h3><p>My original goal was simply to improve the best-known collision attacks on SHA-256. Early in the project, an agent reported a theoretical attack on 39 steps that beat the generic birthday attack. I was excited, but I couldn’t easily verify the mathematics myself. I asked a different model to review the work, and it judged the result correct and novel. That was reassuring, but it left me relying on one model’s judgment of another model’s reasoning. I still didn’t know how much confidence to place in the result.</p><p>That changed what I wanted the project to produce. I wanted a claim I could check directly, even if I couldn’t follow every argument behind its discovery. An explicit collision pair would give me that: two different messages whose reduced-step hashes were identical. A short program could compute both hashes and compare them, giving the research a test of success I could verify myself.</p><p>Our method for managing the research centered on a single director agent. It delegated the mathematics to researcher subagents and was explicitly instructed not to do mathematical research itself. They read papers, explored ideas, wrote code and ran experiments. The director tracked findings and dead ends, challenged conclusions, arranged independent checks and used the results to choose the next question. When a researcher exhausted its context, the director briefed a successor.</p><p>One important example came when a researcher found three new patterns but reported no cost improvement. The director saw that the existing method was cancelling their advantage and sent it back with a new brief: “Your next task is to design the attack around A/B/C, not to fit A/B/C into the paper’s attack.” Subsequent agents developed pattern C into the method behind our verified 37-step collision.</p><p>One useful part of this process was being able to move between mathematics and engineering. An idea could look promising on paper and lose its advantage when we measured the cost of building its tables or moving data through GPU memory. Those measurements went back into the research. We could then look for a construction that was cheaper where the implementation actually spent its time.</p><p>There were also plenty of convincing dead ends. When an approach appeared exhausted, we went back to the assumptions behind that conclusion. Had the whole approach been ruled out, or only the particular versions tested so far? Was a claimed limit supported by an experiment, a proof, or an estimate carried over from earlier work?</p><p>At one point, after many failed attempts, the director concluded that our method could not get much cheaper than $4,000 per collision. It stopped launching researchers and called further mathematical work a “long shot.” I insisted we continue and pursue a riskier direction that had not been properly explored. The next researcher found a new approach, and further work brought the expected cost of our final 38-step construction below $800 per collision.</p><h3>Running the attacks</h3><p>Both attacks construct two messages with the same first block and different second blocks. For 37 steps, we built a large table of partial second-block solutions. Each first block produced an intermediate hash state, which we used to look up compatible candidates. This approach did not extend directly to 38 steps. The key insight there was finding a way to split the second-block construction into upper and lower parts that could be generated separately, then matched through a condition at step 17. That let us search compatible combinations using a much smaller table.</p><p>The 37-step table grew to about 0.86 terabytes, containing roughly 54 billion entries. Each of two cloud machines held a copy, split across its eight H100 GPUs, and searched its own range of first blocks. After roughly five hours and about 1.5 quadrillion first blocks, we had the collision. The entire 37-step research and attack cost roughly $1,300.</p><p>The final 38-step attack used about 7.4 GB of attack data, plus working memory. Each GPU could hold its own copy and search an independent range of inputs. The final run used about 53 rented GPU-hours, at an estimated cost of $95. We were lucky: the collision appeared after about a tenth of the expected work. A repeat search has an expected cost of roughly 440 GPU-hours, or about $770 at the prices used for that run. The entire 38-step research and attack cost roughly $5,900.</p><p>The expected search costs are about 2⁵⁴ compression-function calls for 37 steps and 2⁵⁵ for 38 steps. We charge one call per first block, and one per tested second-block completion at 37 steps or per match of the second-block pieces at 38 steps.</p><h3>Epilogue</h3><p>Here are the colliding pairs:</p><p>37-step:</p><pre>m1 = a842962f000501590f876ccb6a09e664c48c5ffd1f0ed9967991532fd413ccc82e9646618918bffae39b39933e1db32c98a02cc5f322a65e4da51ff70000003cd2bc00c7abfef304cd3329a6cd84f33c10a83fc342af055cf66ae2e094c44971b5b25831c54c3d468274d8bd3594d68911920d2959ae954edc7b3d064e484318<br>m2 = a842962f000501590f876ccb6a09e664c48c5ffd1f0ed9967991532fd413ccc82e9646618918bffae39b39933e1db32c98a02cc5f322a65e4da51ff70000003cd2bc00c7abfef304cd3329a6cd84f33c10a83fc342af055cee3da60992002df985b2d4a1c54cdd468274d8bd3594d68911920d2959ae954edc7b3d074e484318</pre><p>38-step:</p><pre>m1 = 33ee28ac5f8ef994c787777c079d17e11198d1beb527c8554bfeff014ab531951cf31bd2bbfc637e122da4f948e6e447d5a6b8b6ea9e7af5aac1aeabeeaceb0dbd07668b833fe88e689ffe8da52259da14b9855eee5138ba88355f4806d5cf5d161c50014c6b7d7e0e7eb888747559fc990a7af69dd8e59f57d7f6a3c0fbd03b<br>m2 = 33ee28ac5f8ef994c787777c079d17e11198d1beb527c8554bfeff014ab531951cf31bd2bbfc637e122da4f948e6e447d5a6b8b6ea9e7af5aac1aeabeeaceb0dbd07668b833fe88e689ffe8da52259da14b9855eee5138ba88355f4838b3d19d161c4ffd4c6b7d7e0e813888747559fc990a7af69dd8e59f57d7f6a3c0fbd03f</pre><p>After a month of research, large tables and quite a few cloud machines, the result fits in two pairs of 128-byte messages. For 37 and 38 steps, we can now point to actual examples of the collisions we knew had to exist. You can verify them yourself on an ordinary computer in a fraction of a second.</p><p>Two different inputs, exactly the same 32-byte fingerprint. I find that pretty beautiful.</p><p>For the full technical details, see the <a href="https://eprint.iacr.org/2026/2913">paper</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RbQW149Uumi2sRG4oQ0rXg.png" /><figcaption>I was pretty happy.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5abff3b360d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>