Function RSA_private_encrypt does not work with RSA_NO_PADDING option

2010-07-19 Thread anhpham
help me :- -- View this message in context: http://old.nabble.com/Function-RSA_private_encrypt-does-not-work-with-RSA_NO_PADDING-option-tp29202949p29202949.html Sent from the OpenSSL - User mailing list archive at Nabble.com

RSA_private_encrypt does not work with RSA_NO_PADDING option

2010-07-19 Thread anhpham
this message in context: http://old.nabble.com/RSA_private_encrypt-does-not-work-with-RSA_NO_PADDING-option-tp29204310p29204310.html Sent from the OpenSSL - User mailing list archive at Nabble.com. __ OpenSSL Project

Re: RSA_private_encrypt does not work with RSA_NO_PADDING option

2010-07-19 Thread Dr. Stephen Henson
On Mon, Jul 19, 2010, anhpham wrote: Hi all :x I encountered an error when using function RSA_private_encrypt with RSA_NO_PADDING option. I had an unsigned char array a with length = 20, RSA* r, unsigned char* sig = (unsigned char*) malloc(RSA_size(r)) and then I invoked function int i =

Re: RSA_private_encrypt does not work with RSA_NO_PADDING option

2010-07-19 Thread Mounir IDRASSI
Hi, When calling RSA_private_encrypt with RSA_NO_PADDING, the input must have the same size as the RSA key modulus. In your case, you are supplying 20 bytes whereas it certainly needs more (for example, for a 1024 bit key, input must be 128 bytes long). So, you have to add some sort of

Re: RSA_private_encrypt does not work with RSA_NO_PADDING option

2010-07-19 Thread van anh pham
I see the point. Thanks alot On Tue, Jul 20, 2010 at 12:47 AM, Mounir IDRASSI mounir.idra...@idrix.netwrote: Hi, When calling RSA_private_encrypt with RSA_NO_PADDING, the input must have the same size as the RSA key modulus. In your case, you are supplying 20 bytes whereas it certainly