Can I improve the security of MD5 hashed passwords by populating an existing MD5 hash and hash result with Scrypt or PBKDF2 HMACSHA256?

I have a database of legacy passwords that were salty and hashed using MD5. I would like to update the system so that the data is more secure.

The first option is to switch users to a new hash scheme (Salt + Scrypt or PBKDF2 HMACSHA256) when they log into the system and deactivate old users after a certain period of time, so that they use the password recovery function, which automatically updates their hash.

Another option that would allow me to update everyone instantly would be to take the existing MD5 hashes, add a new random salt value to them, and then the hash result using the new hash scheme (Salt + Scrypt or PBKDF2 HMACSHA256) and save this value in the database data and delete the old value.

Then, when users log in, I will have to apply the old and then the new method. I like the second option better, as it allows me to remove all old insecure hashes from the database sooner rather than later.

Is it safe to salt and rephrase existing hashes? Is MD5 so broken that I can run a script for de-hash passwords and rephrase them with a new scheme?

Or maybe the best solution is to combine both options? Thus, I do not need to leave the existing MD5 hashes unsecured in the database, and can I move users to the new system for a certain period of time?

+5
source share
2 answers

MD5 , , , , , , , . MD5 ( ), ( , , , SHA2)

, , ( , , , ). MD5 . , , , HashCat ( Cuda OCL, 200 ). ( ), John the Ripper. , HashCat, .

, , reset . , , , . MD5 , . .

EDIT:

, MD5 , , , , . .

+5

. :

  • ,
  • ,
  • , ( ) :

MD5 , . () MD5 scrypt/Argon2 .

, "" - .

, pre-hash ( MD5).

, MD5. MD5 - 128 . , Base64, :

  • MD5: nMKuihunqT2jm0b8EBnEgQ==

- scrypt:

  • MD5: nMKuihunqT2jm0b8EBnEgQ==
  • scrypt: $s0$e0801$epIxT/h6HbbwHaehFnh/bw==$7H0vsXlY8UxxyW/BWx/9GuY7jEvGjT71GFd6O4SZND0=

, , , . , , :

MD5 + scrypt

- :

  • MD5: nMKuihunqT2jm0b8EBnEgQ==
  • MD5 + scrypt: $md5s0$e0801$eX8cPtmLjKSrZBJszHIuZA==$vapd0u4tYVdOXOlcIkFmrOEIr1Ml2Ue1l2+FVOJgbcI=
  • scrypt: $s0$e0801$epIxT/h6HbbwHaehFnh/bw==$7H0vsXlY8UxxyW/BWx/9GuY7jEvGjT71GFd6O4SZND0=

.

+1

All Articles