I recently read an article about password hashing.
How are MD5 or SHA1 hashes are created such that it can't be decrypted?? What I think is, it must be encypting string by certain FORMULA (it always gives same hash for the same string; so there must be no randomization) and thats why we should be able to decrypt that by the same FORMULA?? Or people don't know the forumla?
MD5 and SHA1 are not encryption algorithms. They are hashing algorithms.
It is a one way formula. Running MD5 or SHA1 on a particular string gives a hash that is always the same. It isn't possible to reverse the function to get back to the original string.
For example:
15 Mod 4 = 3
Even if you know the formula is
x Mod 4
you can't deduce x as it could be 3, 7, 11, 15 etc...
Obviously MD5 and SHA1 are a lot more complex!
In the above example, imputing 15 will always give you the answer of 3, but nobody would be able to deduce the original number. This does lead nicely on to collisions where multiple input strings could give the same hash:
http://en.wikipedia.org/wiki/MD5#Collision_vulnerabilities
Wikipedia has information on the particular algorithm used:
http://en.wikipedia.org/wiki/MD5#Algorithm
Everything is correctly explained by psych, I would like to add one more point to this:
15 Mod 4 = 3
Even if you know the formula is
x Mod 4
you can't deduce x as it could be 3, 7, 11, 15 etc
We can go even closer to our situation and have result of the action (like you have hash as result of action and action description)
x mod 4 = 3
x can be 12, 13, 14 or 15 which doesn't tell, what incoming integer we had.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With