Protect PDF
Encrypt your PDF with AES-256 password protection
🔒 AES-256 Encryption
Your PDF will be encrypted with industry-standard AES-256 encryption. Set passwords and customize permissions for printing, copying, and editing.
100% Private: All processing happens in your browser. Your files never leave your device.
This tool encrypts a PDF with a real cryptographic password using the @cantoo/pdf-lib library, entirely in your browser — the file is never uploaded. Before encrypting, it forces the document's internal header to PDF version 1.7 Extension Level 3, which routes the library's encryption code down its strongest supported path: a 256-bit key with the AESV3 cipher, matching the “AES-256” the interface advertises rather than a weaker default. You can set a password required to open the file, a separate password for full owner access, and toggle seven individual permissions such as printing or copying.
Encryption controls who can open the file and what a compliant PDF reader allows them to do once they have — it does not remove or redact anything from the document itself, and some permissions, printing in particular, are narrower restrictions than they sound. Both of those are covered in detail below, since they're the part people most often get wrong about what password protection actually does.
How it works
1. Drop a PDF
Select or drag a .pdf file onto the upload area. Files over 100 MB, or files that aren't recognised as a PDF, are rejected before the file is read.
2. Set a user and/or owner password
Type a User Password (required to open the PDF) and/or an Owner Password (grants full access and permission control). At least one of the two fields must be filled before encryption can run.
3. Choose document permissions
Seven toggles — printing, modifying, copying, annotating, filling forms, content accessibility, and document assembly — control what's allowed once the file is opened with the user password. “Select All” / “Deselect All” flips every toggle at once.
4. Encrypt and download
Press “Encrypt PDF” to run the encryption — a progress bar walks through key generation and content encryption — then press “Download Protected PDF” once it finishes.
When you'd use it
Emailing a salary slip or mark sheet
Attaching a password-protected copy means the document can't be opened by someone who intercepts the email or finds it in a shared inbox without also knowing the password you share separately.
Sharing an offer letter or contract before it's finalised
A user password that must be entered to open the file adds a real barrier against a draft document being read by someone it wasn't meant for, beyond just relying on link or folder permissions.
Restricting what a recipient can do with a distributed document
Turning off copying or modifying (while leaving the file openable) lets you share a document for reading and form-filling without permission for a recipient's compliant PDF reader to let them edit or extract the text.
Submitting a document that requires a set owner password for later administration
Setting only an owner password leaves the file openable by anyone, but requires that password to change permissions or remove protection later — useful when the restriction, not who can view it, is the point.
The encryption behind “AES-256”
Before calling encrypt(), the code overwrites the PDF's header to declare version “1.7 Extension Level 3.” That header string is what @cantoo/pdf-lib's internal security module reads to decide which encryption revision to use — for that specific version string it selects revision 5, a 256-bit key, and the AESV3 cipher filter, which is the actual PDF specification's name for AES-256 encryption. Older PDF versions would fall back to a weaker 128-bit or 40-bit scheme in the same library, so this header override is what makes the AES-256 claim accurate rather than aspirational.
User password vs owner password, and what happens if you only set one
If you set only a user password, the file requires it to open at all — and the code reuses that same password as the owner password too, since the owner field falls back to the user password when left blank. There is no scenario where a user password exists but the owner password is left genuinely unset; whoever can open the file also has full owner rights over its permissions.
If you set only an owner password, the file opens without requiring any password, but changing its permissions or removing the protection later requires that owner password. This is the setup to use when the goal is restricting actions (printing, copying) rather than restricting who can open the file at all.
What password protection can't stop
Unchecking “Allow Printing” doesn't disable printing outright — the PDF permission specification this tool implements only distinguishes between full-resolution and low-resolution printing, so turning it off downgrades print quality in a compliant reader rather than blocking it. All seven permissions are also enforced by whichever PDF reader opens the file honouring those flags, not by a mechanism that makes the restricted action physically impossible; someone with the password and different software isn't stopped by the flag itself. Encryption also doesn't remove or redact anything — the text and images stay fully present inside the file, just encrypted, so use /pdf/redact first if content needs to be permanently deleted rather than password-gated.
Frequently asked questions
Is the AES-256 encryption here real, or just a label?
It's real — the code forces the PDF header to version “1.7ext3” immediately before encrypting, which is what routes @cantoo/pdf-lib's encryption module to its 256-bit AESV3 code path rather than an older, weaker default.
What happens if I leave the owner password field blank?
It doesn't stay unset — the code fills it in with whatever you typed as the user password. So once you set a user password, an owner password always exists; it's just the same one.
What happens if I leave the user password field blank?
The PDF opens without requiring any password to view, but the owner password you set (if any) is still required to change its permissions or remove the protection afterward.
If I turn off “Allow Printing,” is printing fully blocked?
No — the PDF permission model this tool uses only supports full-resolution or low-resolution printing, not an outright ban, so unchecking it restricts print quality rather than preventing printing in a compliant reader.
Does protecting a PDF remove sensitive text from it?
No. Encryption only controls access to the file; the text and images inside remain completely intact, just unreadable without the password. Use /pdf/redact beforehand if content needs to be permanently deleted.
What's the largest PDF I can encrypt here?
100 MB — that cap is checked as soon as you select the file, before it's read for encryption.

