Is PHP's password_hash FIPS compliant?

前端 未结 1 1885
陌清茗
陌清茗 2021-01-21 16:22

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 w

相关标签:
1条回答
  • 2021-01-21 17:18

    No.

    1. 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.

    2. 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 use openssl_digest() as an alternative. (However, remember that this is not a secure method of storing passwords, even with a salt!)

    0 讨论(0)
提交回复
热议问题