Every gnupg encrypted file contains an embedded "original" file name.
GnuPG by default does not use this embedded filename. Other tools do. To prevent
security issues with such tools, the embedding of file names should be off by
default. Currently, embedding of filenames cannot be turned off (at least I
think so, based on the contents of the manpage).
Embedding filenames leads to security issues, as documented in the manpage of
GnuPG, option "--use-embedded-filename", or
http://www.cs.ru.nl/E.Verheul/papers/Govcert/Pretty%21Good%22Piggybagging%20v1.0.pdf
. As a workaround, I currently use --set-filename "" in my gnupg.conf.
And here is my story with embedded filenames:
I orginally sent a encrypted mail (using Thunderbird and Enigmail). THis mail
had an attachment, and when asked how to wrap it I selected "PGP/MIME", to save
the recepient the hazzle of decrypting and reattaching the attachment in case he
needs to forward it..
I got a reply that there was no attachment in my mail. So, the recepient
probably has a mailer that cannot do PGP/MIME. So I opened the original message
and clicked "Edit as new", then "Send", and selected "inline PGP" as format. I
got a repsonse claiming that something was wrong with the attachment, "please
find it attached for analysis". So I tried to decrypt it and got:
$ gpg --decrypt nsmail-1.asc
gpg: no valid OpenPGP data found.
gpg: decrypt_message failed: eof
Then I used my favorite editor to open nsmail-1.asc and found that it was the
plaintext version of the attachment.
What happened? I re-wrapped the mail form PGP/MIME to inline PGP. In this
process, the attachement name remained the same (e.g. "secret_document.txt"),
but the attachment was temporarily stored in the file system using the temporary
name "nsmail-1.asc". GnuPG embedded this temporary name within the ciphertext of
the attachment. Then, the MIME wrapping of the attachment contains the original
file name twice (once as "name" and once as "filename"). Recepients buggy tool
seems to use the embedded file name as final file name, while it probably should
use the MIME encoded name of the attachment.