What security risks are associated with storing passwords in plaintext or using reversible encryption methods?

Storing passwords in plaintext or using reversible encryption methods can expose sensitive user data to potential security breaches. It is best practice to securely hash passwords using strong cryptographic algorithms, such as bcrypt, to protect user credentials from being easily compromised.

// Hashing a password using bcrypt
$hashedPassword = password_hash($password, PASSWORD_BCRYPT);