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 (10)


Comments

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

Thank you!!1

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

nothing special

BrandonNum on Friday, October 31, 2025 at 03:57

<a href=https://kurs-rils.ru>reels academy</a> reels academy
<a href=https://trekkingovie-botinki.ru>трекинговые ботинки для туризма</a> трекинговые ботинки для туризма
<a href=https://knopochnii-telefon.ru>самый лучший кнопочный телефон 2025</a> самый лучший кнопочный телефон 2025

Shaneboync on Saturday, November 1, 2025 at 09:34

WOW just what I was searching for. Came here by searching for %meta_keyword%
https://www.provision-film.com/2025/10/19/melbet-lichnyy-kabinet-2025/

BrandonNum on Saturday, November 1, 2025 at 09:48

<a href=https://noutbuki-sensornii-ekran.ru>ноутбук трансформер с сенсорным экраном купить</a> ноутбук трансформер с сенсорным экраном купить
<a href=https://oteli-sankt-peterburg.ru>отели Санкт-Петербурга с современным дизайном</a> отели Санкт-Петербурга с современным дизайном
<a href=https://igrovie-noutbuki.ru>лучшие игровые ноутбуки 2025 ryzen</a> лучшие игровые ноутбуки 2025 ryzen

BrandonNum on Sunday, November 2, 2025 at 04:55

<a href=https://gazovii-kotel.ru>газовый котёл для отопления</a> газовый котёл для отопления
<a href=https://oteli-sankt-peterburg.ru>отели Санкт-Петербурга с ортопедическими матрасами</a> отели Санкт-Петербурга с ортопедическими матрасами
<a href=https://vodonagrevatel-80.ru>бойлер электрический на 80</a> бойлер электрический на 80

Mahmadhib13 on Sunday, November 2, 2025 at 22:06

persons or social groups for reasons of certain generalized traits
<a href=https://betandreas-casinos.com/>Dismemberment</a>

Schuldtundek on Monday, November 3, 2025 at 03:53

yeah, i said it

Stephennoits on Tuesday, November 4, 2025 at 14:32

I loved as much as you will receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get bought an nervousness over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly very often inside case you shield this hike.
<a href=https://kra43.me/>Перейти на сайт kraken</a>

1xbet_qzsr on Wednesday, November 5, 2025 at 05:33

xbet giri? <a href=https://1xbet-9.com/>https://1xbet-9.com/</a> .

Add a comment

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

Comment: