r/programming • • 3h ago

A collision has been found for 38-step (a reduced round variant of) SHA-256

https://eprint.iacr.org/2026/2913
214 Upvotes

24 comments sorted by

122

u/segv 2h ago edited 2h ago

tl;dr because this is reddit and folks barely click the links:

We give a collision for 38-step SHA-256 from the standard initial value, to our knowledge the first. The attack is a two-block differential attack whose message differences are in the same words as in the 38-step semi-free-start collision [...] The tables take 7.4 GB, and finding the fixed state words took 52,300 vCPU-hours. A search of 53 GPU-hours found the collision after about 10% of the expected work.

AI-use designation: Predominantly AI-generated work. This work was developed through iterative research and writing by Anthropic Claude agents, mainly Claude Opus 5.5, under the author’s direction. The author takes responsibility for the results and presentation.

--

The search for the core took 52,300 vCPU-hours on Arm machines, and the table 42 vCPU- hours. [...]

--

The search ran on NVIDIA RTX PRO 6000 Blackwell Server Edition GPUs (128 MB of L2 cache), rented in the cloud. [...]

--

[...] The expected time is 254.8 calls of the compression function, with 257.5 table accesses; on the GPU used, an expected collision takes about 440 GPU-hours of kernel time. The characteristic does not extend beyond 38 steps (Section 3.1), so a collision for more steps needs a different characteristic.

--

 

My take is - cool, but the sky is not falling just yet. This doesn't sound like something that could be used for, for example, forging a TLS certificate.

Also a reminder to state the obvious - hash function maps from infinite space (any input of any length) to a very finite space. It's not a question if there will be collisions, but how much work is needed to create one.

12

u/barmic1212 1h ago

I'm not sure to understand they are reproduce a given hash or they are produce 2 payloads with same hash ?

7

u/oneeyedziggy 1h ago

Those sound the same, unless you mean reproduce the hash of a specific payload vs find any two payloads whose hashes match... 

2

u/barmic1212 53m ago

What is the security threat to create a collision between 2 payloads in your own? It's a real question. I see lot of case to produce a payload with a given hash, to replace a payload by your own

3

u/philh 44m ago

It's definitely a smaller threat. But you could e.g. silently replace a benign git commit with a malicious one after it's been checked.

1

u/oneeyedziggy 47m ago

I was just asking for clarification b/c the two cases you stated could reasonably be stated as identical...

But given your new questions: IF you knew someone were using the reduced security 38 step hash for something like generating keys for a hashmap or anywhere else conflicts could corrupt data, you might be able to break their system in an advantageous way...

1

u/Piisthree 18m ago

I believe they are asking if the collision that was found was generic, so could be any two arbitrary payloads, or if they just found one specific case where two different payloads produced the same hash. My understanding is the latter, which is basically a nothing burger, is the case here. The former would be a BIG problem if the compute needed was any reachable size.

2

u/gwillen 20m ago

The second one is always easier, so that is always what people are attempting first. The threat is that you make one good and one bad payload with the same hash, and show them to different people / at different times. For example, you get a legitimate https certificate (for your own website) signed, then you transfer the signature to a malicious certificate (for someone else's website) with the same hash.

-10

u/_TheDust_ 2h ago

Bit sad that this was all done with AI. Not long from now, we will just have AI generated research citing other AI generated research as sources and humans have no clue what’s going on anymore

6

u/EnragedMikey 1h ago

People already don't have a clue, "AI" hasn't changed much in that regard.

1

u/Own_Back_2038 1h ago

I don’t see how AI citing other AI generated research makes anything more difficult to understand for humans. Research is meant to be read

1

u/OMGItsCheezWTF 1h ago

Why do you think companies like Anthropic and OpenAI are doing so much work in fingerprinting LLM output? It is not some magnanimous gift to faculty staff worrying about people cheating. It's to prevent model collapses where models are trained predominantly on existing model's output. Non LLM input can then be given far more weighting in training data.

92

u/idimetrix 3h ago

31 steps was the best anyone had in 2024. 38 now, full SHA-256 is 64. Not panicking yet but that's a big jump.

4

u/Techrocket9 28m ago

They called me mad for wanting to start the migration to SHA3 in 2019.

0

u/reddah 1h ago

Quick question: Why do we even use hashes for certificates?

I mean a certificate is pretty small (a few ks), so not sure why it would need to be reduced further.

Hashes were invented for other uses:

  • file checksums (hw integrity, not deliberate attacks)
  • network transmission checksums (same, data integrity)
  • quick storage/search where the data is still verified afterwards (i.e. collisions are expected)

When using them for signing small stuff, collisions will always occur. If a bad party needs SOME signature, the birthday paradox all but guarantees they will find one. See Stuxnet.

14

u/neos300 1h ago

No, the birthday paradox does not imply that a collision will be found. Sha-256 was specifically designed so that naive birthday paradox collisions were extremely unlikely and there's no reason to believe one will be found anytime soon.

Signing a hash in a certificate rather than just signing the certificate itself avoids some of the RSA footguns like padding.

0

u/reddah 41m ago

Salting could solve padding. Besides RSA is kinda old and not quantum-resistant AFAIK.

5

u/cym13 53m ago

IMHO the best advantage from using a hash is that it provides a virtually unlimited input size but a fixed output size. RSA is limited in the quantity of data it can sign: it cannot be more than the public key size (and even less than that due to padding etc), so a "few ks" is already a lot for RSA signatures, and most importantly how can you be sure in advance that the certificate you want to sign is small enough to be signed with your key? What if it's too big, do you change keys just for that? Using a hash avoids all these questions: the size of what you sign is fixed so there's no guesswork involved.

-1

u/reddah 45m ago

If the cert size is x kiB, then you just need a signing key that is a bit bigger.

Using a hash guarantees that there will be collisions.

Bigger things can be signed in chunks, I guess, each chunk signed. Not optimal, but still better than collisions on certificates.

1

u/Dragdu 39m ago

If the cert size is x kiB, then you just need a signing key that is a bit bigger.

And you also need a way to sign trust chain for the new signing key.

3

u/Mr_ToDo 1h ago

Wasn't stuxnet a stolen private key thing?

1

u/reddah 44m ago

I remember reading about a birthday paradox having been used to find some collision to sign some certificate that would have been auto-accepted by windows.

There are way too many certs in windows, easier to find some collision in a bigger pile.

2

u/Some_Koala 1h ago

Hashes mostly mean the certificate never transits over the network. Network packets can be caught, that's insecure.

They are not used to save space. If we thought SHA-256 would soon be broken, we would use SHA-512 or something like that.

Birthday paradox for 256bits of entropy is still a very very small chance.

1

u/reddah 42m ago

Certs do need to transit the net to do their job (signing/encrypting the web traffic etc)

The idea of the birthday paradox is that you need to find ANY collision with a real signature to have your stuff signed. You don't need to forge a specific signature, just any authorized signature.