I believe hash('sha256', $pw)
is FIPS compliant, but I know for certain that an attack vector is possible with using that function. Also, there is no salt (so I would have to encounter that implementation and I would rather not). Is password_hash
/password_verify
FIPS compliant?
Asked
Active
Viewed 425 times
2
-
password_hash has a salt 'built in'. if its just a matter of the particular hash algorithm it uses, you can decide that. – Nov 16 '16 at 21:28
-
http://security.stackexchange.com/questions/98214/why-should-i-choose-sha-such-as-sha-512-instead-of-bcrypt-or-pbkdf2-for-fips – Jonathan Kuhn Nov 16 '16 at 21:35
1 Answers
1
No.
FIPS 140-2 does not certify password hashing algorithms. As such,
password_hash
cannot be FIPS compliant, because FIPS simply doesn't apply to it.To the best of my knowledge, the hash implementations used by
hash()
(which are part of the PHP core) have not been FIPS certified. If you specifically need a FIPS-compliant implementation, and you have a FIPS-compliant OpenSSL library installed, you may be able to useopenssl_digest()
as an alternative. (However, remember that this is not a secure method of storing passwords, even with a salt!)

Community
- 1
- 1