Is it possible to force decryption with the wrong key type

Michel Messerschmidt lists at michel-messerschmidt.de
Fri Jun 5 14:41:48 CEST 2009


On Fri, Jun 05, 2009 at 08:41:59AM +0200, Werner Koch wrote:
> > Is there any chance to force decryption of the files? 
> > My secret keys are located on a OpenPGP smartcard.
> 
>   @item --try-all-secrets
>   Don't look at the key ID as stored in the message but try all secret
>   keys in turn to find the right decryption key. This option forces the
>   behaviour as used by anonymous recipients (created by using
>   @option{--throw-keyids}) and might come handy in case where an encrypted
>   message contains a bogus key ID.

Thanks for the answer, but no success with this either:
$ gpg2 -vv --try-all-secrets file1.pgp 
:pubkey enc packet: version 3, algo 1, keyid xxxxxxxxxxxxxxxx
	data: [2048 bits]
gpg: public key is xxxxxxxx
gpg: anonymous recipient; trying secret key 96C5988D ...
gpg: anonymous recipient; trying secret key xxxxxxxx ...
gpg: anonymous recipient; trying secret key xxxxxxxx ...
[...]
:pubkey enc packet: version 3, algo 1, keyid FD377E2D96C5988D
	data: [1024 bits]
gpg: public key is 96C5988D
gpg: anonymous recipient; trying secret key 96C5988D ...
gpg: anonymous recipient; trying secret key xxxxxxxx ...
gpg: anonymous recipient; trying secret key xxxxxxxx ...
[...]
:encrypted data packet:
	length: unknown
gpg: encrypted with 1024-bit RSA key, ID 96C5988D, created 2006-12-03
      "Michel Messerschmidt <mail at michel-messerschmidt.de>"
gpg: encrypted with RSA key, ID xxxxxxxx
gpg: decryption failed: No secret key


I don't think gpg has problem identifying and finding the secret key, 
but it refuses to decrypt a message with a key that had no encryption 
capability set during key creation.

I'm looking for a way to change or override the key type (Sign / 
Encrypt / Certify / Authenticate).
And what might happen if I try to delete or disable my encryption 
subkey ? Will the primary key be used for de-/encryption?


Michel



More information about the Gnupg-users mailing list