Created
October 10, 2018 08:47
-
-
Save micalm/461da27cccff89c4e1da70bb6fc6c8f4 to your computer and use it in GitHub Desktop.
Encrypt all files in current folder with passphrase
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 | |
PASS="$1" | |
CIPHER="AES256" | |
for filename in ./*; do | |
encoded="$filename.asc" | |
echo "Encoding $filename..." | |
gpg \ | |
--passphrase "$PASS" \ | |
--output "$encoded" \ | |
--cipher-algo "$CIPHER" \ | |
--batch \ | |
--symmetric \ | |
"$filename" \ | |
&& echo "Encoded $encoded!" \ | |
|| echo "Failed $filename." | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment