Answers for "openssl_decrypt(): IV passed is 16 bytes long which is longer than the 8 expected by selected cipher, truncating in BF-CBC"

5

openssl_encrypt

$textToEncrypt = "My super secret information.";
$encryptionMethod = "AES-256-CBC";  // AES is used by the U.S. gov't to encrypt top secret documents.
$secretHash = "25c6c7ff35b9979b151f2136cd13b0ff";

//To encrypt
$encryptedMessage = openssl_encrypt($textToEncrypt, $encryptionMethod, $secretHash);

//To Decrypt
$decryptedMessage = openssl_decrypt($encryptedMessage, $encryptionMethod, $secretHash);

//Result
echo "Encrypted: $encryptedMessage <br>Decrypted: $decryptedMessage";
Posted by: Guest on August-06-2020

Code answers related to "openssl_decrypt(): IV passed is 16 bytes long which is longer than the 8 expected by selected cipher, truncating in BF-CBC"

Browse Popular Code Answers by Language