How PDF passwords work: open vs owner passwords, AES-256 and what limits really do

What a PDF open password actually encrypts, why print and copy limits are only requests, how long a password needs to be, and how to share a locked file safely.

Open the Protect PDF Free, in your browser, nothing uploaded.

Payslips, tax forms, medical letters and contracts often travel as PDFs, and many people are asked to “send it password-protected”. But a PDF can carry two different passwords and a set of limits, and they protect very different things. This guide explains what each one does inside the file, how strong the lock is, and how to share a locked PDF without giving the password away in the same message. Protect PDF adds the lock on your own device; nothing is uploaded. Before locking, take out anything the reader should never see with redact PDF, put the pages in order with organise PDF, or mark the copy as yours with watermark PDF.

What it is

A PDF is a set of objects: page descriptions, text strings, fonts and images. Encrypting a PDF scrambles every string and stream with a key, so the file still has its structure but the content is unreadable without the key.

The PDF standard (ISO 32000-2) describes the Standard Security Handler. Its strongest form, version 5 revision 6, uses AES-256: a random 256-bit file key encrypts the content, and the passwords unlock that key. Each password is run through a deliberately slow hash (at least 64 rounds of SHA-2 and AES), so every guess costs an attacker real work.

There are two passwords:

  • Open (user) password. Needed to decrypt the file at all. This is the real protection.
  • Owner password. Lets someone change the permissions. Without it, a reader opens the file with the open password and is asked to respect the limits.

The permissions are a single number stored in the file, the /P value. Each allowed action is one bit: printing, copying, editing, comments, forms and page changes. With everything allowed, /P is −4; each action you switch off clears its bit. Honest PDF apps grey out the matching menu items, but the content is already decrypted on screen, so the limits are requests, not locks.

How to use it

  1. Choose your PDF. It is read on your device and never sent anywhere.
  2. Type the password people will need to open the file. Tick “Show the passwords” to check it; the strength line under it says Short, Fair or Good.
  3. Optional: open the limits section, type an owner password and untick any action you want PDF apps to block.
  4. Press Lock the PDF and download. The new file has “-locked” added to its name.
  5. Open the locked copy to check it asks for the password, and keep your original somewhere safe.

A worked example

A small office sends a 3-page payslip each month. They lock it with the open password river-lamp-orbit-47 (19 characters) and switch off editing and page changes, leaving printing and copying on.

  • The permission number becomes −1036 (all allowed would be −4; printing and copying off instead would be −2584).
  • Opened without a password, the reader refuses. With a wrong password, it refuses again. With the right one, all 3 pages show, and the reader reports printing and copying allowed but editing and page changes not.

How strong is that? Suppose, generously, an attacker could test ten billion passwords a second. A random 12-character password from the 94 printable keyboard symbols has 94^12, about 4.76 × 10^23, possibilities: about 1.5 million years to try them all. Eight random lowercase letters have 26^8, about 2.09 × 10^11: about 21 seconds. Length beats cleverness.

They send the PDF by email and the password by text message, so someone who sees one channel does not have both.

Checked with the tools

The example was run with the tool’s own code (src/lib/docs/pdfprotect.ts) in Node. permBits() gave −4 for all allowed, −2584 with printing and copying off, and −1036 with editing and page changes off. protectPdf() locked a 3-page test PDF; the result carried /V 5, /R 6 and /P −1036. The PDF.js reader refused it with no password and with a wrong one (PasswordException), opened all 3 pages with the right one, read the page text back, and listed print and copy among the allowed actions. The guess counts are plain arithmetic, with the ten-billion-a-second rate our own assumption.

Where it is used

  • Payroll and HR. Sending payslips and offer letters to personal email addresses.
  • Accountants and tax preparers. Exchanging returns and statements with clients.
  • Health and legal letters. Sharing reports that contain personal details.
  • Students and job seekers. Sending ID-free documents, such as transcripts, that should not be edited.
  • Internal reports. Limiting casual copying of a draft before it is final, knowing the limits are only a request.

Common mistakes

  • Relying on the owner password alone. Without an open password, anyone can read the file; the limits only ask apps to behave.
  • Sending the password with the file. Use a different channel: a call, a text or a chat.
  • Choosing a short or common password. Use 12 or more characters, or a few unrelated words.
  • Losing the password. It cannot be recovered or reset; nothing is stored anywhere. Keep the original unlocked copy safe.
  • Locking before redacting. Encryption hides content only from people without the password. Anyone with it sees everything, so remove what they should not see first.

Questions people ask

Does locking a PDF change how it looks? No. Pages, fonts and pictures are the same once opened.

Are the limits worth setting at all? Yes, for honest readers: they make the intent clear and stop accidental edits.

Is AES-256 the same as “PDF 2.0 encryption”? Revision 6 of the security handler is the AES-256 method described in the PDF 2.0 standard, ISO 32000-2.

Sources

  • The lock follows the PDF Standard Security Handler, version 5 revision 6 (AES-256), in ISO 32000-2:2020, section 7.6 and algorithms 2.A, 2.B, 8, 9 and 10. Permission bit meanings are from table 22 of the same standard. Checked 2026-12-05 against the open-source PDF.js reader, which opens the result only with the password. Check the official source (ISO 32000-2) for the full text.

If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.

Tools in this article

Read next