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)


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

Thank you!!1

RobertBoara on Saturday, May 18, 2024 at 15:11

In Etsy, Amazon, eBay, Shopify https://pint77.com Pinterest+SEO +II = high sales results

RobertBoara on Saturday, May 18, 2024 at 15:11

In Etsy, Amazon, eBay, Shopify https://pint77.com Pinterest+SEO +II = high sales results

CarlosVex on Saturday, May 18, 2024 at 21:16

<a href=https://pint77.com>In Etsy, Shopify Pinterest+SEO + artificial intelligence give high sales results</a>

EarnestHaf on Sunday, May 19, 2024 at 17:13

May I simply say what a relief to uncover somebody that genuinely understands what they are discussing on the net. You certainly know how to bring an issue to light and make it important. A lot more people have to read this and understand this side of the story. It's surprising you aren't more popular since you definitely have the gift.
<a href=https://luxuryoutletinline.com/>electronics store</a>

Winaldnusty on Sunday, May 19, 2024 at 17:16

Полезный совет! Для защиты от мусора, атмосферных осадков и животных необходимо продумать крышку для песочницы.Игровой центр , с 1 года до 3 х лет , состояние отличное .
<a href=http://uad.com.ua/?m=201302>Фото и видео универсальные спортивные площадки</a>
<a href=http://multigonka.com.ua/index.php?go_id=viewuser&u_id=416>Купить недорого уличные тренажеры</a>
<a href=http://boyevyye-iskusstva.ru/ushu/>Антивандальные спортивные тренажеры для улицы</a>

Движение-залог здоровья. Поэтому всё чаще родители устанавливают во дворе детские и спортивные комплексы для игры на улице. Спортивный комплекс "Качеля"- элемент спортивного оборудования для детских и спортивных площадок.2152/3 Тренажер Диск тройной — 21 141 руб.

TimsothyBat on Sunday, May 19, 2024 at 22:42

Hello to all, the contents existing at this web page are really remarkable for people knowledge, well, keep up the nice work fellows.
<a href=https://luxuryoutletinline.com/>buy online</a>

Stephennoits on Monday, May 20, 2024 at 10:06

Admiring the persistence you put into your site and in depth information you provide. It's good to come across a blog every once in a while that isn't the same outdated rehashed material. Wonderful read! I've saved your site and I'm adding your RSS feeds to my Google account.


Add a comment

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