Error encrypting string data

Werner Koch
Mon, 21 Jul 2003 10:04:18 +0200

On Sat, 19 Jul 2003 10:37:51 +0200, Ralf Schneider said:

> thank you very much for your code snippet. After a small correction 
> (gcry_mpi_scan expects a pointer to size_t instead of a size_t value) it 
> worked fine.


> So, the problem is: How can I convert the key of type gcry_ac_key_t to a 
> representation that I can encode to a base64 string (for example a byte 
> array)?

Look for gcry_mpi_print or gcry_mpi_aprint.  Use GCRY_FMT_PGP if you
want a 2 bytes header with the number of bits following or
GCRY_FMT_SSH with a 4 byte header with the number of bytes follwoing
or simply GCRY_FMT_STD with no header.  There is also GCRY_FMT_HEX
which prints each byte as 2 hex digits.

> What is the HAC? Where can I find it?

Handbook of Applied Cryptography.  Since some time entirely available



Werner Koch                                      <>
The GnuPG Experts                      
Free Software Foundation Europe