Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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?

share|improve this question
    
By construction? AES and other good block ciphers also do this. –  figlesquidge Mar 13 at 19:26
5  
because they are designed to, google avalanche effect –  Richie Frame Mar 13 at 19:26
add comment

1 Answer 1

up vote 4 down vote accepted

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)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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