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);
$2y$10$t0TQLzY6tBXU7Ok3Ea382eXkgJxJsNjma2DentHYQRIRexU9L6pja
Decryption
$unencrypted_password = "KosonTechnology";
$hash= "$2y$10$t0TQLzY6tBXU7Ok3Ea382eXkgJxJsNjma2DentHYQRIRexU9L6pja";
$verify = password_verify($unencrypted_password, $hash);
if ($verify) {
echo 'Correct Password!';
}
else {
echo 'Password is Incorrect';
}