php - How should I incorporate the salt in my password hash? -


how stronger would

return sha1($salt.sha1($passwd)); 

be compared just:

return sha1($salt.$passwd); 

$salt per-user string of length 12 consisting of strong random ascii.

it's twice strong, because attacker needs perform twice many sha1 calculations brute force attack.

of course, still not impressive. on other hand, doing sha1 5000 times in loop practical authorization, makes attacks take 5000 times longer - technique known key strengthening. is, however, poor man's substitute adaptible-cost hash algorithms jacco mentions.


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -