Created
November 19, 2021 15:34
-
-
Save julcap/b46b35a0e8012c9f5359519d9a3fba25 to your computer and use it in GitHub Desktop.
Automation to enctrypt/decrypt folders
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 | |
if [ ! $1 ]; then | |
echo -e "Usage\n" | |
echo -e "$0 { FOLDER | ENCRYPTED FILE }\n" | |
exit | |
fi | |
if [ -d $1 ]; then | |
tar cz $1 | openssl enc -aes-256-cbc -pbkdf2 -e > $1.encrypted | |
else | |
openssl enc -aes-256-cbc -pbkdf2 -d -in $1 | tar xz | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment