You are building a web application where the security of user data is paramount. Which password hashing algorithm would be most appropriate to use in PHP?
- password_hash()
- md5()
- sha1()
- bcrypt()
bcrypt() is the recommended choice for secure password hashing in PHP. It's a one-way hashing algorithm with salting, making it extremely resistant to brute-force and rainbow table attacks. In contrast, md5() and sha1() are outdated and less secure. password_hash() is a more recent option, but it's best used with bcrypt().
Loading...
Related Quiz
- In PHP, the ________ function can be used to return a part of a string.
- What is the meaning of a Persistent Cookie?
- What is the concatenation operator in PHP?
- You are writing a PHP script and you need to define a constructor in a class. How would you do this?
- In PHP, you can close a connection to a MySQL database using the mysqli_close function.