Choosing the Hash and cyphering algorithm

Werner Koch wk at gnupg.org
Wed Dec 22 22:52:14 CET 2004


On Wed, 22 Dec 2004 14:34:42 +0100, npellegr  said:

> Almost ... actually I still can't force gpg to use the secret RSA key to
> cypher.

The whole point with public key cryptography is that you use the
*public* for *en*cryption buit the *private* (aka secret) key for
*de*cryption.

> gpg -aer [long_or_short_key_id]! [file] => it uses the public key anyway
> whithout asking for a special subkey. 

I guess you want to force gpg to use one of the subkeys for
encryption:  as stated somewhere in tghe man page, you need to suffic
the keyID with a bang; e.g.:

  gpg -aer 0x12345678! foo.txt

Encrypts to the subkey with thye keyid 0x12345678. Depending on your
shell you might need to escape the bang.  In general using a specific
sub key is not very useful; gpg uses the best fitting subkey
automagically.

  Werner





More information about the Gnupg-users mailing list