Password Protect PDF

Set an open password and print or copy permissions with AES-256

1Choose file2Settings3Process4Save

Choose a PDF and its contents will be analyzed and shown here.

Files are processed only in this browser. Nothing is uploaded to a server.

Set an open password and print or copy permissions with AES-256

Continue in another tool
Task settings
Settings
Allowed when opened with the open password

AES-256 (revision 6) opens in Adobe Reader 9 and later and in current browser and mobile viewers. Choose AES-128 only for very old viewers. RC4 is a weak method kept for compatibility. Permission restrictions are a promise the viewer keeps, so a document that opens without a password isn’t fully protected.

Remove the password from an encrypted PDF first. Processing focuses on page content, so bookmarks, attachments, forms and signatures may not be preserved. Keep the original and check the result.

About Password Protect PDF

A PDF can carry two different passwords. The user password (often called the open password) is needed to open the file at all. The owner password (sometimes called the permissions password) controls whether printing, copying, editing and so on are allowed. This tool takes both passwords plus the permissions you want to grant, encrypts every string and stream in the document, and writes a standard security handler /Encrypt dictionary into the file.

The two passwords protect very different things. With a user password set, there is no way to decrypt the content without it. Leave the user password empty and restrict permissions only, and the file has to open for anyone, which means anyone can compute the decryption key too. Most confusion about PDF security comes from not knowing that difference.

Without an open password, permissions are a polite request

In the PDF specification the permission flags (/P) are a single 32-bit integer. Bits switch printing, high-resolution printing, copying, editing, annotating and form editing, form filling, accessibility extraction and page assembly on or off. What enforces them is the viewer. Acrobat reads the no-copy bit and greys out Copy; a program that ignores the spec can simply carry on.

When the user password is the empty string, a viewer derives the file key from that empty password and opens the document. Any other program can do the same derivation, obtain the key, ignore the permission bits and save an unrestricted copy. The decrypt tool on this site removes such restrictions without asking for a password, and so do plenty of other tools. Treat permission restrictions as a signal (do not edit this form by accident) or a compliance checkbox. If the content itself must stay private, set a user password.

AES-256 files (revision 6) also contain a /Perms entry: the permission value encrypted with the file key. If someone edits /P directly, the mismatch shows up on verification. That is tamper detection, not enforcement; it still relies on the viewer to honour the bits.

AES-256, AES-128 or RC4

The tool offers AES-256 (the default), AES-128 and 128-bit RC4. AES-256 is the only scheme PDF 2.0 (ISO 32000-2) did not deprecate; it is written as V=5, R=6 in the /Encrypt dictionary. Acrobat X and later, current browser PDF viewers and macOS Preview open it. PDF 2.0 marks both RC4 and AES-128 as deprecated.

RC4 has well-known weaknesses as a cipher, and the PDF RC4 schemes derive keys with little more than 50 rounds of MD5, so password guessing runs fast. 40-bit RC4 keys can be brute-forced directly, whatever the password was, because there are only 2^40 of them. Pick 128-bit RC4 only when an old in-house system or device genuinely cannot open AES.

Whatever the scheme, an attacker who has the file can only guess passwords. A short numeric password, such as a date of birth, falls quickly even under AES-256. The R6 key derivation mixes SHA-256, SHA-384 and SHA-512 over at least 64 rounds, but it is not a deliberately slow function like bcrypt or Argon2. Password length matters more than the algorithm dropdown.

Limits on what the password can contain

The RC4 and AES-128 schemes use at most 32 bytes of the password and silently drop the rest. They also assume PDFDocEncoding, a Latin character set, so passwords with accented letters, CJK characters or emoji may be interpreted differently by different viewers. AES-256 (R6) treats the password as UTF-8 after SASLprep normalisation and uses up to 127 bytes. For long passphrases or non-ASCII characters, stay with AES-256.

What encryption leaves visible

The file structure itself is not encrypted: object numbers, the cross-reference table and the page tree skeleton remain readable, so file size and page count are not secret. If you turn off metadata encryption, the XMP metadata stream (title, author and similar fields) stays in plain text so search indexes and document management systems can read it. The file name lives outside the PDF entirely, so check it does not give away what the document is about.

Encrypting a PDF that already carries a digital signature rewrites the whole file and breaks the signature. If you need both, do them together in signing software that supports encrypted signed documents. When the original carries a signature, the result screen warns that it is no longer valid.

Worked examples

A quote sent to a client: open password plus restrictions

Input
User password: a passphrase of 12+ characters; owner password: a different long password; allowed: printing only; method: AES-256
Output
The client opens the file with the user password and can read and print; spec-compliant viewers disable copying and editing.

Send the open password by a different channel, such as a text message or a phone call. Putting it in the same email means anyone who intercepts the email gets both.

An internal form: no open password, editing blocked

Input
User password: empty; owner password: set; allowed: printing and form filling
Output
Anyone can open it without a password, and ordinary viewers block edits to the body text.

This prevents accidents, not access. Assume that anyone with a non-compliant tool can remove the restriction.

How strong is a date-of-birth password?

Input
Candidates in MMDDYY format
Output
12 months × 31 days × 100 years = 37,200 combinations at most

Even if one R6 key derivation is relatively heavy, tens of thousands of guesses finish quickly on an ordinary PC. The common practice of protecting statements with a birth date is weak no matter which algorithm is selected.

How to use it

  1. Choose a PDF. If it is already password-protected, remove the password first.
  2. Enter the user and owner passwords and choose the permissions granted to someone who opens the file with the user password.
  3. Choose the encryption method. Leave it on AES-256 unless you have a specific compatibility problem.
  4. Open the downloaded file in a viewer and check that the passwords and permissions behave as intended.

Key terms

User password
The password needed to open the document. If empty, anyone can open it.
Owner password
The password that allows changing permissions. Opening with it grants every permission.
/P permission flags
An integer whose bits allow or deny printing, copying, editing and so on. The viewer is trusted to respect them.
R6 / AESV3
The AES-256 scheme of PDF 2.0. It handles passwords as UTF-8 and derives keys with SHA-2.

Frequently asked questions

Is an owner password alone enough to protect a PDF?

No. Without a user password the file key can be computed by anyone, so restrictions are easy to remove. Use a user password to keep the content private.

Can the user and owner passwords be the same?

It works, but anyone who can open the file then has full owner rights, which makes the permission settings pointless. Use different passwords.

An old program cannot open the encrypted file.

AES-256 (R6) may not open in viewers older than Acrobat X (2010). Try AES-128 first, and fall back to RC4 only if that also fails.

Can a forgotten open password be recovered?

Not in any meaningful sense. The only option is guessing, which fails against a long password. Keep an unencrypted original somewhere safe.

Does encryption make the file larger?

AES adds a 16-byte IV plus padding to every stream, so the file grows a little. Plain objects are packed into object streams and encrypted as a whole, so the result stays close to the size of an original that already used object streams.

Related guides

Sources

Last reviewed:

Privacy and how data is handled