The gcry_sexp_sprint function in libgcrypt doesn't work as expected when the
specified format is GCRYSEXP_FMT_BASE64. I ran into this issue using the fink-
installed version of libgcrypt-1.4.4 on Mac OS X 10.6.5, but I also looked at
the code for libgcrypt-1.4.6 and it seems like it was just never implemented.
The sexp_sscan function also doesn't accept base64-encoded input, looks like
that was also never implemented.
I've attached a test case that demonstrates the problem; the output should be
base64-encoded but instead binary is dumped. I was able to compile on my
machine using "gcc -arch i386 -I/sw/include -L/sw/lib -lgcrypt test.c";
presumably you can get it to compile in your environment without much trouble.