Error encrypting string data

Werner Koch
Mon, 21 Jul 2003 13:03:20 +0200

On Mon, 21 Jul 2003 11:34:31 +0200, Ralf Schneider said:

> Ok, but gcry_mpi_print takes a parameter of type gcry_mpi_t and the key is of 
> type gcry_ac_key_t. I tried to simply convert the key to gcry_mpi_t but this 
> results in a segementation fault :-( So, how can I convert a gcry_ac_key to a 
The AC interface is pretty new;  Moritz can give you some hints.

> I have a german edition of Bruce Schneier's "Applied Cryptographie" which is a 
> little bit easier to understand for me :-) I read the chapter about public 
> key algorithms and the problem of a small encryption exponent.

AC has a couple of errors and is not sufficient to implement crypto.
HAC is the definitely better.  I have not yet looked at
Schneier/Ferguson's "Practical Cryptography" but it aims to be an easy
to understand HOWTO implement crypto protocols.  It is probably worth
a read.

> But how can this padding be done? By appending a fix number of random bytes 
> (for example always 20 bytes) to the plain text that can be easily removed 
> when decryting the cipher text?

See PKCS#1

Werner Koch                                      <>
The GnuPG Experts                      
Free Software Foundation Europe