getting an encrypted file to show what public key was used

Steven Lefevre lefevre.10 at
Tue May 29 15:45:48 CEST 2012

I am using gnupg via PHP's wrapper for it. I am sending an ecrypted
files to remote hosts, using two different keys for the respective
hosts. One host can decrypt the file properly, but the other host

I am trying to troubleshoot this bug. Of course, I do not have the
private keys from the remote hosts, so I cannot troubleshoot the
complete circuit on my own.

The host that cannot decrypt their file has the decruption running in
some kind of Windows batch file. The error message they get seems to
indicate the name of the public key that was used to encrypt the file.
I am trying to figure out of the name of the public key is actually
encoded into the gpg file. This is their error message:

Beginning GPG Decryption
Using current version of GNUPG
gpg: encrypted with 2048-bit ELG-E key, ID F1940956, created 2002-04-25
      "Different Public Key <another_key at>"
gpg: decryption failed: secret key not available

However, when I try to decrypt the file I'm sending them, without the
key, I get simply

$> gpg --decrypt sensitive_file.gpg
gpg: encrypted with ELG-E key, ID F1940956
gpg: decryption failed: secret key not available

I want gpg to report the email address of the key used to encrypt the
file, like in the error message I'm getting from the remote host. I
want to see "Different Public Key <another_key at>",
like in their error message. But my gpg doesn't report that.

Is the name of the public key really encoded into the encrypted file?
Or is something else mixed up on the remote host (for instance, them
having the other hosts' private key)?

How can I see the name of the public key that encrypted the file? Am I
missing a switch?

More information about the Gnupg-users mailing list