How to use
- Open the PDF. The page says whether it has a password and opens the matching tab.
- To add one, type the password twice and press Add password and download. To also stop printing, copying or editing, open the restrictions and set a second password for them.
- To remove one, type the PDF's password and press Remove password and download. You get a copy that opens without a password.
Examples
The US IRS Form W-9 (6 pages, 23 form fields, 140,815 bytes), a password added
→ fw9-protected.pdf, 146,948 bytes, which asks for the password; with it, every page and all 23 fields are as before
The same file, password removed with the right password
→ fw9-unlocked.pdf, 144,278 bytes, which opens without asking; text and fields the same as the original
A PDF with an open password and a no-copying restriction, password removed
→ Opens without a password; copying is still restrictedRestrictions set by the file's owner are not lifted here.
A government form saved as PDF/A, password added
→ The page explains that PDF/A does not allow passwords and asks first; with your agreement only the PDF/A label is removed
How it works
What adding a password does
- Open password: everything in the file, text, pictures and form fields, is encrypted with AES-256. A viewer asks for the password before showing anything.
- Restrictions (optional): no printing, no copying text, no editing. They need a second password, different from the first, which lifts them in programs such as Acrobat. Without restrictions, the one password gives full use of the file.
- What stays the same: pages, text, links and form fields. Only the protection is added.
What removing a password does
- A file you open with a password: you get a copy that opens without one. The leftovers of the old encryption are taken out, so the copy is an ordinary PDF.
- If it also has restrictions: the copy opens without a password, and the same restrictions are written back. Lifting them is for whoever set them.
- A file that opens freely but has restrictions: nothing is changed, for the same reason.
Mistakes that are easy to make
- A password you will not remember. There is no recovery. Write it down somewhere safe before you send the file.
- Sending the password in the same e-mail as the file. Anyone who gets the e-mail gets both. Send it another way, such as a text message or a call.
- Counting on restrictions to keep a file private. Restrictions do not hide anything; the open password does.
How it is made
The encryption and decryption are done by pdf-lib (the @cantoo/pdf-lib fork), an open-source library that writes the AES-256 method of the current PDF standard and reads the older ones. The page decides what it can do from the file itself: whether it is encrypted at all, and whether an empty password opens it, which is the case for files that only carry restrictions.
The tests check each result with PDF.js, an implementation apart from the one that wrote it: a protected file asks for its password, refuses a wrong one, and shows the same text with the right one; the text cannot be read in the file’s bytes; restrictions show up as the flags PDF.js reads; a Korean password works; links and form fields survive. They unlock files encrypted by this tool and by pypdf, an independent Python library (RC4-128), check that a wrong password is refused, that restrictions are kept, and that no trace of the old encryption is left. The real IRS Form W-9, a Korean government form made in Hancom Office (saved as PDF/A) and a library’s teaching PDF were each protected and unlocked again, with every page’s text and every form field the same as before.
Sources
- pdf-lib (the @cantoo/pdf-lib fork), which encrypts and decrypts the file
- ISO 32000-2 (PDF 2.0), the standard that defines AES-256 encryption for PDF
Frequently asked questions
- How strong is the protection?
- The file is encrypted with AES-256, the method the current PDF standard recommends, and nothing in it can be read without the password. The weak point is the password itself: a short one can be found by a computer trying many in a row, so use a long one, such as three unrelated words.
- Can you remove a password I don't know?
- No. Removing a password here needs that password; nothing is guessed or worked around. If you have forgotten it, there is no way to recover it, here or anywhere else.
- Do print and copy restrictions really stop people?
- They are a request that PDF viewers are expected to follow. Adobe Acrobat and many other viewers follow them, but some programs ignore them. What actually keeps the content private is the password needed to open the file.
- Why does removing the password keep the restrictions?
- Restrictions are set by the file's owner with a second password. Taking off the password needed to open the file is a convenience for you, but lifting the owner's restrictions is their decision, so they are written back as they were.
- Are my file and password uploaded?
- No. The PDF is read, encrypted or decrypted, and saved in this tab with pdf-lib. The password is not stored or sent anywhere.
- Will it open PDFs locked by other programs?
- Yes, as long as you have the password. Files using the newer AES encryption and the older RC4 kind that older programs write are both tested.
Related tools
Guides
Version history
- 1.0.0 — First release.