Why MD5/SHA1 password hashes cannot be decrypted?

家住魔仙堡 提交于 2019-12-03 08:55:29

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!