2
$\begingroup$

I am very curious on the fact that SHA, MD5 and all related Hash Functions change the output even by changing one bit in input Message. Why is that?

$\endgroup$
  • $\begingroup$ By construction? AES and other good block ciphers also do this. $\endgroup$ – Cryptographeur Mar 13 '14 at 19:26
  • 5
    $\begingroup$ because they are designed to, google avalanche effect $\endgroup$ – Richie Frame Mar 13 '14 at 19:26
4
$\begingroup$

This is called the diffusion property, and hash functions are explicitly designed to have this property. The reason you want this property is because it makes it harder to find patterns between similar plaintexts and their hashes.

Something like SHA-1 is based on a block cipher. This essentially means that hashing involves iterating some operations over a block of data many times. Each iteration, the bits get scrambled and effect the subsequent iterations. This way, one small change at the beginning makes a large difference 80 iterations later (SHA-1 does 80 iterations)

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.