Hi *,
My name is Malik and I just started using the Nettle.
I am looking for APIs for RSA crypto operations.
From rsa.h header file, I can make out that Nettle supports,
- RSA crypto APIs only for PKCS#1 v1.5 padding mechanisms and - CRT format for RSA private key
My questions, - Does nettle not support PKCS#1 v2.1 padding mechanisms e.g. RSASSA-PSS? - Does nettle not support exponent format for private key?. Meaning private key is made up of modulus and private exponent. - Is there an API for raw RSA crypto operation? Raw meaning, API must not do any encoding with input data but just has to sign/encrypt it.
Can someone please clarify my questions? Thanks very much indeed in advance for the clarifications.
Regards, Malik
Mallikarjun Bailamanavar mallugb@gmail.com writes:
- Does nettle not support PKCS#1 v2.1 padding mechanisms e.g.
RSASSA-PSS?
It doesn't.
- Does nettle not support exponent format for private key?. Meaning private
key is made up of modulus and private exponent.
No, it uses CRT optimization and the auxillary data needed for that, including the two secret factors. If you have only n and d, it's possible to recover the factorization (you need also the public exponent e). One could add functions for using only d to nettle, but so far that hasn't seemed to be an important feature.
- Is there an API for raw RSA crypto operation? Raw meaning, API must not
do any encoding with input data but just has to sign/encrypt it.
See rsa_compute_root. Or if you don't want to use CRT, just use GMP's mpz_powm or mpz_powm_sec.
Regards, /Niels
nettle-bugs@lists.lysator.liu.se