Hi,

I'm seemingly able to enc and dec from the command line using -aes-128-gcm,
but get a "bad decrypt" error (despite being able to recover the plain
text).

Is getting this error message the expected behavior? The only thing I've
found via google is a couple years old, and not really relevant (
http://openssl.6102.n7.nabble.com/id-aes256-GCM-command-line-encrypt-decrypt-fail-td27187.html)

Here's what I am seeing (Mac 10.8.5):

% openssl version
OpenSSL 1.1.0-dev xx XXX xxxx

% cat msg.txt
secret123

% openssl enc -aes-128-gcm -a -salt -in msg.txt -out msg.enc
enter aes-128-gcm encryption password:
Verifying - enter aes-128-gcm encryption password:

% cat msg.enc
U2FsdGVkX1+JK8h8RmWrOebxynA6uRo=

% openssl enc -aes-128-gcm -a -salt -in msg.enc -d
enter aes-128-gcm decryption password:
secret123
bad decrypt

Same without salt, or without base64 (-a)

Thanks for any explanation of the "bad decrypt" message.

--Jeremy

Reply via email to