What are some potential security risks of using sha1 for password hashing in PHP?
Using sha1 for password hashing in PHP is not recommended due to its vulnerability to brute force attacks and collision attacks. It is considered insecure for password hashing as it is not resistant to modern computing power. To improve security, it is recommended to use stronger hashing algorithms such as bcrypt or Argon2.
// Fix: Use bcrypt for password hashing
$hashed_password = password_hash($password, PASSWORD_BCRYPT);