Created
January 14, 2026 14:13
-
-
Save ILPlais/0e7f42f6c77d1450dcf5495f865cc121 to your computer and use it in GitHub Desktop.
Encrypt an existing PDF without display passwords in the command-line
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/bash | |
| echo -e "User password:" | |
| read -s user_pw | |
| echo -e "Owner password:" | |
| read -s owner_pw | |
| echo | |
| qpdf --encrypt "$user_pw" "$owner_pw" 256 -- "$1" "$2" | |
| unset user_pw owner_pw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment