-
-
Save smashwilson/7828031 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
key=$1 | |
infile=$2 | |
outfile=$3 | |
openssl rsautl -decrypt -inkey $key -in $infile -out $outfile |
This file contains 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
#!/usr/bin/env bash | |
user=$1 | |
infile=$2 | |
outfile=$2.enc | |
wget github.com/$user.keys -O id_rsa.pub | |
# Encrypt | |
# Need a pem file | |
ssh-keygen -f id_rsa.pub -e -m PKCS8 > id_rsa.pem.pub # make a pem file | |
openssl rsautl -encrypt -pubin -inkey id_rsa.pem.pub -ssl -in $infile -out $outfile | |
## Decrypt | |
### openssl rsautl -decrypt -inkey ~/.ssh/id_rsa -in totallysecret.txt.enc -out totallysecret.txt # decrypt, yay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment