diff --git a/scripts/decrypt_dir.sh b/scripts/decrypt_dir similarity index 59% rename from scripts/decrypt_dir.sh rename to scripts/decrypt_dir index cbd2bd0..86df974 100755 --- a/scripts/decrypt_dir.sh +++ b/scripts/decrypt_dir @@ -1,7 +1,9 @@ #! /bin/sh +PROGRAM_NAME=$(basename $0) + function usage() { - echo "Usage: decrypt_dir.sh INPUT OUTPUT" + echo "Usage: $PROGRAM_NAME INPUT OUTPUT" exit $1 } @@ -12,11 +14,9 @@ fi if [[ "$#" -eq 2 ]] ; then INPUT=$1 OUTPUT=$2 - mkdir -p $2 - openssl enc -d -aes-256-cbc -pbkdf2 -in $INPUT | tar xz -C $OUTPUT + mkdir -p $OUTPUT + gpgtar --decrypt -C $OUTPUT $INPUT exit $? fi usage 1 - - diff --git a/scripts/encrypt_dir.sh b/scripts/encrypt_dir similarity index 64% rename from scripts/encrypt_dir.sh rename to scripts/encrypt_dir index 8e8afb8..6b06a40 100755 --- a/scripts/encrypt_dir.sh +++ b/scripts/encrypt_dir @@ -1,7 +1,9 @@ #! /bin/sh +PROGRAM_NAME=$(basename $0) + function usage() { - echo "Usage: encrypt_dir.sh INPUT OUTPUT" + echo "Usage: $PROGRAM_NAME INPUT OUTPUT" exit $1 } @@ -14,10 +16,9 @@ if [[ "$#" -eq 2 ]] ; then OUTPUT=$2 cd $INPUT - tar -czf - * | openssl enc -e -aes-256-cbc -pbkdf2 -out $OUTPUT + gpgtar --symmetric --encrypt -o $OUTPUT * cd - exit $? fi usage 1 -