I know md5 is considered non-secure but what if someone used md5(md5(password).salt) instead? Isn't this technically better / more secure?

  • Let's say somebody finds an attack that can crack an hash from a hash function within a day. If it's a general attack it will work for every hash so H(password) and H(H(password)) are both hashes of the same size and thus vulnerable to the same attack and crackable in exactly the same time. – mroman Sep 9 '16 at 11:27
  • if you repeated the inner one 10,000 times before hashing, it would be somewhat safer by making it hard to run on dedicated hardware (ASICs) and prevent pre-rolled cracker profiles from working. – dandavis Sep 9 '16 at 12:46

The hash md5(md5(password).salt) is just as secure as md5(password.salt) .

All the difference i can see is the additional MD5 calculation md5(password) which increases the computing time the attacker needs to spend by a little and it may not be going to make a big difference.

Lets say the attacker takes the most used 100 passwords like welcome,monkey with md5 values 40be4e59b9a2a2b5dffb918c0e86b3d7,d0763edaa9d9bd2a9516280e9044d885 respectively.

He need to brute force password as well as salt in md5(md5(password).salt) using the list welcome,monkey .


He can simple do away with that additional MD5 calculation by using the list of md5 values calculated one time.

Example: md5("40be4e59b9a2a2b5dffb918c0e86b3d7".salt)

| improve this answer | |

Such combinations are often supported out of the box by password cracker tools. Have a look at the algorithms of hashcat you will see a lot of similar combinations. MD5 is not appropriate to hash passwords because of its speed, brute-forcing is ways too easy (about 100 Giga MD5 per second), so no it is not secure.

| improve this answer | |


When you are using md5(md5(password).salt) method it's as strong as md5(password.salt). It seems, that it need more time to find a collision when you are using md5(md5(password).salt) method. In that case, you can use bcrypt to manually slow down the collision attack operation. And using old md5 - bad idea.

| improve this answer | |
  • This adds nothing new to the other answers. – user13695 Sep 9 '16 at 8:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.