I am using the Linux command line, I have created a Private Key using the following command:
openssl genrsa -des3 -out private.pem 2048
I have extracted the public key from the private key like so:
openssl rsa -in private.pem -out public.pem -outform PEM -pubout
I want to use the public key to encrypt a string of text, lets say "foo bar", and then decrypt this string again.
How do I go about this?
Thanks
I think you want
openssl rsautl -encrypt -inkey public.pem -pubin -in unencrypted_file.txt -out encrypted_file.ssl
See more at devco.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With