As PHP 5.5.0 is out now,
Which one is better to use (security, portability, future proof)?
It says the password_hash() PASSWORD_DEFAULT may change in each full release (+1.0 or +0.1) so how can we use previously DEFAULT method hashed password with new default? does that mean PHP 5.5 scripts with already hashed passwords in database will not work on PHP 5.6 until users change their passwords? what about COST change (i'm trying to know if servers can be updated to php v5.6, or website admin may change the hosting provider (and then change COST for weaker/stronger servers), without any problem for current users)
Should we wait for some updates or are they already safe to use in 5.5.0
Should we still use PHPass etc frameworks or these new PHP 5.5 functions are enough and/or more future proof?
The password hashing functions (such as password_hash) are preferred, as they automate more of the process, such as picking a salt, verifying passwords, and rehashing.
The password_verify function will automatically detect what algorithm was used to generate a hash, so there's no compatibility issue.
These functions are in a released version of PHP, so they should be fine to use.
Use PHPass or a shim such as password_compat if your code needs to run on versions of PHP earlier than 5.5. Otherwise, use the password hashing functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With