commit ef3e9f6900902c806e8989ec360fec40a535ec9d Author: hyzen Date: Sat Jan 17 00:56:29 2026 +0530 Initial commit diff --git a/encryptall.sh b/encryptall.sh new file mode 100755 index 0000000..d5325a8 --- /dev/null +++ b/encryptall.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +cd "$(dirname "$0")" +mkdir -p Encrypted + +echo -n "Enter password: " +read PASSWORD +echo "Password length: ${#PASSWORD}" + +PASSFILE=$(mktemp) +echo "$PASSWORD" > "$PASSFILE" +echo "Temp file: $PASSFILE" + +for file in *; do + if [ -f "$file" ] && [ "$file" != "Encrypted" ] && [ "$file" != "encryptall.sh" ]; then + echo "Processing: $file" + gpg --batch --yes --passphrase-file "$PASSFILE" --symmetric --cipher-algo AES256 -o "Encrypted/${file}.gpg" "$file" + if [ $? -eq 0 ]; then + echo "Success: $file" + else + echo "Failed: $file" + fi + fi +done + +rm -f "$PASSFILE" +unset PASSWORD +echo "Done!"