Decrypting file encrypted for multiple recipients using a given ID?

David Shaw dshaw at jabberwocky.com
Mon Jul 12 17:37:58 CEST 2010


On Jul 12, 2010, at 2:30 AM, Remco Rijnders wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> 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?

There isn't a direct way to do this.  GnuPG tries to decrypt the various encrypted session keys in order, so you'll get prompted for them in order.

If you want to always have B before A, try switching the "-r" arguments when you encrypt.  That will switch the order of the encrypted session keys.

David




More information about the Gnupg-users mailing list