Title: RE: Question on RSA public decryption
Well, I guess you did it the correct way. But ok, let's give an example.
 
unsigned char n[] = "\xa5\x62\xb9\xc2";
unsigned char e[] = "\x01\x00\x01";
RSA* rsa = RSA_new();
rsa->n = BN_bin2bn(n, sizeof(n)-1, NULL);
rsa->e = BN_bin2bn(e, sizeof(e)-1, NULL);
 
HTH
Alex
-----Original Message-----
From: Carl Wanting [mailto:[EMAIL PROTECTED]]
Sent: 10 July 2001 10:02
To: '[EMAIL PROTECTED]'
Subject: RE: Question on RSA public decryption

I am using 0.9.6a.  Can you perhaps tell me how to set up the public key using an existing public exponent and modulus?
 
thanks,
carl
-----Original Message-----
From: Alexander op de Weegh [mailto:[EMAIL PROTECTED]]
Sent: 10 July 2001 11:01
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Question on RSA public decryption

What version of the library are you using? And have you tried it on another machine?

I am working on Windows 95 with VC++ 6.0 and use library 0.9.5a. No problems appear. Although I must admit that I have never called RSA_check_key(), but RSA_public_decrypt works fine.

Alex

> -----Original Message-----
> From: Carl Wanting [mailto:[EMAIL PROTECTED]]
> Sent: 10 July 2001 09:51
> To: '[EMAIL PROTECTED]'
> Subject: Question on RSA public decryption
>
>
> Hi all,
> I am trying to use the RSA_public_decrypt function but I need
> to set up the
> public key "manually"  I have the public exponent and modulus
> in the form of
> an array of unsigned char and have converted these to BIGNUM
> format using
> BN_bin2bn.  However, this is where I have started hitting problems.  I
> thought that merely assigning them to the RSA structures n
> and e fields work
> but that just did not cut it. 
> When I called RSA_check_key I receive an access violation in
> libeay32 (at
> address cx0000005) and any attempts to actually call
> RSA_public_decrypt
> return -1.  calling ERR_get_error after this produces an AV
> in on of the NT
> dlls (NTDLL I think).  I am using Win2K pro and am working in VC++ 6
> Can anybody please help me- this is driving me insane
>
> many thanks in advance,
> Carl
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
>

Reply via email to