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_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 :) > 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 decoding function return STRING (null-terminated)?
Arsen. >> 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] > -- PGP Key: ID 0xBBE3DFD8 (expires: 2006-08-03) Fingerprint: 1C3B 2C01 40DF ED87 23B1 BF6F 95C4 2E77 BBE3 DFD8
smime.p7s
Description: S/MIME Cryptographic Signature