Which PHP function should be used to store user passwords securely?
Correct answer
C. password_hash()
17 views
C. password_hash()
17 views
password_hash() generates a salted, slow hash (bcrypt by default), and password_verify() checks it. MD5 and SHA-1 are fast and easily cracked, and Base64 is just an encoding, not protection.
Asked in: NTS, PHP Developer Interviews
Not sure why the answer is C? Ask here and get an explanation.