";
echo "secret password = $pass
";
// Encryption of $string using aes128 method
// the password $pass is used for symetric encryption
$encrypted = openssl_encrypt ($string, $method, $pass);
echo "Encrypted value = $encrypted
";
// Decryption of the $encrypted string: we use the same secret: $pass
$decrypted = openssl_decrypt ($encrypted, $method, $pass);
echo "Decrypted value = $decrypted
";
?>