Skip to content

Instantly share code, notes, and snippets.

@markuman
Last active October 25, 2018 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markuman/40f3401e5bf599c9158e9d0790a51c57 to your computer and use it in GitHub Desktop.
Save markuman/40f3401e5bf599c9158e9d0790a51c57 to your computer and use it in GitHub Desktop.
#!/bin/bash
mkdir -p secrets
for fullname in cryptsecrets/*; do
filename=$(basename -- "$fullname")
extension="${filename##*.}"
filename="${filename%.*}"
openssl rsautl -decrypt -inkey ~/.ssh/aws-it.pem -in "$fullname" > secrets/"$filename"."$extension"
done
#!/bin/bash
mkdir -p cryptsecrets
for fullname in secrets/*; do
filename=$(basename -- "$fullname")
extension="${filename##*.}"
filename="${filename%.*}"
cat "$fullname" | openssl rsautl -encrypt -pubin -inkey ~/.ssh/aws-it.pem -ssl > cryptsecrets/"$filename"."$extension"
done
git add -f cryptsecrets/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment