Is it possible to decrypt an MD5-encrypted password in PHP?

MD5 encryption is a one-way hashing algorithm, meaning it is not possible to decrypt the hashed password back to its original form. However, you can compare a user-input password with the MD5-encrypted password by hashing the user input and comparing it to the stored hash.

$storedPassword = '5f4dcc3b5aa765d61d8327deb882cf99'; // MD5-encrypted password
$userInput = 'password123'; // User input password

$userInputHash = md5($userInput);

if($userInputHash === $storedPassword) {
    echo 'Passwords match!';
} else {
    echo 'Passwords do not match.';
}