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

RichardLor on Wednesday, December 31, 2025 at 16:10

<a href="https://www.edufex.com/forums/discussion/general/melbet-free-spins-code-2026-melmax200-eur1750-fs">https://www.edufex.com/forums/discussion/general/melbet-free-spins-code-2026-melmax200-eur1750-fs</a>

RichardLor on Wednesday, December 31, 2025 at 16:53

<a href="https://md.ctdo.de/s/xGeL2aVk14">https://md.ctdo.de/s/xGeL2aVk14</a>

Donaldindet on Thursday, January 1, 2026 at 04:47

Офлайн-квест — это шанс на несколько часов вырваться из привычной жизни и попробовать себя в роли детектива, авантюриста или героя фильма <a href="https://dzen.ru/a/aTar-zAOVyjO7X5G">https://dzen.ru/a/aTar-zAOVyjO7X5G</a>

Donaldindet on Thursday, January 1, 2026 at 05:50

Офлайн-квест — это шанс на несколько часов вырваться из привычной жизни и попробовать себя в роли детектива, авантюриста или героя фильма <a href="https://www.fontanka.ru/longreads/76177974/">https://www.fontanka.ru/longreads/76177974/</a>

Donaldindet on Thursday, January 1, 2026 at 06:31

Офлайн-квест — это шанс на несколько часов вырваться из привычной жизни и попробовать себя в роли детектива, авантюриста или героя фильма <a href="https://dzen.ru/a/aTar-zAOVyjO7X5G">https://dzen.ru/a/aTar-zAOVyjO7X5G</a>

CarlosVoiff on Thursday, January 1, 2026 at 08:34

<a href="https://pr1bookmarks.com/story21378962/code-promo-1xbet-2026-bonus-vip-jusqu-%C3%A0-130">https://pr1bookmarks.com/story21378962/code-promo-1xbet-2026-bonus-vip-jusqu-%C3%A0-130</a>

CarlosVoiff on Thursday, January 1, 2026 at 09:32

<a href="https://jarederdo42975.pages10.com/code-promo-1xbet-tchad-2026-code1x200-bonus-vip-74587241">https://jarederdo42975.pages10.com/code-promo-1xbet-tchad-2026-code1x200-bonus-vip-74587241</a>

CarlosVoiff on Thursday, January 1, 2026 at 10:11

<a href="https://freedirectory4u.com/listings13435346/code-promo-1xbet-guin%C3%A9e-%C3%89quatoriale-2026-code1x200">https://freedirectory4u.com/listings13435346/code-promo-1xbet-guin%C3%A9e-%C3%89quatoriale-2026-code1x200</a>

Add a comment

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

Comment: