PHP

PHP Password Encryption and Decryption

In this page, it includes the PHP source code and the display of
'How to Encrypt or Decrypt a String in PHP through password_hash'.

Encryption

Input
password_hash("KosonTechnology", PASSWORD_DEFAULT);
Output
$2y$10$U6KabNxyliztwBV3raDYleanVPt/15059fkTpWYuCWjOFW25u/P2q


Decryption

$unencrypted_password = "KosonTechnology";
$hash= "$2y$10$U6KabNxyliztwBV3raDYleanVPt/15059fkTpWYuCWjOFW25u/P2q";
$verify = password_verify($unencrypted_password, $hash);

if ($verify) {
echo 'Correct Password!';
}
else {
echo 'Password is Incorrect';
}