Skip to content
PDF guides

How to Password Protect a PDF (and What It Really Stops)

The short answer

To password protect a PDF, encrypt it with an open password, the one a reader must type before seeing anything. Use AES-256, the strongest option in the PDF standard, and a long password. Password protect PDF does this in your browser: add the file, type the password twice, press “Protect and download”. The file and the password never leave your device.

Two things people get wrong:

  • The open password is the real protection. The “permissions” settings that block printing or copying are a request to the reading software, not a lock. Anyone who can open the file can, with the right program, ignore them.
  • There’s no recovery. If you forget the open password, nobody can get the file back, including us. Keep the unprotected original somewhere safe.

Two passwords, two different jobs

The PDF standard (ISO 32000) allows up to two passwords on a document:

Password Also called What it does
Open password User password Needed to open and read the file at all. Without it, the content is encrypted gibberish.
Permissions password Owner password Gives “full (owner) access”, including changing the passwords and lifting restrictions on printing, copying and editing.

The standard says a reader that’s given the user password should then allow only the operations the document’s permissions permit, while the owner password allows everything. That sounds like two locks. In practice, only one of them is enforced by maths.

What permissions really do

Here is the honest version, straight from the PDF standard itself. ISO 32000-1 says that once a document has been opened and decrypted, a reader “technically has access to the entire contents of the document”, and that “there is nothing inherent in PDF encryption that enforces the document permissions.” The standard then requires conforming readers to respect the creator’s intent and apply the restrictions. Mainstream readers do; software that ignores the standard doesn’t have to.

The qpdf manual, from a widely used open-source PDF tool, puts it more bluntly: the security of the restrictions “is solely enforced by the software”, and there is “fundamentally no way to prevent an application from disregarding the security restrictions on a file.”

So:

  • “No printing” and “no copying” stop casual use. Most people won’t get around them, and that’s often all you need for, say, a draft you’d rather not see printed.
  • They don’t stop someone determined. If the recipient can open the file, they can read every word and could use software that ignores the flags.
  • Permissions-only files (no open password) aren’t confidential at all. They open for anyone.

If the content must stay private, the open password is what matters. If you just want to discourage printing, restrictions are fine, as long as you know that’s what they are.

Why AES-256, and why the password matters more

PDF encryption has come in several strengths over the years. qpdf’s manual notes that 40-bit keys are short enough to brute-force, that 128-bit RC4 “is also known to be insecure”, and that 256-bit encryption always uses AES. Revision 6 of the security handler, AES-256, is in its words the only value “not deprecated in the PDF 2.0 specification.” That’s what our tool uses.

With AES-256 the weak point isn’t the cipher; it’s the password. An attacker who has the file can try passwords as fast as their hardware allows. A pet’s name or a birthday falls quickly. A long password doesn’t.

The tool’s strength meter estimates this. It counts the kinds of characters you use (26 lowercase, 26 capitals, 10 digits, 33 symbols) and multiplies:

strength in bits ≈ number of characters × log2(size of the character pool)

“plum tractor violin 41” is 22 characters drawn from lowercase letters, digits and the space (a symbol): a pool of 69, so 22 × log2(69) ≈ 134 bits, rated very strong. “X7#qL9!” uses all four kinds but is only 7 characters: 7 × log2(95) ≈ 46 bits, rated fair. Length beats complexity, and four unrelated words are easier to type.

Step by step: protect a PDF

  1. Open Password protect PDF and add the file.
  2. Type the open password twice. Watch the meter; aim for strong.
  3. Choose what people can do after opening: print, copy text and images, and edit pages, comments and form fields. All are allowed by default.
  4. Optional: set an owner password under “Owner password”. This only matters if you unticked something. Left blank, a random owner password is used, so the restrictions apply to everyone, you included. It must differ from the open password, or anyone who can open the file could lift the restrictions too.
  5. Press “Protect and download”. The locked copy is saved with “-protected” added to the name; your original isn’t changed.

Recipients open it in their usual PDF reader, which asks for the password; a reader too old to support AES-256 encryption won’t be able to open it. If the PDF already has a password, the tool won’t stack a second one on top: unlock it first, then protect the unlocked copy.

Sending it safely

  • Send the password a different way from the file: a text or a phone call when the PDF goes by email.
  • Don’t put the password in the file name or subject line.
  • Save the password in a password manager before you send. Forgetting it means the file is gone for good.

Removing a password you know

Once a document is in the right hands, the password can become a nuisance, for example a bank statement that asks for it every time, or one you need to attach to an application. Unlock PDF removes it when you know it. When you add a file, the tool reads the encryption details, names the cipher, and checks whether the file needs a password to open:

What it finds What you need What you get
An open password That password, or the owner password A copy that opens without a password, with no restrictions
Only an owner password (opens freely, printing or copying blocked) Nothing A copy with the restrictions removed
No encryption Nothing Nothing to do

It handles RC4 40-bit, RC4 128-bit, AES-128 and AES-256. Passwords are case-sensitive, so check Caps Lock. The unlocked copy keeps its pages, text, images, links and form fields, and is checked to make sure it really is unencrypted before it downloads. One catch: a certificate-based digital signature on the original will show as invalid in the unlocked copy, so keep the original if the signature matters.

What it won’t do

It won’t guess or crack a password you don’t have. Against AES-256 with a decent password, there’s no practical way to. If you’re entitled to a locked file and don’t know the password, ask whoever sent it; banks and payroll services usually explain the format in the same email. Only unlock files that are yours or that you have permission to change.

It also can’t open files protected with a digital certificate instead of a password, or files under company rights-management systems that check with a server.

Common mistakes

  • Relying on “no copying” to protect secrets. It’s a request, not a lock. Use an open password.
  • Using the same password for open and owner. Then anyone who can read the file can lift the restrictions.
  • Short passwords. Encryption is only as strong as the password.
  • Emailing the password with the file. Anyone who gets one gets both.
  • Deleting the unprotected original. If the password is lost, so is the document.

For a file that should only be read by the right people, Password protect PDF locks it with AES-256 on your device, and Unlock PDF takes the password off again when you no longer need it.

Sources

  1. ISO 32000-1:2008, section 7.6.3: Standard security handler (Adobe-hosted copy)
  2. qpdf manual: PDF encryption