Search code examples
hashsha1

SHA1 collision demo / example


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.


Solution

  • The first known collision has now been published at https://shattered.it/ (web archive)

    $ 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