fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home/pdf tools/protect-pdf

PDF Password Protect

Two locks on one PDF: who can open it, and what they can do.

An open password encrypts the whole file, so nobody reads it without the password. A permissions password lets people read but stops printing, copying or editing. Set either or both, and preview what the recipient will see.

lockOpen passwordneeded to open and read the file
visibility
strong
lock_personPermissions passwordlets people read, restricts the rest
visibility
empty
printAllow printingblockBlock copying textblockBlock editingedit_noteAllow filling forms
encryption
RC4 128-bitV2 · R3 · PDF 1.4AES-128V4 · R4 · AESV2 · PDF 1.6
upload_fileOpen a PDFlockProtect & download sample PDFdownload ·
what the recipient sees
AcrobatMac PreviewChrome
picture_as_pdfpayroll-q3.pdf · lockedprintcontent_copyedit
Payroll summary · Q3A. Okafor£3,420J. Smith£2,980P. Nair£4,110M. Rossi£3,050L. Chen£3,760Total£17,320Employer NI£2,190
lock“payroll-q3.pdf” is protectedType the open password you set to test it.Open
Without the open password, nothing inside can be read: text, images and even the page count are encrypted.
~/the-weak-link

The encryption is unbreakable. The password is not.

Nobody attacks AES-256 itself; they guess passwords, billions per second on a gaming graphics card. Length matters far more than symbols. Build a password below and see how long a determined guesser would need.

length12 characters
a: zA: Z0-9!#-
iu7hHtrBlo2p
Office laptop10 thousand / s
> 1B years
Gaming graphics card1 billion / s
85k years
Rented GPU cluster1 trillion / s
85 years
Each extra character multiplies the work. Adding symbols helps less than adding two more letters.
~/inside-the-encrypt-dictionary

The password never goes in the file. A fingerprint of it does.

PDF’s Standard security handler turns your passwords into two 32-byte values, /O and /U, using MD5 and RC4. A reader checks a typed password by redoing the same maths and comparing with /U, so the file can tell right from wrong without ever storing the password. These values are computed live from the passwords you set above, with the algorithms in ISO 32000.

/Encrypt dictionaryAESV2 · 128-bit · ID 26dc7027…
/Filter/StandardThe built-in password handler.
/V /R4 · 4Version 4 uses crypt filters; revision 4 is the AES-128 handler (PDF 1.6).
/P-4 (0xFFFFFFFC)Permission flags as a signed 32-bit integer: see the bit table below.
/O<70c45827b7bb12a982e75dafb143a0c2309bfc0143cfb77294c7e4620a7fc486>RC4 of the padded open password, keyed by MD5×51 of the open password, 20 passes.
/U<134e1fc5b2b6cdeb02bf5ec17e9be5d500000000000000000000000000000000>RC4 of MD5(padding + /ID), keyed by the file key, 20 passes; last 16 bytes are filler.
/ID[0]<26dc702722829369eacb5d8b27debd86>Random per file, so the same password gives different /O and /U in different PDFs.
file key55f24d565163e5020c38a88a236cd981MD5×51 of (padded password + /O + /P + /ID). Never stored: readers recompute it.
object key666b492fa4e571423dd443f77455fcb3 (obj 4)MD5 of file key + object and generation number + “sAlT”. Each object gets its own key.
password bytes54756c69702d486172626f75… + paddingPasswords are padded to 32 bytes with a fixed string from the spec; longer ones are cut at 32.
Be the PDF readerType any password. The page runs Algorithm 6 (user) and Algorithm 7 (owner) against the /O and /U on the left.
keyWaiting for a password.
The steps appear here as you type.
page content · object 4 · first 48 bytesplain42 54 20 2f 46 31 20 32 30 20 54 66 20 37 32 20 37 36 30 20 54 64 20 28 50 61 79 72 6f 6c 6c 20 73 75 6d 6d 61 72 79 20 2d 20 51 33 29 20 54 6aas stored in the file07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 03 42 b4 0a 51 37 78 01 1c 92 4d fc 8c df 75 e8 69 ec 4a 69 b9 ff 4e 01 74 10 d9 ea 97 d6 dd 5b
keyEverything above is recomputed as you change the passwords or permissions. Press “Protect & download sample PDF” to write a real encrypted file from these values.
~/honest-limits

Permission locks are a request, not a wall.

An open password truly encrypts the content. "No printing" and "no copying" only work because PDF readers agree to honour them; the text itself isn't hidden. Useful to stop casual copying, not a determined person.

lockOpen password
Content encryptedcheck_circleWorks in every readercheck_circle
Real protection. Without the password the file is unreadable noise.
print_disabledNo printing
Honoured by Acrobat & Previewcheck_circleIgnored by some viewerscancel
A screenshot or a browser viewer gets around it.
content_copyNo copying
Blocks select & copycheck_circleStops retyping or OCRcancel
Anyone can still read and retype the text, or photograph the screen.
lock_openRemoving permissions
Needs the passwordcancelFree tools can strip itcheck_circle
Permission-only PDFs can be unlocked without the password by common utilities.
~/dont-send-it-together

The password shouldn't travel with the file.

If both arrive in the same email, anyone who gets the email gets everything. Pick how you'll send the PDF to see a safer channel for the password.

EmailCloud linkUSB stick
mailThe PDFAttached to an email.
link_off
smsThe passwordSend by text message or say it on a call.
~/reference

Five generations of PDF encryption.

Each revision of the Standard handler fixed a weakness in the one before. The rows marked “this page” are what the download above produces; R6 needs SHA-384 and SHA-512 key hashing, which this in-browser demo doesn’t implement.

/RSinceCipherKeyWeakness or note
21996RC4this page40-bitPDF 1.1. A 40-bit key can be brute-forced in hours, regardless of the password.
32001RC4this page40-128-bitPDF 1.4. RC4 has known biases, and MD5×51 is fast for guessers.
42004AES-128 or RC4this page128-bitPDF 1.6 adds crypt filters and AESV2. Same MD5-based password check as R3.
52008AES-256this page256-bitAdobe extension; used one SHA-256 pass, so passwords were faster to test than in R4. Deprecated.
62017AES-256this page256-bitPDF 2.0. Password check is an iterated SHA-256/384/512 + AES mix (Algorithm 2.B). The current recommendation.
Timeline
1987Ron Rivest designs RC4 (kept as a trade secret until it leaked in 1994).
1992Rivest publishes MD5 as RFC 1321.
1996PDF 1.1 introduces the Standard security handler with 40-bit RC4.
2001NIST publishes AES (FIPS 197); PDF 1.4 allows 128-bit RC4.
2001Dmitry Sklyarov is arrested in the US after a DEF CON talk on e-book and PDF protection weaknesses.
2004PDF 1.6 adds AES-128 (AESV2) and crypt filters.
2008Adobe’s extension level 3 brings AES-256 (R5); PDF 1.7 becomes ISO 32000-1.
2015RFC 7465 prohibits RC4 in TLS after practical attacks.
2017PDF 2.0 (ISO 32000-2) deprecates RC4 and makes AES-256 R6 the standard.
2018Researchers show “PDFex” attacks that exfiltrate content from encrypted PDFs.
Permission bits in /P
bit 3Printallowed
bit 4Modify contentsallowed
bit 5Copy text and graphicsallowed
bit 6Add annotations, fill formsallowed
bit 9Fill forms (even if 6 is off)allowed
bit 10Extract for accessibilityallowed
bit 11Assemble: insert, rotate, delete pagesallowed
bit 12High-quality printallowed