Check PDF encryption: what "password protected" actually means
Measured 3 September 2026
"Password protected" is one label for five different things. At one end is a 40-bit RC4 key from 1996 that a laptop can recover by trying every possibility. At the other is AES-256, which nobody recovers. A PDF does not hide which one it got. It writes the answer, in plain text, into a dictionary at the end of the file, and one command prints it.
What a PDF password does
Adding a password does not lock the file. It encrypts the contents: the text in each page, the images, the fonts, the metadata strings. The skeleton stays readable. Page count, page sizes, the object table, and the encryption settings themselves are all in the clear, because a reader has to be able to find them before it can ask you for anything.
The password is not the key. It is run through a hash to produce the key, and the hash also gives the reader a way to check whether the password you typed is right without decrypting anything. That check is what a cracker attacks, and how expensive it is depends entirely on which revision of the scheme the file uses. That is the number to look for.
There are two passwords. The user password opens the file. The owner password grants permissions: printing, copying, editing. A file with only an owner password is encrypted with an empty user password, which means any reader opens it without asking, and the permissions are a flag the reader is asked to honour. A tool that ignores the flag removes the restriction. That kind of "protection" is a request.
The four fields that matter
Every encrypted PDF has an /Encrypt dictionary. The standard one starts /Filter /Standard and carries these:
- /V: the algorithm version. 1 and 2 are RC4. 4 introduces crypt filters, so the cipher is named elsewhere. 5 is AES-256.
- /R: the revision of the password handling. This is the one that decides how the key is derived from the password and how cheap a wrong guess is. 2 and 3 use MD5. 5 and 6 use SHA-256, and 6 iterates it so each guess costs more.
- /Length: the key length in bits. 40, 128 or 256. Absent means 40.
- /CFM: the cipher, when /V is 4 or 5. It lives inside /CF, under a filter usually named /StdCF. /V2 is RC4, /AESV2 is AES-128, /AESV3 is AES-256. Next to it is a second /Length, this one in bytes, so 32 there is the same key as 256 above.
| /V | /R | /Length | /CFM | What it is |
|---|---|---|---|---|
| 1 | 2 | 40 | none | RC4, 40-bit key, MD5 key derivation. 1990s export-grade. A laptop walks the whole key space. |
| 2 | 3 | 128 | none | RC4, 128-bit key, MD5. Still what some widely used browser-based PDF tools write in 2026. |
| 4 | 4 | 128 | /AESV2 | AES-128, MD5 key derivation. Sound cipher, dated key derivation. |
| 5 | 5 | 256 | /AESV3 | AES-256, SHA-256. A vendor extension that predates the standard, with a known flaw in its password check. |
| 5 | 6 | 256 | /AESV3 | AES-256, SHA-256 iterated. The PDF 2.0 standard. The only row a new file should be in. |
PDF 2.0, published as ISO 32000-2, deprecates RC4 and MD5 outright: a conforming writer is not allowed to produce the first two rows any more. Plenty of software still does. The /R 3 check costs one MD5 per guess, which is close to free, so a short password on an RC4-128 file falls to guessing in a way the same password on an /R 6 file does not. The revision decides how long your password holds.
Check any PDF you own
The dictionary is never encrypted and never compressed into an object stream, because the reader needs it before it has a key. So it is greppable. On a Mac or Linux, in a terminal:
grep -a -o '/Filter */Standard.\{0,300\}' yourfile.pdf-a tells grep to treat the binary file as text, and -o prints only the match. On Windows, open the PDF in any editor that will open a binary file and search for /Standard. Either way you get the dictionary, or you get nothing.
Nothing is only an answer once the same command has found something. A grep that finds no /Encrypt and a grep that cannot read the file look identical. So first run it on a PDF you know is encrypted, or run grep -a -c '/Type' yourfile.pdf on the same file and confirm it prints a number above zero. After that, no match means the file is not encrypted, whatever the icon on it suggests.
The same information is in your reader, in words: the document properties dialog has a security section that names the cipher and key length. The grep is worth learning anyway, because it works on a file you cannot open and on a tool's output before you trust it.
What ours writes
Our password tool runs qpdf, compiled to WebAssembly, in your browser. To add a password it calls qpdf --encrypt <password> <password> 256. On 3 September 2026 that was run against a one-page PDF generated by pdf-lib, 863 bytes, using the exact engine files the site serves. qpdf exited 0, the output was 1,827 bytes, and the grep above printed this, with the hashes shortened:
<< /CF << /StdCF << /AuthEvent /DocOpen /CFM /AESV3 /Length 32 >> >> /Filter /Standard /Length 256 /O <...> /OE <...> /P -4 /Perms <...> /R 6 /StmF /StdCF /StrF /StdCF /U <...> /UE <...> /V 5 >>
/V 5, /R 6, /Length 256, /CFM /AESV3. That is the last row of the table, and it is the only row the current standard permits. An earlier run the same day, on an 850-byte file, gave 1,670 bytes and the same four fields. You do not have to take that from us: encrypt any file on the tool page and grep the download.
For the control, the same engine was asked for 128-bit RC4, which it will only do behind a flag that says weak crypto is intended. It wrote /Filter /Standard /Length 128 /P -4 /R 3 /V 2, the second row. That is what the grep shows on files from some widely used browser-based PDF tools today.
What a wrong password does
Given the AES-256 file and the wrong password, qpdf printed invalid password, exited 2, and wrote no output file at all. Not an empty file, no file. filetity removes a password you can type in and does nothing with one you cannot. There is no brute force, no dictionary, no bypass, and the refusal is the engine's own, not a check placed in front of it.
What the dictionary cannot tell you
How good the password is. AES-256 with "1234" is a four-digit lock, and /R 6 makes each guess slower, not impossible. The dictionary tells you how the file was encrypted. It says nothing about the password you chose.
Add an AES-256 password to a PDF, or remove one you know, in the browser. No upload, no signup, no file written when the password is wrong.
Open the PDF password toolRelated: whether online PDF tools upload your file, and how local processing works here.