Since MD5 is broken for purposes of security, what hash should I be using now for secure applications?
|
Among the options for a replacement of MD5 as a hash function:
But beware: if you need to replace MD5 in an application where using a hash was a bad design choice in the first place, which include many uses in conjunction with password (protection of login information, or generation of a key from a password), then you do not want just to replace MD5; you want to change the design. For anything password-related, I would recommend scrypt when constraints allow (that is: there is ample memory; an efficient implementation of Salsa-20 is possible; and an appropriately secure implementation of SHA-256 is possible, which might be difficult if DPA is a consideration). |
|||||
|
|
That depends on what you want to use the hash function for. For signing documents, sha2 (e. g. sha512) is considered secure. For storing passwords, you should use one of the algorithms dedicated for this purpose: e. g. bcrypt, sha512crypt or scrypt. In order to slow down an attacker, these algorithms apply the hash functions many times with an input that is based on the number of the current round. Scrypt takes this concept one step further and uses a huge amount of memory. Typical hardware for password cracking has access to about a couple of KB of memory, the default configuration of scrypt requires 16 MB. |
|||||||
|
|
One of the SHA2 hashes; if you don't have any preference between them, pick SHA256. Those hashes are the most commonly accepted hashes we have. Eventually, NIST will select the Advanced Hash Standard; until then, the SHA2 hashes are the best we have. |
|||||||||
|