5
Searching on hash, I noticed that the second function parameter password_hash
, has two options, PASSWORD_DEFAULT
and PASSWORD_BCRYPT
,
- Exactly which of the two I should give preference to use?
It’s probably the PASSWORD_DEFAULT
? For in the documentation, it is explained both and said that:
DEFAULT PASSWORD - Use the bcrypt Algorithm (default as of PHP 5.5.0). Note that this Constant is Designed to change over time as new and Stronger Algorithms are Added to PHP. For that Reason, the length of the result from using this Identifier can change over time. Therefore, it is Recommended to store the result in a database column that can expand Beyond 60 characters (255 characters would be a good Choice).
PASSWORD_BCRYPT - Use the CRYPT_BLOWFISH Algorithm to create the hash. This will Produce a standard crypt() compatible hash using the "$2y$" Identifier. The result will Always be a 60 Character string, or FALSE in case of failure.
So with this quote it can be assumed that Bcrypt
and Crypt_Blowfish
are different patterns, exactly
- What would be the difference between them?