Guide
How to password-protect a PDF
Lock a PDF so it needs a password to open, and decide whether readers can print, copy, or edit it, with real AES-256 encryption. Or take a password back off a file you own. Here is how.
Real encryption, applied last
pdfblah encrypts with AES-256, the same standard Acrobat uses. A password is not a watermark or a flag a viewer can ignore: the file's contents are genuinely scrambled until the password is entered. If you stack it with other changes, the password step always runs last, so it wraps everything else.
Lock a PDF online
- Open pdfblah.com and drop in your PDF.
- Add a change → Password-protect. Type the password readers will need to open it.
- Choose permissions. You can allow or block printing, copying text, and editing, independently of the open password.
- Download. The file is now encrypted.
Remove a password
If you know the current password, you can strip the encryption to get a clean copy, from the command line:
pdfblah unlock locked.pdf open.pdf --password "the current password"
pdfblah will not open a PDF you do not have the password for. This is a tool for locking and unlocking your own files, not for breaking into others.
Three ways to do it
Same engine every way, so the result is identical. Pick whichever fits:
- Online at pdfblah.com — nothing to install, free while we're testing.
- On your machine, free and private (nothing is uploaded):
pip install pdfblah, thenpdfblah guiopens the same tool in your browser. - Command line, for scripts and bulk jobs:
pip install pdfblah
# require a password to open, and block copying
pdfblah protect in.pdf locked.pdf --password "s3cret" --no-copy
# allow opening freely but block editing and printing
pdfblah protect in.pdf locked.pdf --owner "admin" --no-modify --no-print
# remove a known password
pdfblah unlock locked.pdf open.pdf --password "s3cret"
The app and CLI are open source (MIT). See the pdfblah project on GitHub.