The length of ciphertext is not longer than the public key's length.
If your public key is 1024bit, the length of ciphertext is 128 bytes.

2005/12/24, jimmy <[EMAIL PROTECTED]>:
> Arsen Hayrapetyan wrote:
> > Hello,
> >
> > I have the following question:
> >
> > unsigned char *plaintext = "Test message";
> > unsigned char * ciphertext=NULL;
> > RSA *rsa =...;  /*here I have an RSA key */
> >
> > RSA_public_encrypt(strlen(plaintext), plaintext, ciphertext, rsa,
> > RSA_PKCS1_OAEP_PADDIN*G* );
> >
> > What will be the length of ciphertext?
> >
>
> Same size as ur key (i.e., size in bytes)
>
> > When I use
> > RSA_private_decrypt (flen, ...) to decrypt the message just encrypted,
> > what should I pass to fuction as the first argument? (I read a mail
>
> i think it is length of ur cipher text, so u know how long it is :)
>
> > thread with a similar problem with enc/dec, and there was suggested to avoid
> > determination of ciphertext using 'strlen', because it may be not
> > null-terminated).
> >
> > Thanks in advance.
> > Arsen.
> >
>
> -jb
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           [EMAIL PROTECTED]
>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to