Skip to content

Instantly share code, notes, and snippets.

@poikilotherm
Last active August 18, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poikilotherm/f641d46d10e1a5536910d845581d6d02 to your computer and use it in GitHub Desktop.
Save poikilotherm/f641d46d10e1a5536910d845581d6d02 to your computer and use it in GitHub Desktop.
Encrypt all PDF files using qPDF. Disallow ALL options, don't ask for a password to open and use unknown random password from pwgen for owner.
for I in *.pdf
do
qpdf --encrypt '' `pwgen -sny1 32` 256 --accessibility=n --extract=n --print=low --assemble=n --annotate=n --form=n --modify-other=n --modify=none -- "$I" "`basename $I .pdf`.enc.pdf"
done
@poikilotherm
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment