Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SHA1 collision demo / example

Tags:

hash

sha1

This question is similar to this, but that one only references MD5 collision demos.

Are there any actual SHA1 collision pairs of arbitrary messages known so far ?

I'd like to use these to test how various software products (my own one and some third party) deal with it.

Doing some Google searches only turned up the oh-so prominent MD5 / SHA0 collisions and some hints on an approach to creating SHA1 collisions but I could not get my hands on any examples.

like image 209
Arc Avatar asked Aug 13 '10 09:08

Arc


People also ask

What is a collision on SHA-1?

SHA-1 collision attacksIn a cryptographic hash function, collisions should in theory be not significantly faster to find than in a brute force attack. Such a brute-force attack is based on the birthday paradox, and it would require expected 2^80 computations to produce a SHA-1 collision.

Does SHA-1 have collisions?

“We note that classical collisions and chosen-prefix collisions do not threaten all usages of SHA-1." There are several potential scenarios in which the new collision could be implemented in an attack, the most likely of which is someone impersonating another user by creating an identical PGP key.

How much does a SHA-1 collision cost?

In their paper, Leurent and Peyrin put the theoretical cost at $11,000 for a SHA-1 collision and $45,000 for a chosen-prefix collision. To actually carry out their attack required two months of computation time using 900 Nvidia GTX 1060 GPUs.

Is SHA-1 collision free?

In order to prevent this attack from active use, we've added protections for Gmail and GSuite users that detects our PDF collision technique. Furthermore, we are providing a free detection system to the public. You can find more details about the SHA-1 attack and detailed research outlining our techniques here.


2 Answers

As of February 23rd 2017 this answer is no longer accurate.

For more than six years, the SHA1 cryptographic hash function underpinning Internet security has been at death's door. Now it's officially dead, thanks to the submission of the first known instance of a fatal exploit known as a "collision."

There is no known collision for SHA-1 yet. Right now:

  • There are some collisions on reduced versions of SHA-1, with less than the 80 rounds of the standard SHA-1.
  • An algorithm has been describe, which should obtain a SHA-1 collision with a computational effort roughly equivalent to 263 invocations of SHA-1 on small messages; that's much better than generic algorithms (which require 280 invocations on average) but that's still quite big and that algorithm has not been run yet.

There was an effort to obtain a SHA-1 collision by harnessing power from whoever had some spare CPU clock cycles to donate, with the BOINC framework to organize the whole thing, but there were not enough volunteers and the effort was abandoned last year. Hence no actual SHA-1 collision yet.

Theoretical attacks rely on some assumptions which may prove to be slightly false; for instance, the attack on MD5 is actually a bit faster than expected (at some point there is a property which must be fulfilled, with a theoretical probability of 2-28, but in practice it is more like 2-27.7, i.e. the attack is 20% faster than predicted). It is still considered that the theoretical attack is correct and the complexity "rather accurate".

like image 114
Thomas Pornin Avatar answered Sep 23 '22 05:09

Thomas Pornin


The first known collision has now been published at https://shattered.it/

$ curl -sSO https://shattered.it/static/shattered-1.pdf $ curl -sSO https://shattered.it/static/shattered-2.pdf  $ sha1sum *.pdf 38762cf7f55934b34d179ae6a4c80cadccbb7f0a  shattered-1.pdf 38762cf7f55934b34d179ae6a4c80cadccbb7f0a  shattered-2.pdf  $ sha256sum *.pdf 2bb787a73e37352f92383abe7e2902936d1059ad9f1ba6daaa9c1e58ee6970d0  shattered-1.pdf d4488775d29bdef7993367d541064dbdda50d383f89f0aa13a6ff2e0894ba5ff  shattered-2.pdf 
like image 41
Dave L. Avatar answered Sep 21 '22 05:09

Dave L.