Why MD5/SHA1 password hashes cannot be decrypted?

2019-03-21 18:41发布

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?

3条回答
Root(大扎)
2楼-- · 2019-03-21 19:25

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.

查看更多
小情绪 Triste *
3楼-- · 2019-03-21 19:38

I have always believed that the md5 and sha1 could not be decrypted and have used in my applications. But to my surprise I found some sites that perform the procedure. see http://www.crypt-security.com/ Therefore this procedure is not secure enough

查看更多
倾城 Initia
4楼-- · 2019-03-21 19:39

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

查看更多
登录 后发表回答