Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '14 at 19:26
because they are designed to, google avalanche effect – Richie Frame Mar 13 '14 at 19:26
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

Your Answer


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.