Search code examples
phpencryptioncryptographypassword-protectionpassword-hash

Password-Hashing with Taylor Hornby (Defuse)'s Compatible version works with all PHP versions?


I'm interested in using Taylor Hornby(aka Defuse)'s PHP password-hashing method (the PHP compatible version), which I found here: https://github.com/defuse/password-hashing

  1. Does it work "safely" in PHP 4 and above?
  2. Does it work safely in different servers? a 64-bit will give the same hashes as a 32-bit?

I'm asking this because different hosting companies provide different PHP versions and different Linux versions, that's why I'm afraid to implement this technique which might work just fine in my development server, but fails to work properly in production server.


Solution

  • It does not work in PHP 4, as it requires either hash_pbkdf2 (available in PHP 5.5+) or hash_hmac (available in PHP 5.1+ or PECL).

    It will work the same in 64-bit, as well as 32-bit.