John wants to send 1.txt
to Paul.
He encrypts it. Now the file is named myFile.pgp
, and he sends it to Paul.
Paul gets the file.
How (if possible) can Paul know what the original file name (1.txt
) was? Is there a parameter (--xxx
) to see the filename ?
I'm using GNU PGP (GnuPG) in console mode.
Best Answer
With GnuPG, the original filename can be seen in
gpg --list-packets
.(Note: The entire literal data packet, including the filename, is encrypted. If you don't have the private key, you cannot see the name either.)
Alternatively, you can use
--decrypt
along with with--verbose
(or-v -d
for short):(In Linux, use
> /dev/null
instead.)If you want to decrypt and save the entire file, use the
--use-embedded-filename
option:(Note: You should not use
-d
or--decrypt
with this option, since it never uses the embedded filename. Instead, use the "default" action.)Do not forget that not all files have names. In Linux,
gpg
is often used to encrypt another program's output directly, without saving it in a file. It would then show up as:When encrypting (or just storing), the embedded filename can be changed with
--set-filename
.