Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>MD5 is still reasonably safe to use for most cases[*], so long as you use a good "salt" to mix in with the actual password before it's encrypted.</p> <p>There is still no known way other than brute force to accomplish a "first pre-image attack" on MD5, i.e. given a hash, figure out what the original password was.</p> <p>The "salt" mentioned above is necessary to ensure that your encrypted passwords can't be trivially looked up in a "rainbow table" or other existing lists of "string to digest". </p> <p>The recent Linked-In password leak is a good example of why salt is important. They failed to salt their users' passwords, so many of the passwords were trivially reversed because the hashes of those passwords are already computed (and in many cases found via Google).</p> <p>What you still shouldn't do though is have the salt itself easily determined. If the attacker can work out what the salt is all bets are off, because then the brute force mechanisms described in the article posted by Florian become available again. A good salt should be long, and you shouldn't use the same salt for every user.</p> <p>The only true weaknesses so far found in MD5 itself have been ways to produce a new file which manages to result in the same MD5 digest as another file, when you <em>already know the contents of the original file</em>. This is known as a "second pre-image attack", and is irrelevant when considering the use of a hashing algorithm for password encryption.</p> <p>All that said, if a better algorithm (SHA-2, bcrypt) is available, you might as well use it!</p> <p>[*] I wouldn't use MD5 for anything relating to eCommerce, though!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COMD5 is not safe for anything security-related any more. Especially not passwords. Even if no flaws had been found in MD5, it would still not be appropriate for passwords because it's far too fast. [Salt would **not** have saved LinkedIn](http://security.stackexchange.com/q/15910/1472). These days it's faster to brute force an MD5 (or SHA1) password than to read the rainbow table off the disk. The LinkedIn hashes were already de-duped before being leaked which couldn't have happened if salt had been used. The SHA2 family is too fast. Use bcrypt, scrypt or PBKDF2.
      singulars
    2. CO@Ladadadada Sure, use bcrypt, scrypt, whatever, I agree that all that is best practise. But the fact remains that with a properly random salt (say 256 bits) where each password has a different salt and is unknown to the hacker it would _still_ take longer than the lifetime of the universe to brute force MD5 even with every NVidia card ever made. It would be far faster to brute force the password login at 1 attempt per second than to brute force the hash. And most of the comments on the answer you linked to appear to agree with that.
      singulars
    3. COChecking the entire keyspace of MD5, sure, longer than the lifetime of the universe. Checking 8 characters of the entire printable ASCII set as MD5? 35 days with a single Radeon HD 5830 for $170 [using this table](http://golubev.com/gpuest.htm). And probably half that on average to find the password. Salt doesn't change the time taken to check a single password (unless it's big enough that disk access is the bottleneck). It only forces each password to be cracked individually. And please explain how 1 attempt per second can be faster than 3.3 billion per second?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload