decrypt with a public key

2011-12-28 Thread Ireneusz Szcześniak
Hi, In public key cryptography, a message encrypted with a private key can be decrypted with a public key, and so I tried: openssl rsautl -encrypt -inkey private-key -in message -out cryptogram openssl rsautl -decrypt -inkey public-key -pubin -in cryptogram The problem is that the second

Re: decrypt with a public key

2011-12-28 Thread Dr. Stephen Henson
On Wed, Dec 28, 2011, Ireneusz Szcze??niak wrote: Hi, In public key cryptography, a message encrypted with a private key can be decrypted with a public key, and so I tried: openssl rsautl -encrypt -inkey private-key -in message -out cryptogram openssl rsautl -decrypt -inkey public-key

Re: decrypt with a public key

2011-12-28 Thread Ireneusz Szcześniak
-decrypt -inkey public-key -pubin -in cryptogram The problem is that the second command gives me: A private key is needed for this operation Why can't one decrypt with a public key? I do realize that I can convince the recipient of the message that the message is indeed mine by signing

Re: decrypt with a public key

2011-12-28 Thread Dr. Stephen Henson
I tried to do this with the openssl command. The public key decrypt and private encrypt operations correspond to the -verify and -sign options to rsautl which is why I suggested them. The default padding is however different in accordance with the PKCS#1 standard. That can be changed

Re: decrypt with a public key

2011-12-28 Thread Kenneth Goldman
Szcześniak irek.szczesn...@gmail.com To: openssl-users@openssl.org, Date: 12/28/2011 01:45 PM Subject: Re: decrypt with a public key Sent by: owner-openssl-us...@openssl.org Thank you, Steve, for your post. Let me explain what I'm trying to do. In the public key cryptography: message

Re: decrypt with a public key

2011-12-28 Thread Ireneusz Szcześniak
On 28.12.2011 19:50, Dr. Stephen Henson wrote: The public key decrypt and private encrypt operations correspond to the -verify and -sign options to rsautl which is why I suggested them. Now I understand. I mistakenly thought that -sign and -verify were used to attach and examine