openssl and digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../crypto/evp/evp_enc.c:536 error

If You used an old openssl to encrypt a file, e.g. openssl 1.0.x with some command line such as:

$ openssl enc -in <plain input file> -out <crypted output file> -e -des-ede3-cbc

decrypting it using a newer openssl release You will find a similar error:

$ openssl enc -in <plain input file> -out <crypted output file> -d -des-ede3-cbc

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

despite this mismatch error, it’s possible to obtain the original plain file adding the -md md5  option in the decrypt command:

$ openssl enc -in <plain input file>  -md md5   -out <crypted output file> -d -des-ede3-cbc

Leave a Reply