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$j1uR3C0t1bPJQ6B7QXv1n.3a6nzzZCTbYF/XirpMUg2RECyhGrRny


Decryption

$unencrypted_password = "KosonTechnology";
$hash= "$2y$10$j1uR3C0t1bPJQ6B7QXv1n.3a6nzzZCTbYF/XirpMUg2RECyhGrRny";
$verify = password_verify($unencrypted_password, $hash);

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