how to use libgcrypt library
Neil Spring
nspring@cs.washington.edu
Thu, 24 Jul 2003 21:58:30 -0700
--Apple-Mail-2--802453696
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; delsp=yes; charset=US-ASCII; format=flowed
Zen,
I don't know what operating system you're using. And I don't know how
to solve your linking problem; perhaps it is solved by running "ldd
./sig_neil" and if it doesn't find libgcrypt, setting the
LD_LIBRARY_PATH environment variable to /usr/local/bin.
And what you copy in your message is the expected output of the dinky
test program -- the s-expression that includes the signature dumped to
the screen. It is not useful output, just enough to demonstrate that a
signature was constructed. You'll have to figure out how to use that
value, presumably using the gcry_mpi_* functions to extract it in a
convenient form, in whatever data you sign. Using the gcry_sexp_dump()
function to print all of them out helps to understand how data flows
through the program.
If you are a beginner with encryption, a few posts ago mentioned the
handbook of applied cryptography at (
http://www.cacr.math.uwaterloo.ca/hac/ ). Of course, gcrypt still lets
novices (including me) write insecure systems, so knowing what you're
doing and why is important.
good luck,
-neil
On Thursday, Jul 24, 2003, at 21:04 US/Pacific, Zen wrote:
> Neil,
> Thanks for your help again. Your programe is very useful, and it can
> work well.
>
> I have a question when i want to use it out of libgcrypte library. I
> named it sig_neil.c temporarily. It can be compiled, my compile
> command : 'gcc sig_neil.c -g -O2 -Wall -o sig_neil -L/usr/local/lib
> -lgcrypt -lnsl ', but its runing message: 'error while loading shared
> libraries: libgcrypt.so.1: cannot open shared object file: No such
> file or directory.'
>
> In /usr/local/lib and ./ directory, there has libgcrypt.so.1 file
> ,which is a link file.
>
> Whether my compile command is incorrect? What it should be?
>
> By the way,in the inner of libgcrypte library, i modified original
> Makefile, then 'make',
> run './sig_neil',its runing result is correct, but its output has:
>
> not enough random bytes available (need 268 bytes)
> please do some other work to give the OS a chance to collect more
> entropy
> [open]
> [data="sig-val"]
> [open]
> [data="rsa"]
> [open]
> [data="s"]
>
> [data="\x12\xbf\x04\xe85\x8d\x8a0u|\xf1\xa3I=H\x95hS\x9bR\xd8\xd3r\x9a\
> x1e=\xa1%\xa7\xe1\xb4L"]
> [close]
> [close]
> [close]
>
> What's it mean? Can i look it over?
>
> I am a beginner in the filed of encrpytion techniques, so i am very
> sorry for my questions may be very childish. I wish they will not
> waste your too much time.
>
> Thanks for your help.
>
> Best regards,
> Zen.
>
>
>
>
--Apple-Mail-2--802453696
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-disposition: inline
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)
iD8DBQE/ILkFtvhXVvuQ3oQRAnPdAKCDrbs4S+Ta91lq6sbAFROrevtHiACfYCeU
shNxDkLGlQxKt5WMf+/3eCU=
=NTmU
-----END PGP SIGNATURE-----
--Apple-Mail-2--802453696--