Password protect a PDF with AES-256
Encrypt a PDF with a real AES-256 password and permission flags, entirely in your browser. The document and the password never leave this tab.
- Runs in your browser
- Files are never uploaded
- Free, no account
How to password protect a PDF
- Drop the PDF onto the box above. It is read straight into this tab's memory.
- Type the password people will need to open it, then type it again. The strength meter is advisory — length matters far more than punctuation.
- Optionally open permissions and owner password to withhold printing, copying or editing from anyone who does not also hold the owner password.
- Press Encrypt with AES-256. Progress is reported per object; a large document contains tens of thousands of them.
- Check the self-test result, then download. Store the password somewhere you will still have it in a year.
What is actually being written into the file
PDF encryption is defined by the format itself, not bolted on afterwards. This tool writes the standard security handler at version 5, revision 6 — the scheme introduced in ISO 32000-2 and the strongest the specification defines.
- A random 256-bit file encryption key is generated by your browser's CSPRNG. It is not derived from your password; your password unlocks it.
- Your password is run through Algorithm 2.B: at least sixty-four rounds of SHA-256, SHA-384 or SHA-512 interleaved with AES-128-CBC, with the choice of hash at each round decided by the previous round's output. This is what makes guessing slow.
-
That derived key encrypts the file key, and the result is stored as
/UE(and/OEfor the owner password). The file key itself is never stored in the clear anywhere. - Every string and every stream in the document — page content, embedded fonts, images, bookmarks, metadata — is then encrypted with AES-256-CBC under the file key, each with its own random initialisation vector.
-
The permission flags are packed into a 16-byte block, encrypted with the file key and
written as
/Perms, so a reader can detect that they have been tampered with.
Because the whole object graph is rewritten, the tool serialises the document itself rather than using the library's ordinary save path — a save would add new, unencrypted objects after the fact and produce a file Acrobat rejects.
Open password vs owner password
| Password | Also called | What it does |
|---|---|---|
| Open password | User password, document open password | Required before the document can be decrypted at all. Without it the file is unreadable ciphertext. |
| Owner password | Permissions password, master password | Lifts the restrictions below. A reader given only the open password sees the document but is held to the permission flags. |
If you leave the owner password toggle off, both are set to the same value, which is the right choice for the common case of "nobody opens this without the password". Use two different passwords when you want to hand a document out for reading but keep printing or copying for yourself.
How strong does the password need to be?
Revision 6's key derivation is deliberately expensive, but it is not a modern memory-hard function like Argon2 — a determined attacker with GPUs can still test a lot of candidates per second. That makes length the thing that matters.
- Four random dictionary words (about 44 bits) is fine for stopping a colleague or a casual finder.
- Five or six random words, or sixteen-plus random characters, is the right level for anything with a legal or financial consequence.
- Anything reused from another account is the weakest option regardless of how complicated it looks, because the attacker starts from a leaked list, not from scratch.
Our password generator and passphrase generator both run in the browser too, so you can create the password without it touching a network either.
What encryption does not do
Being straightforward about the limits is more useful than a security badge:
- Permission flags are honoured, not enforced. Acrobat, Preview and Chrome respect them. A command-line tool holding the correct password does not have to. If the content must not be printed by a determined recipient, encryption is the wrong control.
- Screenshots exist. Anyone who can read a document can photograph it.
- It does not prove who wrote the document. That is a digital signature, which needs a certificate authority and is a different mechanism entirely.
- Existing digital signatures will break. Re-encrypting rewrites every object, which invalidates any signature already applied. Sign after encrypting, not before.
Why doing this locally matters here more than anywhere
Every upload-based "protect PDF" service asks you to send it two things at once: the confidential document and the password you chose for it. Even with the best intentions on their side, that is a moment where both halves exist together on a machine you do not control — and the recurring news story about a document-conversion site leaving millions of uploaded files publicly reachable is what that risk looks like when it lands.
Here the document is read by your own browser, the key is generated by your own operating system's random number generator, and the encrypted result is assembled in the same tab. You can verify that in about five seconds: open your browser's developer tools, switch to the Network panel, and encrypt a file — or simply turn off Wi-Fi first. The page keeps working.
Questions
What encryption is actually used?
The PDF 2.0 standard security handler at version 5, revision 6: AES-256 in CBC mode over every string and stream, with the key derived by the specification’s iterated SHA-256/384/512 hash. It is the strongest scheme the PDF format defines and the one Acrobat writes.
Can you recover my password if I lose it?
No, and neither can anyone else. The key is derived from your password by a deliberately slow hash and is never written down, sent or stored. A lost password means a lost document — put it in a password manager before you download the file.
What is the difference between the open password and the owner password?
The open (user) password is required to read the document at all. The owner password lifts the permission restrictions — printing, copying, editing — for someone who has it. Set them to different values if you want people to read but not print.
Do the permission flags really stop anyone printing?
They stop conforming readers. The flags live inside the encrypted, tamper-checked /Perms block, so they cannot be edited without the key, but a tool that chooses to ignore them can. Only the open password makes the content genuinely unreadable.
How do I know the encryption worked?
The tool re-opens its own output with your password before showing you the download button, and reports the page count it read back. If that self-check fails you will see it said so, rather than getting a file that silently does not open.