Protect PDF
Operator: Abdulla Al Fahad. How tools are built and checked
Two different things are called a protected PDF. One is a file that nobody can open without a password, because its contents are encrypted. The other is a file that opens freely but asks viewers to refuse printing, copying or editing. Protect PDF produces the first kind and lets you add the second kind's restrictions on top: it encrypts the document with AES-256 (or AES-128 for older readers), sets the password that opens it, and records whether printing, copying text and editing are permitted.
The encryption is performed in your browser by the same PDF library used across these tools, and the only copies of the password are the ones you type into the masked fields. Because the finished file cannot be rendered without that password, the preview on the right shows the original document, with a caption saying so; the download is the encrypted report-protected.pdf.
Key features
- AES-256 (revision 6) encryption by default, with AES-128 (revision 4) for old readers.
- A required open password and an optional separate permissions password, both typed into masked fields.
- Checkboxes for printing, copying text and editing, annotating, form filling and page assembly, with accessibility extraction always allowed.
- Replaces the password on an already protected PDF when its current password is supplied, and re-protects restriction-only files directly.
How the encryption works
PDF encryption follows the standard security handler defined in the PDF specification. The file's strings and streams are encrypted with a key derived from the password, while the object structure stays readable, so a viewer knows how many pages there are before it asks for the password. AES-256 uses the revision 6 handler, which Adobe shipped in Acrobat X in 2010 as Extension Level 8 and which PDF 2.0 standardised in 2017; AES-128 uses revision 4, part of PDF 1.6 since 2005.
Two passwords are involved. The open password (the user password in the specification) is mandatory here, is used exactly as typed including any spaces, and is what every reader must be given. The permissions password (the owner password) is what a viewer asks for before it lifts restrictions such as a printing ban; leave the field empty and it is set to the same value as the open password. Either password opens the file, so a separate permissions password is only worth setting if people should read the document without being able to remove its restrictions. If any permission is left unticked while the two passwords are the same, the result carries a warning saying so, because a viewer that is given the open password treats it as the owner password and lifts the limits.
The three checkboxes map onto the permission flags the handler stores. Allow printing, on by default, permits high-resolution printing when ticked and none when cleared. Allow copying text controls whether text and graphics may be extracted; extraction for screen readers is always left on. Allow editing and annotating, off by default, governs four flags together: modifying content, adding annotations, filling form fields and assembling pages.
How it works
After the size and header checks, the document is parsed with the value of the Current password field, or with an empty password when that field is blank, and a file that needs a real password stops with a message pointing to that field.
The library's encrypt call derives the encryption keys from your two passwords with the algorithm you chose, builds the permission flags from the three checkboxes, and marks every string and stream for encryption on save. The document is then written with object streams, its Producer field and modification date updated. For the preview the tool renders the first page of the original bytes rather than the encrypted output, because the output would need the password you have just set.
Common use cases
- Emailing a payslip, a medical report or a tax return and giving the recipient the password by text message, so a misdirected email exposes nothing.
- Storing scanned identity documents in a shared cloud folder where other people can see the folder but should not read those files.
- Sending a quotation that the client may read and print but should not edit, by clearing Allow editing and annotating and keeping the permissions password to yourself.
- Replacing a password that has been shared too widely: open the file with its current password and set a new one in a single step.
How to use this tool
- Load the PDF; unlike the other PDF tools, nothing runs until a password has been entered.
- Type the Password to open and, if the restrictions should hold against the readers themselves, a different Permissions password.
- Tick or clear Allow printing, Allow copying text and Allow editing and annotating, leave Encryption on AES-256 unless a recipient's reader needs AES-128, and for a PDF that already has a password enter it in Current password.
- Click Protect PDF or press Enter, then open the downloaded file yourself and enter the password before sending it on.
Example
Settings for payslip-october.pdf (2 pages, 140 KB)
Password to open: Sunlit-Harbour-42
Permissions password: (empty, so it is the same)
Allow printing: on
Allow copying text: off
Allow editing and annotating: off
Encryption: AES-256 (recommended)
Current password: (empty, the file is not protected)Result
payslip-october-protected.pdf
2 pages in · 2 pages out · 140 KB → 152 KB · AES-256, opens with a password
Warning: The permissions password is the same as the open password, so anyone who
can open the file can also lift its printing, copying and editing limits. Set a
different permissions password to enforce them.
Preview of the original. The encrypted copy opens with the password you set.
Opening the download: every reader asks for a password; Sunlit-Harbour-42 opens it,
printing is allowed, and copying is refused by viewers that honour the flags, although
anyone who knows that password can lift the limit, as the warning says.Tips for best results
- Send the password through a different channel from the file: a text message or a phone call for a document sent by email. A password in the same email as the attachment protects against nothing.
- If recipients report that the file will not open in an old corporate reader, re-run with Encryption set to AES-128 (older readers) and send the new file.
- Keep an unencrypted copy somewhere you control. If you forget the password there is no recovery route; Unlock PDF on this site needs the password too.
Common pitfalls
Spaces count. A password typed with a trailing space, which happens when a passphrase is pasted, must be entered the same way to open the file.
The preview shows the original. Do not take the readable preview as a sign that the download is unencrypted; the caption under it says so, and the summary chip reads AES-256, opens with a password.
Nothing carries over from a file that was already protected. The checkboxes you see are the permissions the new file gets, so re-check them rather than assuming the old settings survive.
Common errors and how to fix them
- Enter the password that will open the PDF.
- The Password to open field is empty or holds only spaces. An open password is required; this tool does not make restriction-only files that open without one.
- This PDF already has a password. Type it in the current password field to replace it.
- The input is encrypted and the Current password field is empty. Enter the password that currently opens the file; the new password and permissions then replace the old ones.
- That password did not open the PDF.
- The Current password is wrong for this file. Check capitalisation and trailing spaces, or try the permissions password if you have one, since either opens the document.
- This tool accepts PDF files (.pdf), up to 50MB each. "contract.docx" has a different type.
- Protect PDF encrypts PDFs only. Convert the Word file first with Word to PDF, then drop the result here.
Best practices
- Match the permissions to the recipient's task: leave Allow printing on for a document they must sign on paper, and tick Allow editing and annotating if they are to fill in form fields, which that single checkbox also controls.
- Choose a passphrase of three or more unrelated words rather than a short code; a four-digit PIN can be tried exhaustively in seconds.
- Protect a finished document. Editing an encrypted PDF means unlocking, changing and protecting it again, and each round is a chance to send out the wrong version.
AES-128 or AES-256, and replacing a password you already set
The two algorithms differ in more than key length. Revision 4 (AES-128) derives the file key from the password with the MD5-based scheme of PDF 1.6, which is quick to compute and therefore quick for password-guessing software to test; revision 6 (AES-256) runs the password through a deliberately slower SHA-2 hash, so each guess costs more. With either a short password falls to guessing while a long passphrase holds, so the practical difference is compatibility: a few embedded viewers, print workflows and PDF libraries still understand only revision 4. Give an AES-128 file a longer passphrase to compensate.
Changing a password works in one pass. Enter the current open password, or the current permissions password, in Current password; the tool decrypts the document with it, discards the old encryption dictionary and encrypts again with your new password, algorithm and checkboxes, so the old password stops working the moment the new file is saved. A file that merely restricts printing or copying has no open password to supply, so it loads with the field empty and simply receives your settings.
Frequently asked questions
Can I protect a PDF without an open password, so it opens freely but cannot be printed?
Not with this tool; the open password is required. The permission flags are a request to viewers rather than a lock: Acrobat greys out Print or Copy when it sees them, but a viewer or library that ignores them can print, copy and re-save the file, so restrictions on their own are not offered as protection.
Which readers can open an AES-256 PDF?
Adobe Reader X (2010) and later, Preview on macOS and iOS, the built-in viewers in Chrome, Edge and Firefox, and every current Android and iOS PDF app. Readers from before 2010, some embedded viewers and a few PDF libraries only understand revision 4.
Can I protect several PDFs at once?
No, one file per run. Drop the next PDF after downloading the first, or combine them with Merge PDF beforehand if they are meant to travel together under one password.