We are currently using OpenSSL 1.0.1 to encrypt a token as below:
Encryption:
echo $TOKEN | openssl enc -aes-256-cbc -e -kfile <path of kfile> -md sha256 | base64 -w 0
Decryption:
echo $TOKEN | base64 -w 0 -d | openssl enc -aes-256-cbc -d -kfile <path of kfile> -md sha256
The above commands work fine on a host with OpenSSL version 1.0.1. But we have a requirement where we need to encrypt a token in 1.0.1 and decrypt in version 1.1.1.
I tried the same decryption command (as above), but I get bad decrypt error:
]▒ad decrypt
140437674784640:error:06065064:digital envelope
routines:EVP_DecryptFinal_ex:bad decrypt:crypto/evp/evp_enc.c:643: