Protect PDF
Lock a PDF with a password using AES-256, with optional restrictions on printing, copying and editing.
The code for this tool is fetched only when you open it.
What protect pdf does
Protect PDF puts a password on a document so it cannot be opened without it. It is for the invoice, the ID scan and the contract that should not sit readable in an inbox.
How it works
@cantoo/pdf-lib applies the standard security handler with your password and an AES-capable revision, then saves. Object streams are written off so older readers can still open the file.
This is a local operation in the literal sense. The bytes are read from disk by the page, processed on the CPU it is running on, and written back out through a download — the network is never involved in the file itself.
Formats and limits
| Takes | |
|---|---|
| Returns | Encrypted PDF requiring the password to open |
| Keeps | All pages and their content exactly, behind encryption |
| Does not keep | Nothing visually, but the file is unreadable to anything without the password — including you later |
| Limits | 25 MB per file. Password strength is on you: use something long, because this is a real encryption boundary and a short password is a short wall. |
| Price | Free, 5 runs a day, no account |
Worth knowing
- Email the password through a different channel than the file. A password sent in the same message as the PDF protects nothing.
- Compatibility is deliberately conservative — object streams off, standard handler on — so the file opens in older readers as well as current ones.
Questions about protect pdf
How strong is the encryption?
It uses the PDF standard security handler through @cantoo/pdf-lib. The boundary is real for casual access, but PDF encryption is not a substitute for a properly encrypted archive when the document is genuinely sensitive.
Can the password be removed later?
Yes, by anyone who knows it — that is what the unlock tool on this shelf does. There is no recovery if it is forgotten.
How strong is it?
AES-256, the current PDF standard. With a long password it is not practically breakable; with a four-character one it is guessable.
Are the permissions a real lock?
They are requests that a reader is expected to honour. Anyone with the password can use a tool to ignore them. The password is the actual protection.
What if I forget the password?
There is no recovery. Keep a copy of the original.
Which formats does it accept?
It takes PDF. Anything the browser cannot decode is rejected with an error rather than producing a broken file.
What comes out at the end?
Encrypted PDF requiring the password to open. What survives: All pages and their content exactly, behind encryption. What is lost: Nothing visually, but the file is unreadable to anything without the password — including you later.
How large can the file be?
25 MB per file on the free bench, with no page or run limit inside that size. Larger files are refused before any work starts rather than failing halfway through.
Is my file uploaded anywhere?
No. There is no upload step and no server-side copy: the browser decodes and re-encodes the file in this tab, and the network carries nothing about it.
Does it work offline?
Once the page has loaded, yes — the processing code runs locally and no further request is needed. The first load has to come from the network like any page.