1

So I encrypt a file using symmetric AES encryption with gnupg 2.2.9:

gpg -a --symmetric myfile # This produces myfile.asc as its output

I am prompted for a password and enter it. The -a option produces an ASCII armored file - a file that contains only printable characters instead of a binary encrypted file. This type of file can be easily emailed as text and placed in the body of an email, rather than as an attachment.

Now to decrypt it, I use:

gpg --decrypt myfile.asc # This should decrypt myfile.asc to STDOUT after asking
                         # me for the password used during encryption

gpg tells me (via output to STDERR) that the file was encrypted with AES and was encrypted with 1 passphrase. OK, that makes sense.

However, gpg then proceeds to just decrypt the file to STDOUT without ever prompting me for a password, as if it was not password protected during encryption or not encrypted at all.

Why is this?

3
  • Please include an example payload (e.g: the contents of myfile.asc)
    – Attie
    Commented Aug 5, 2018 at 21:24
  • Note: I don't see this behaviour...
    – Attie
    Commented Aug 5, 2018 at 21:25
  • Try to logout then re-login and try to decrypt again.
    – Alex
    Commented Aug 6, 2018 at 2:29

1 Answer 1

1

One answer is provided here: GnuPG decryption not asking for passphrase.

However, the following will work as well:

gnupg --pinentry-mode loopback --decrypt ...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .