Use openssl_decrypt() with passphase (not key/iv)
Clash Royale CLAN TAG #URR8PPP Use openssl_decrypt() with passphase (not key/iv) I'm trying to decrypt some data that has been encrypted with a passphrase and aes-256-cbc method in a PHP script. aes-256-cbc Here is how I encrypt the original data printf "Hello" | openssl enc -e -base64 -A -aes-256-cbc -k "MYPASSWORD" // output U2FsdGVkX1+dWuBuiitifH4zu1Yv/l7+HcfIqR/wxSc= When I try to decrypt it in command-line it works fine printf "U2FsdGVkX1+dWuBuiitifH4zu1Yv/l7+HcfIqR/wxSc=" | openssl enc -d -base64 -A -aes-256-cbc -k "MYPASSWORD" // output Hello BUT when I use openssl_decrypt() in my PHP script it doesn't work!! $result = openssl_decrypt("U2FsdGVkX1+dWuBuiitifH4zu1Yv/l7+HcfIqR/wxSc=", 'AES-256-CBC', "MYPASSWORD"); var_dump($result); //output bool(false) I append the following lines to get the error while ($msg = openssl_error_string()) echo $msg . "<br />n"; And it returns: error:0...