Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenSSL -aes-256-cbc decryption behavior changed between 1.0.2o and 1.1.0g

Tags:

openssl

This works with OpenSSL 1.0.2o:

$ echo s+pQpLgAQKY6z9fNtBz63A== | openssl enc -a -d -aes-256-cbc -k a -nosalt
foobar

The same command doesn't work with OpenSSL 1.1.0g:

bad decrypt
140479496508672:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../crypto/evp/evp_enc.c:536:

Is there a command-line which works with both versions? If not, is there a command-line flag which I can add for OpenSSL 1.1.0g to make it work?

like image 438
pts Avatar asked Apr 25 '18 18:04

pts


1 Answers

Adding -md md5 to the command makes it work in both versions (1.0.2o and 1.1.0g).

like image 92
pts Avatar answered Sep 30 '22 11:09

pts