about summary refs log tree commit diff
path: root/functions
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-06-21T18·18-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-06-21T18·18-0400
commit71bb47c7a32f412a6d207fd6e51d5a895c867782 (patch)
tree405167f58bfd9ac9248347afb6c263ce0223d7ec /functions
parent9d591e52ac6954d98e25bbf50f2a1e5c9b2b42b9 (diff)
Adds helpers for single file symmetric encryption / decryption
Diffstat (limited to 'functions')
-rw-r--r--functions/gpg_functions.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/functions/gpg_functions.sh b/functions/gpg_functions.sh
index ba0ad0503a86..267c40105000 100644
--- a/functions/gpg_functions.sh
+++ b/functions/gpg_functions.sh
@@ -2,7 +2,9 @@
 
 function gpg-encrypt-dir() {
     dirname=$1
+    echo "Encrypting..."
     tar -cz "$dirname" | gpg --symmetric --output "$dirname.tar.gz.gpg"
+    echo "Done."
 }
 
 
@@ -14,7 +16,27 @@ function gpg-decrypt-dir() {
         echo "Output directory, $outdir, already exists and will be overwritten by this command. Aborting..."
         exit 1
     else
+        echo "Decrypting..."
         gpg --decrypt $dirname | tar -xv
+        echo "Done."
     fi
 
 }
+
+
+# WIP
+function gpg-encrypt-file() {
+    filename=$1
+    echo "Encrypting..."
+    gpg --symmetric $filename
+    echo "Done."
+}
+
+
+# WIP
+function gpg-decrypt-file() {
+    filename=$1
+    echo "Decrypting..."
+    gpg --decrypt $filename >"${filename%.gpg}"
+    echo "Done."
+}