[Help-gnutls] Re: Signature Verify functions

Simon Josefsson simon at josefsson.org
Wed Apr 2 12:01:24 CEST 2008


Juan Pablo Ugarte <juanpablougarte at gmail.com> writes:

> Hello guys.
>
> I need a function to verify a little text using a public key.
>
> Its for a GPL project, i only need to verify some text and I can not add
> gnutls as a dependancy because its just for an easter egg :)
>
> hehe, anyways i just want to implement something like this...
>
> int
> verify_sign (pubkey, text, sign);
>
> Can anyone give me some pointers on wich files/functions should i "look"
> to implement such function?

Assuming you don't want the overheads of X.509 or OpenPGP, you should
look into libgcrypt which is the low-level crypto library.  It supports
signing and verification of RSA signatures.  If you have a bignum math
library available, writing a simple (and insecure) RSA verifier
shouldn't be that tricky.  It may be easier than trying to understand
the libgcrypt code and extract the necessary functions (which will
include the MPI code which is messy).

Of course, don't expect it to be secure (that's why we have the X.509
and OpenPGP umbrellas) but for an easter egg I guess that isn't a
priority.

/Simon





More information about the Gnutls-help mailing list