[EMAIL PROTECTED] - Tue Dec  9 20:56:58 2003]:

> Steve, thanks for you answer.
> Unfortunately, the crippled PKCS#1 key encoding that I produced
> contained
> the primes and CRT components of 1 byte in length  and a value of 0 in
> order to circumvent an error condition in the OpenSSL's key
> conversion/importing routines (the d2i_RSAPrivateKey, I believe).
> Therefore, the imported RSA private key (using the same
> d2i_RSAPrivateKey)
> has non-NULL pointers for the primes and CRT components that point to
> something that is zero (therefore the "divide by zero" error).  I
> don't
> know how to get around the encoding error other than using some data
> for
> the primes and CRT components.

You can't because the structure OpenSSL uses is a PKCS#1 RSAPrivateKey
structure and the CRT components are mandatory. Setting them to zero
means it isn't a valid RSAPrivateKey structure any more.

> My application doesn't have access to the RSA structure (in my case,
> the
> OpenSSL data structures are encapsulated and hidden from applications
> for
> various reasons).  I am not aware of how I can recover the primes used
> to
> generate the private exponent.  Do you know of such a method?
> Thanks.
> 

Yes it is possible to recover one of the primes just given (n, e, d)
after that calculating the remaining CRT components is trivial.

See for example:

http://discuss.microsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind0302c&L=cryptoapi&T=0&F=&S=&P=433

Steve.







______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to