Last active
December 30, 2022 16:15
-
-
Save aziza-kasenova/0cc029f74c03b7a19868ac4f8052a10a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$plainText = 'Hello, World!'; | |
echo "This is an original: {$plainText}\n"; | |
$key= "my32digitkey12345678901234567890"; | |
$iv = "my16digitIvKey12"; | |
$encrypted = openssl_encrypt( | |
$plainText, | |
'AES-256-CBC', | |
$key, | |
0, | |
$iv | |
); | |
echo "This is an encrypted: {$encrypted}\n"; | |
$decrypted = openssl_decrypt( | |
$encrypted, | |
'AES-256-CBC', | |
$key, | |
0, | |
$iv | |
); | |
echo "This is a decrypted: {$decrypted}\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment