Re: RSA encryption and decryption question

2005-12-24 Thread Dr. Stephen Henson
On Sat, Dec 24, 2005, Arsen Hayrapetyan wrote: > When I am passing RSA_size(rsa) as the first argument to > RSA_private_decrypt(), I > am receiving the initial message decoded as "Test messageA". I have > allocated the > RSA_size(rsa) bytes for the buffer receiving the decodod text. Does the > dec

Re: RSA encryption and decryption question

2005-12-24 Thread jimmy
Arsen Hayrapetyan wrote: jimmy wrote: 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

Re: RSA encryption and decryption question

2005-12-24 Thread Arsen Hayrapetyan
jimmy wrote: > 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, >> RS

Re: RSA encryption and decryption question

2005-12-24 Thread 劲吕
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 me

Re: RSA encryption and decryption question

2005-12-24 Thread jimmy
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