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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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