Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Create or open a file that you would like to encrypt.
- ➜ ~ echo "my super secret information" > secret.txt ➜ ~ cat secret.txt my super secret information
- 2. If you havent already create a rsa key pair. If you would like to use existing rsa key pair skip this step and continue to step 3.
- ssh-keygen
- 3. Convert your generated or existing public key to pem format.
- openssl rsa -in ~/.ssh/id_rsa -pubout > ~/id_rsa.pub.pem
- 4. Now you are ready encrypt the file you created earliear.
- cat secret.txt | openssl rsautl -encrypt -pubin -inkey ~/id_rsa.pub.pem > encrypted-secret.txt cat encrypted-secret.txt ????uG?????$?&?????VN?'?(????,þQaE咫:?i??t?(?jr.g?#?ջO???=*?e??<"?y'%
- 5. To decypt the secret
- ➜ ~ cat encrypted-secret.txt | openssl rsautl -decrypt -inkey ~/.ssh/id_rsa my super secret information
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement