I am using macOS version 10.13.5 and whenever I open a new shell I get this error printed to shell:
bad decrypt
140735978677192:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.50.2/libressl/crypto/evp/evp_enc.c:529:
Openssl version is : LibreSSL 2.2.7
Here is the related command that cause problem :
openssl aes-128-cbc -a -d -salt -in ~/.foo/bar/credentials -k $cred_enc_key
Maybe this code helps : libressl-portable related source code
Also this post on Stackoverflow : two different openssl versions