Thanks for the quick response Jeffrey.

Actually, what I wanted to experiment here is to have the private exponent 
fix, choose a prime for public exponent, either 3,17 or 65537. Then have a 
random modulus to compute Initialize() and have private key value. I am 
trying not to use the random generated to create a private key.

I tried this one but it throws an error "InvertibleRSAFunction: input is 
not a valid RSA private key". 
I am looking for ways to have a valid modulus value for the generation of 
private key since I want private exponent and public exponent to be fix.
Any advice you can give me if this is possible?

Again, thank you very much.

Regards,
Starsky


On Wednesday, September 2, 2020 at 4:22:05 AM UTC+8 Jeffrey Walton wrote:

> On Tuesday, September 1, 2020 at 10:30:23 AM UTC-4 star...@codev.com 
> wrote:
>
>> Good day to everyone,
>> I just would like to ask something with regards to RSA Key generation.
>> I know everyone knows that we can initialize or create a private key 
>> using pre-generated modulus, public exponent and private exponent. 
>> Is there a way that we can recompute the private key or the modulus given 
>> only the private exponent and the public exponent or, private exponent and 
>> the modulus?
>>
>
> The RSA private key is either {n,e,d} (short form) or 
> {n,e,d,p,q,dp-1,invq} (long form). If you have the short form you can 
> recalculate the long form parameters using the Chinese Remainder Theorem 
> (CRT).
>
> The Crypto++ code to calculate the long form parameters given short form 
> is at https://github.com/weidai11/cryptopp/blob/master/rsa.cpp. Checkout 
> the function InvertibleRSAFunction::Initialize().
>
> You may be able to recover a private key given {n,d}. That's because you 
> can sometimes guess the public exponent -- it is usually 3, 17 or 65537.
>
> There's no requirement e has to be 3, 17 or 65537. I think the only 
> requirement is e and Phi(n) must be co-prime, where Phi is Euler's 
> Phi-function. Phi(n) = (p-1)(q-1). So you can select a random e, coprime to 
> Phi(n), with a low hamming weight, and RSA will work just fine.
>
> You will probably have trouble recovering a private key given {e,d}. You 
> have to guess the modulus.
>
> Jeff
>
>

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/6a353c89-9ae7-4aa3-a781-3f06d64ddb74n%40googlegroups.com.

Reply via email to