3 ms·
Doing it right for most cases mean not doing it all. You shouldn't be thinking about hash functions and salts. Instead you should use a cryptosystem designed an
by zokier 14y ago
Doing it right for most cases mean not doing it all. You shouldn't be thinking about hash functions and salts. Instead you should use a cryptosystem designed and implemented by experts.
DO NOT DO CRYPTO YOURSELF
- Ralith 14y agoThe problem is you still have to go out and successfully identify which cryptossytem was designed and implemented by experts and is appropriate for your use-case.
- pjscott 14y agoVery right. A lot of people do something naive like just hashing passwords with a standard cryptographic hash function, figuring that they're designed and implemented by experts, and they end up with a careful implementation of the wrong algorithm. Of course, in the case of password hashing, the answer is pretty easy. (Spoilers: scrypt if there's an easy library for your language of choice, bcrypt otherwise, and PBKDF2 if you need to justify your decision to someone who habitually wears a tie.)
- FuzzyDunlop 14y agoValid point, but what if you don't know who the experts are? You're preaching to the choir on HN when it comes to PBKDF and Bcrypt and Scrypt and all that; but outside of our circle, people will consider anything documented on the net to be potentially expert advice. Check this for a bunch of custom password hashing functions: http://php.net/manual/en/function.sha1.php http://php.net/manual/en/function.sha1.php