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?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
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)