Created
March 16, 2020 07:48
-
-
Save rdkls/e74ada39a2f90357b72ccc51a0d8856b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl genrsa -out key.pem | |
openssl rsa -in key.pem -pubout -out key.pub | |
Now you'll have pub + private keys | |
You can send the pub key to supplying user, who can then encrypt with it, and you can decrypt | |
To encrypt: | |
echo "xxxxxxxx" | openssl rsautl -encrypt -inkey ./key.pub -pubin | base64 | |
To decrypt: | |
echo "my_b64_string==" | base64 -d | openssl rsautl -decrypt -inkey key.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment