RE: RSA_public_encrypt() strange result output... is it a bug !?

2008-12-17 Thread David Schwartz
> Ok. I am a little bit confused. You are telling me that a same > data encrypted > with the same key can generate different results? Yes. This is absolutely essential for any public-key system to be secure. Imagine if someone asks you, "Should we attack at dawn? Send the message securely using m

Re: RSA_public_encrypt() strange result output... is it a bug !?

2008-12-17 Thread BiGNoRm6969
Thank you for all your answers. Very helpful. Norm arne-5 wrote: > > > > On Tue, 16 Dec 2008, BiGNoRm6969 wrote: > >> Ok. I am a little bit confused. You are telling me that a same data >> encrypted >> with the same key can generate different results? How can the decryption >> process can

Re: RSA_public_encrypt() strange result output... is it a bug !?

2008-12-17 Thread Dr. Stephen Henson
On Wed, Dec 17, 2008, Kyle Hamilton wrote: > > Technically, "one input" + cipher("one key") does end up with one > output. However, because the one-to-one correspondence means that if > someone figures out the plaintext for a ciphertext, anytime that > ciphertext comes up they know what the plai

Re: RSA_public_encrypt() strange result output... is it a bug !?

2008-12-17 Thread Kyle Hamilton
The decryption process can succeed because the protocol specifies that the padding can contain randomness, and it knows where the padding starts. Padding is used when the final block is smaller than the block size. Some pad forms append a full block of padding to an otherwise fully-sized block. F

Re: RSA_public_encrypt() strange result output... is it a bug !?

2008-12-17 Thread Arne Ansper
On Tue, 16 Dec 2008, BiGNoRm6969 wrote: Ok. I am a little bit confused. You are telling me that a same data encrypted with the same key can generate different results? How can the decryption process can succeed ?! Maybe it's my cryto knowledge that are limited, but I was sure that one output

Re: RSA_public_encrypt() strange result output... is it a bug !?

2008-12-17 Thread BiGNoRm6969
Ok. I am a little bit confused. You are telling me that a same data encrypted with the same key can generate different results? How can the decryption process can succeed ?! Maybe it's my cryto knowledge that are limited, but I was sure that one output correspond to one input. I run my tests cou

Re: RSA_public_encrypt() strange result output... is it a bug !?

2008-12-16 Thread Dr. Stephen Henson
On Mon, Dec 15, 2008, BiGNoRm6969 wrote: > > Hi, the OpenSSL documentation tells : > > "RSA_public_encrypt() encrypts the flen bytes at from (usually a session > key) using the public key rsa and stores the ciphertext in to. to must point > to RSA_size(rsa) bytes of memory. " > > > I made a t