Why am I getting unreadable output when decrypting using GnuPG?

1

I'm trying to get back my files that I previously encrypted in another Linux machine using GnuPG. The process which I learned seems to be very straight forwards but I'm having this error on decrypt:

How I encrypted:

gpg -c file.tar.gz

Then it prompted for me to type a password to be the key, I typed it and noted it so I don't forget

How I'm trying to decrypt:

gpg -d file.tar.gz.gpg

It then prompt me the key, I type it, and then it prints a lot of random characters and gives an error trying to execute 2c1;1; as a command in the terminal as in the following print:

Example in screenshot

I'm using GnuPG version 2.1.15, with libgcrypt 1.7.3 to decrypt. I think it was the same version when I encrypted it. So, the question is, how can I proceed to solve my problem to decrypt the data?

Fabiotk

Posted 2016-10-08T14:57:36.893

Reputation: 129

Answers

1

gpg -c decrypts to STDOUT if no other option is set. What you see is the content of file.tar.gz. To verify, have a look at what

gpg -d file.tar.gz | file -

is printing (it should be indicating something like "gzip compressed data").

Use one of the following options to store the output into a file (so either use GnuPG's --output flag to define an output file, or simply redirect gpg's STDOUT to a file):

gpg -o file.tar.gz -d file.tar.gz.gpg
gpg -d file.tar.gz.gpg > file.tar.gz

Jens Erat

Posted 2016-10-08T14:57:36.893

Reputation: 14 141