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 -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 the message.
> 
> 

Try the -sign and -verify options instead.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to