The domain of the function is all possible binary strings (Kleene star notation). The codomain is the set of binary strings of fixed length . For SHA-1 . 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,
Most 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!
Oh 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.