On Thu, Dec 08, 2005 at 03:33:40PM -0600, Chevalier, Victor T. wrote:

> I want to create a public key that is the same strength as the private
> key.

Game over, the above demonstrates sufficiently deep confusion about RSA,
that you must not proceed any further until you see why it is absurd.

> I need the public key to match the size constraints, as I am using then
> to encrypt and decrypt and when I try to use the public key the bioerr
> spits out"

RSA Public and private keys are not used to encrypt arbitrary data, there
are many complex traps to avoid because RSA is a commutative group.  You
use RSA private keys to sign carefully constructed message digests that
avoid the various chosen plain-text attacks on RSA. You use RSA public
keys to encrypt randomly generated session keys that in turn encrypt
the message contents. All this specificed in carefully designed PKCS#N
standards that describe correct standard use-cases of RSA cryptography.

> When I run my code using openssl I am trying to decrypt using my public
> key,
> I get:
> 
> 3500:error:0406506C:rsa routines:RSA_EAY_PRIVATE_DECRYPT:data greater
> than modlen:rsa_eay.c:308
> 
> I want to decrypt with the public key.
> 

The public key is not suitable for decryption, it is only suitable for
signature verification. Decryption is only possible with the private
key and only if chosen-plaintext/chose-ciphertext attacks are carefully
avoided.

-- 
        Viktor.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to