Choosing the Hash and cyphering algorithm

npellegr at npellegr at
Thu Dec 23 09:46:52 CET 2004

 Well about he whole point and especially RSA I should be able to cypher with my
private key since the exponents are inverses :

q = e^-1 mod (p-1)(q-1)  with q the private exponent and e the public one.

Actually when you sign something it's 
c = RSA(priv,H(m))  with H the Hash function.

So I know it's possible. I only want to "c = m^q mod n"

Nicolas Pellegrin

Selon Werner Koch <wk at>:

> 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