Encrypting and decrypting PDFs using QPDF

Saturday, March 14, 2020


If you have a password-protected PDF and want to generate a decrypted version, it’s very simple with QPDF:

$ qpdf --password=123 --decrypt input.pdf output.pdf

To avoid entering the password on the command line (perhaps you don’t want it saved in your shell history):

$ qpdf @- --decrypt input.pdf output.pdf

Then enter --password=123 and hit enter and ^D.

To encrypt a PDF, do this:

$ qpdf --encrypt userPw ownerPw 256 -- input.pdf output.pdf

Similarly, to avoid including the passwords in the command, do this:

$ qpdf --encrypt @- @- 256 -- input.pdf output.pdf

And then type the user password, hit enter, the owner password, enter, and ^D.

Tags: pdf | Posted at 22:04 | Comments (8)


Comments

KINCAIDE3 on Sunday, January 3, 2021 at 23:02

Thank you!!1

Ipl2025max on Sunday, September 21, 2025 at 10:43

nothing special

Stephennoits on Tuesday, January 6, 2026 at 06:38

Just wish to say your article is as astounding. The clarity in your submit is just nice and that i could assume you're a professional on this subject. Well with your permission allow me to seize your RSS feed to stay up to date with drawing close post. Thanks a million and please continue the gratifying work.
<a href=https://kornit-print.ru/>сайт Banda Casino</a>

TimsothyBat on Tuesday, January 6, 2026 at 07:40

Hi it's me, I am also visiting this web page on a regular basis, this website is actually good and the visitors are actually sharing nice thoughts.
<a href=https://vag-express.ru/>leebet casino</a>

Shaneboync on Tuesday, January 6, 2026 at 08:42

Hello Dear, are you genuinely visiting this site regularly, if so then you will definitely get pleasant know-how.
<a href=https://suzdalhotels.ru/>lee bet casino</a>

Bennyloany on Tuesday, January 6, 2026 at 13:34

http://www.google.com.gi/url?q=https://t.me/MatrixxxVPNchannel

fen daison_ckPn on Wednesday, January 7, 2026 at 01:12

дайсон стайлер для волос с насадками цена купить официальный сай... <a href=https://fen-d-12.ru/>fen-d-12.ru</a> .

DichaelPioda on Wednesday, January 7, 2026 at 10:43

It's amazing to visit this web site and reading the views of all friends regarding this post, while I am also zealous of getting experience.
<a href=https://dragon.suzdalhotels.ru/>регистрация драгон мани казино</a>

Add a comment

Name:
Email: (optional, not displayed to public)
URL: (do not fill this in — leave blank!)

Comment: