I have a problem to decrypt with openssl.exe a string encrypted with "openssl_encrypt()".
I crypt my string with PHP like this:
$string = 'This is a test.';
$pass = '123ThisIsAPass987';
$method = 'bf-cbc';
$options = OPENSSL_RAW_DATA;
$iv = 23693999;
echo "iv (hex): ".unpack("H*", $iv)[1];
echo "<br>pass (hex): ".unpack("H*", $pass)[1];
echo "<br>";
file_put_contents('./file.encrypted', openssl_encrypt($string, $method, $pass, $options, $iv));
And when I decrypt with this command, I don't get the correct result:
openssl.exe enc -bf-cbc -d -in file.encrypted -out file.decrypted -nosalt -nopad -K 3132335468697349734150617373393837 -iv 3233363933393939
Thx for your help.