Machine A has OpenSSL 1.0.2k and I encrypt a dummy file like this:
openssl enc -aes-256-cbc -salt -in plain.txt -e -pass pass:abcd1234 -out cipher.enc
Machine B has LibreSSL 3.3.3 and when I decrypt the file from machine A like this:
openssl enc -aes-256-cbc -in cipher.enc -d -pass pass:abcd1234 -out plain.txt
It fails to decrypt, giving this error:
bad decrypt
4444794304:error:06FFF064:digital envelope routines:CRYPTO_internal:bad decrypt:evp/evp_enc.c:549:
Note that if I try to decrypt it using the same command line on machine A, it works fine.
I don't know how outdated OpenSSL 1.0.2k is but unfortunately I have no control over upgrading it (it's a remote 3rd party server).
Is there an incompatibility between OpenSSL and LibreSSL when using AES encryption?