Matthew Cross wrote:

> Clarification:  I'm encrypting with the public key portion of a 1024bit key
> pair.
>
> At 04:00 PM 12/10/2002 -0500, you wrote:
> >I'm using a 1024 bit key and I'm getting an assert trying to encrypt a 256
> >byte message

I' m not a specialist but if you try to encrypt a 256 byte message with a 1024
bit key you may have some problems
because the length of the message is 256 * 8 = 2048 bit ( compare to 1024 !)

In my opinion you should :
            1)  instanciate  a symmetric cipher like DES, blowfish ...... etc.
            2) generate a symmetric key (128 bit long ) to initialize the
symmetric cipher
            3) encrypt your message  with the symmetric cipher
            4) wrap the symmetric key  with the public key
            5) send the wrapped key and the encrypted message to the receiver .



Hope  this can help

B DOREL

PS :  this message is only my personal opinion

Reply via email to