Last active
February 4, 2021 06:16
-
-
Save dsecuma/fa0a8c657feb477aa77c107331e5470c to your computer and use it in GitHub Desktop.
Poor script to encrypt all pdf in specific folder with AES256 (qpdf)
This file contains hidden or 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
#!/bin/sh | |
stty -echo | |
while true; do | |
read -s -p "Password: " password | |
echo | |
read -s -p "Password (again): " password2 | |
echo | |
[ "$password" = "$password2" ] && break | |
echo "Please try again" | |
done | |
stty echo | |
for file in $1/*.pdf ; do | |
qpdf --encrypt $password $password 256 -- $file ${file%.pdf}-enc.pdf | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment