I'm having some weird behaviour with the openssl_decrypt
method in PHP. It's failing, giving me an error: Unknown cipher algorithm
, but only sometimes (about 6:10 times) i.e. If I run the command enough times, it will eventually work... My code is:
$result = openssl_decrypt(base64_decode($hash), 'AES-128-CBC', $timestamp);
running openssl list-cipher-commands
lists AES-128-CBC as one of the available cipher methods. The specs don't really list anything on the subject - only specifying that unknown cipher algorithm
is a possible exception from running the command.
edit:
Using the command line: i.e. running echo "soemthing" | openssl enc -aes-128-cbc
on a random machine and then decrypting on the machine that fails with the above echo "..." | openssl enc -aes-128-cbc -d
works consistently.