Decrypting file encrypted for multiple recipients using a given ID?

Peter Pentchev roam at
Mon Jul 12 09:58:39 CEST 2010

On Mon, Jul 12, 2010 at 08:30:25AM +0200, Remco Rijnders wrote:
> Hash: SHA1
> Dear all,
> I have a file encrypted to two different User ID's, both for which I
> have the public keys as well as the secret key. When I try to decrypt
> the file, it always prompts me for the passphrase of user A, while I'd
> like to decrypt it using the passphraseless key of user B.
> I've tried various combinations of -u with and without exclamation mark,
> but without success. How can I specify that the key of user B should be
> used?

A possible workaround would be to create a separate secret keyring that
only contains user B's secret key.  I agree, it's not perfect, and it would
entail explicitly specifying "--no-default-keyring --secret-keyring ..."
and maybe also "--keyring ...".

Alternatively, you could create a different ~/.gnupg/ directory and
symlink all files *but* the secret keyring to your "real" ~/.gnupg/, then
create a minimalistic secret keyring there containing only user B's key.
This would mean setting GNUPG_HOME each time you want to use this keyring,
so it's still not perfect.

It's quite possible that there are simpler ways, I just can't think of them
right now :)


Peter Pentchev	roam at    roam at    roam at
PGP key:
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Do you think anybody has ever had *precisely this thought* before?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: </pipermail/attachments/20100712/d386d2d5/attachment.pgp>

More information about the Gnupg-users mailing list