Decryption problem - Large .png file

Peter Lebbing peter at
Sun Feb 16 13:02:12 CET 2014

On 16/02/14 12:05, Charly Avital wrote:
> The output was gibberish, with bell sounds now and then.

Sounds like the .png file is output to to your terminal instead of a file. This
is the default for the -d option. The -a option is used for specifying armoured
output; it is not used for decryption, AFAIK.

The default action for gpg when given an encrypted file is to decrypt it and
write the result to a file (as opposed to the terminal like with the -d option).
But it constructs the filename for the decrypted file from the filename of the
encrypted file, and the filename you've given is a bit odd. Normally,
something.png.asc would lead to a filename something.png. But with the added
.txt as a third extension, it seems gpg recognises that this is a strange
situation and prompts you what to do. It suggests using the filename of the file
that was encrypted, which is stored inside the encrypted file but not normally
used because it can lead to nasty surprises (you decrypt a file named
harmless.csv.asc and it creates a file named evil.exe). Supposing the original
filename was simply serial.png and the encrypted file is, as you say,
serial.png.asc.txt, this is what it looks like here:

$ gpg serial.png.asc.txt
gpg: encrypted with 2048-bit RSA key, ID 73A33BEE, created 2009-11-12
      "Peter Lebbing <peter at>"
gpg: serial.png.asc.txt: unknown suffix
Enter new filename [serial.png]:

I simply pressed Enter on the "Enter new filename" prompt because I thought the
suggested filename was okay, and I now have a decrypted file serial.png next to
the encrypted one.

If you want to avoid the prompt, you can do either

$ gpg -o serial.png serial.png.asc.txt


$ gpg -o serial.png -d serial.png.asc.txt

This is because the default action for an encrypted file is to decrypt it, so
you don't need to explicitly specify -d.

Or you could use a GUI, but since the filename ends in .txt, it might be that
the fact that it is an OpenPGP file is not recognised (by your file manager, for
instance). You could drop the .txt and simply name the file serial.png.asc as usual.



I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <>

More information about the Gnupg-users mailing list