help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Raw RSA encryption


From: Nikos Mavrogiannopoulos
Subject: Re: Raw RSA encryption
Date: Sat, 24 Jul 2010 11:05:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100528 Thunderbird/3.0.5

On 07/24/2010 03:07 AM, Mads Kiilerich wrote:
>  Hi
> 
> The new gnutls/crypto.h exposes fine functionality for using
> stream/block ciphers and hash algorithms directly.
> But I also need raw RSA encryption and can't figure out how to do it -
> or if it is possible. I just need the basic modulo-exponentiation, for
> example with values from gnutls_x509_crt_get_pk_rsa_raw.

I question might be, why you want to do that? GnuTLS tries to hide that
by providing high level functions to manage certificates and keys.

> It seems like it is possible to register such a function with
> gnutls_crypto_pk_register2, but there is no way to retrieve the internal
> implementation? Or is it OK to use _gnutls_pk_ops.encrypt?

There is no exported API for that. It is probably possible to do it, but
it is not trivial, and would require a big deal of new API functions and
datatypes to maintain.

> Or should I access gcrypt directly, possibly by duplicating the content
> of _wrap_gcry_pk_encrypt?
> (In either case it seems like I need to figure out how the simple
> bigendian format of gnutls_datum_t from gnutls_x509_crt_get_pk_rsa_raw
> relates to bigint_t?)

The gnutls_datum_t contains the big integer in an unsigned format that
is importable by almost all crypto libraries (and thus libgcrypt). The
bigint_t is the gnutls crypto library's internal representation of that.

regards,
Nikos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]