The pdfcipher command-line tool enables encrypting and decrypting PDF files with password-based encryption. It allows users to set and remove passwords, ensuring secure access and distribution of PDF documents.
- The qpdf command-line tool.
To install the pdfcipher executable locally in ~/.local/bin/
using pip, run:
pip install --user pdfcipher
(Omitting the --user
flag will install pdfcipher system-wide in /usr/local/bin/
.)
Encrypt PDF files with password protection:
pdfcipher enc file1.pdf file2.pdf file3.pdf
The pdfcipher tool will prompt the user to enter a password, which will then be used to encrypt all the specified PDF files:
Decrypt PDF files by entering the password used for encryption:
pdfcipher dec file1.pdf file2.pdf file3.pdf
If the entered password is correct, the tool will attempt to use it to decrypt all the other files. If any file fails to be decrypted, the tool will prompt you to re-enter the password for convenience.
Copyright (c) 2023-2025 James Cherti
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.