SHA-1

H:{0,1}{0,1}n

The domain of the function H is all possible binary strings (Kleene star notation). The codomain is the set of binary strings of fixed length n. For SHA-1 n=160. This hash function produces a 20 byte value called a “message digest” — get it? Like it “digested” some text input, yummy.

It has been SHAttered because two inputs can produce the same “message digest” — oh no. They found a collision 100,000 times faster than using brute force by guessing strings that might share the same message digest.

Let’s say we both sign a contract agreeing to be best friends. We hash the document and get,

38762cf7f55934b34d179ae6a4c80cadccbb7f0aMost excellent. I then send you a document that states “we are not best friends” and you check to make sure it is the exact same one that you signed and low-and-behold it has the same message digest!

38762cf7f55934b34d179ae6a4c80cadccbb7f0aOh dear. This is no good. The whole point was to validate our contract! But now a different contract yields the same message digest? We actually are best friends! But the math had a collision. A collision that destroyed our friendship. So sad. Stop using SHA-1 apparently there are like 63 of these in the wild. So be careful in your git repositories.

SHA-1
Interactive graph