aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/common/.local/bin/encryptfile
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-05 00:20:14 -0600
committerCraig Jennings <c@cjennings.net>2026-02-05 00:20:14 -0600
commit9d50cea9db485095b0a1a32c6c84f452f3839e7b (patch)
tree6affe3f8867cb77fc2fd30cad4dd99cd925fce2e /dotfiles/common/.local/bin/encryptfile
parent4353119023dde3f010bf51c29e87a90435c08b78 (diff)
downloadarchsetup-9d50cea9db485095b0a1a32c6c84f452f3839e7b.tar.gz
archsetup-9d50cea9db485095b0a1a32c6c84f452f3839e7b.zip
feat(dotfiles): add GPG symmetric encryption scripts
encryptfile: encrypt file with AES256, prompt to delete original decryptfile: decrypt to clipboard (wl-copy for Wayland, xclip for X11)
Diffstat (limited to 'dotfiles/common/.local/bin/encryptfile')
-rwxr-xr-xdotfiles/common/.local/bin/encryptfile17
1 files changed, 17 insertions, 0 deletions
diff --git a/dotfiles/common/.local/bin/encryptfile b/dotfiles/common/.local/bin/encryptfile
new file mode 100755
index 0000000..bfe5aee
--- /dev/null
+++ b/dotfiles/common/.local/bin/encryptfile
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Encrypt a file with symmetric GPG (password-based)
+# Usage: encryptfile <file>
+
+if [ -z "$1" ]; then
+ echo "Usage: encryptfile <file>"
+ exit 1
+fi
+
+if [ ! -f "$1" ]; then
+ echo "File not found: $1"
+ exit 1
+fi
+
+gpg --symmetric --cipher-algo AES256 --armor -o "${1}.gpg" "$1" && \
+ echo "Encrypted to ${1}.gpg" && \
+ rm -i "$1"