How to encrypt and decrypt secret data May 12, 2011 at 9:56 pm

Create a secret file. In example secret.txt. Put your secret content in to it.

Now you must encrypt it with your public key.


openssl rsautl -encrypt -inkey public.pem -pubin -in secret.txt -out secret.ssl

If you want to read your secrets, you need to open secret.ssl file with your private key.


openssl rsautl -decrypt -inkey private.pem -in secret.ssl -out secret.txt

Share your private key. If somebody wants to send you some secret content he or she can encrypt data with your public key and only you can open it.

Leave a Reply

You must be logged in to post a comment.