But at least, if you want to roll your own password hashing, do it right: use hmac, salting, stretching and a decent hash function - or use bcrypt/scrypt and save yourself a few headaches.
For example, I see a lot of this construction in proprietary code:
$passwordHash = md5(md5($password) . md5($salt));
if ($storedHash == $passwordHash) {
// Authenticated successfully
}
I'm quick to find these offending snippets and migrate our clients to use password_hash() and password_verify(). SELECT * FROM user WHERE username = '$username' AND password_hash = MD5('$password')It is markedly less common, but still quite common, if not pervasive like it used to be. PHP apps are dramatically more likely to have security vulnerabilities of any sort. It is a running joke we have that one of our recommendations to remediate security issues with PHP is to "rewrite in a different language". For whatever reason PHP has a history of encouraging vulnerable code. Even in good shops. PHP itself isn't really to blame (it is, of course much less likely for an experienced shop to write crappy PHP... but they probably wouldn't pick PHP to begin with).
Using bcrypt/scrypt/Argon2id does.
As opposed to...?