Skip to content

Instantly share code, notes, and snippets.

View itsfreddyrb's full-sized avatar
🎯
Focusing

itsfreddyrb itsfreddyrb

🎯
Focusing
View GitHub Profile
@itsfreddyrb
itsfreddyrb / password_hashing_api.md
Created October 12, 2017 21:09 — forked from nikic/password_hashing_api.md
The new Secure Password Hashing API in PHP 5.5

The new Secure Password Hashing API in PHP 5.5

The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:

Why do we need a new API?

Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.