views:

42

answers:

2

Hello guys and gals! Openssl is a great security library and I use it from time to time. When I generate RSA keys I have RSA object with private and public key data. OK. Fine. I'm happy with that. I can print private key to the printer. And here come's the question.

Is it possible to create a valid RSA object only from the entered private key (RSA->n)? I made key check and it asks for a valid p and q. OK. I entered p and q. But encrypting is not working properly...any ideas?

TIA!

A: 

Did you make sure you entered p and q primes?

Gil
In a new RSA structure I entered d, e,p and q values (other data is empty). RSA_check_key accepts RSA structure. But encryption does not work! Maybe it is bad to work with RSA structure directly, but is there any other way?
The question is it possible from private key (in hex)
"3F710BD31FE80932CE732A181609230C20165D1CDFB3FC4A76B72693F6A56D2A9508BCD16F9DCFE61DA1B4C1F3559F3C19B50E115980C501D8C672B1F4248941" to make a valid private key.
A: 

I worked it out. RSA object must have 5 valid variables: n, p, q, d and e. Thanks!