Protect a PDF with a Password
Encrypt a PDF with a document-open password inside your browser via @cantoo/pdf-lib—relying on legacy RC4 PDF security dictionaries with zero server storage or password recovery.
What Does Protect PDF Do?
Lock PDF files behind a document password offline, with honest cryptographic scope notes.
Before emailing tax returns, payroll spreadsheets, or signed leases, adding a document open password keeps casual forwarders out. Drop your unencrypted .pdf, enter and confirm your passphrase, and generate a password-locked download inside local browser memory.
Calls @cantoo/pdf-lib's doc.encrypt() setting both user and derived owner keys per classic ISO 32000-1 PDF security handlers. Important security caveat: @cantoo/pdf-lib relies on legacy RC4 PDF encryption rather than NIST-recommended AES-256 (ISO 32000-2)—so for top-secret compliance workflows requiring AES-256, pair PDF export with an encrypted ZIP or desktop Acrobat/qpdf.
Sources checked November 15, 2026
Why Lock PDFs Inside Your Browser?
Add casual access gates to drafts and tax attachments without leaking passwords or raw files over HTTP.
Local Key Handling
Passwords stay strictly in browser JavaScript state—never logged, stored, or emailed to a server.
Mismatch Confirmation Guard
Checks Password against Confirm Password before saving so typos won't lock you out.
Standard Viewer Support
Encrypted files prompt for your password in Chrome, Apple Preview, Edge, and Adobe Acrobat.
How to Password-Protect a PDF
Upload an open PDF, enter matching passwords, and download the protected copy.
- 1Click Choose a PDF File or drop an unencrypted
.pdfdocument into the box. - 2Enter a strong password under Set New Encryption Password and repeat it in Confirm Password.
- 3Click Process and Download to save
-protected.pdflocally. - 4Open the downloaded PDF in your viewer and test your password before deleting any backup.
Worked Examples
Concrete input-to-output scenarios computed directly from this tool.
Locking an Employment Offer Before Emailing
Require a shared passphrase before an attachment can be opened out of an email thread.
offer-letter.pdf + strong 14-char passphrase
offer-letter-protected.pdf prompting for password on open
Common Mistakes & Best Practices
Frequent configuration traps and edge-case pitfalls to avoid.
- Assuming browser encryption equals modern AES-256 compliance:
@cantoo/pdf-libwrites legacy PDF RC4 security handlers; use desktop AES-256 tools for regulated secrets. - Sharing the PDF and its password inside the exact same email: send the password separately via SMS or encrypted chat.
Capabilities & Browser Constraints
Exact supported formats, what the browser engine handles locally, and known limitations.
Format Support & Honest Limitations
- Applies a user password prompt via
@cantoo/pdf-libdoc.encrypt()so viewers require your password to open - Confirms matching password entry before encrypting locally
- Keeps document pages and vector text visually unaltered
- Does NOT use modern AES-256 PDF 2.0 encryption (browser library uses standard RC4 PDF encryption)
- Cannot recover or reset forgotten passwords—store your passphrase separately
- Does not support multi-recipient permissions granularity; memory depends on browser RAM
Local Browser Processing Guarantee
Parsing, rendering, and assembly run inside your browser's local memory. Your PDF buffers, passwords, and file names stay on your device without server uploads; large-file capacity depends on your browser's available RAM.
Frequently Asked Questions
Common questions and technical details about browser execution, privacy, and limits.
Does Protect PDF use AES-256 encryption?
No—our client-side @cantoo/pdf-lib engine implements classic PDF RC4 encryption rather than AES-256. For regulated high-sensitivity archiving, use desktop qpdf or Adobe Acrobat AES-256.
Can I recover my PDF if I forget the password?
No. FormatFlow neither transmits nor stores passwords; if you lose the passphrase, you must rely on your original unencrypted file.
Can I use Protect PDF on a file that already has a password?
Unlock the file first with Unlock PDF using its existing password before applying a new password.
Will Apple Preview, Chrome, and Acrobat open the locked PDF?
Yes—all standard desktop and mobile PDF viewers recognize classic user-password prompts.
How strong should my PDF password be?
Use a unique 14+ character random string or 4+ word passphrase generated with our Passphrase Generator—avoid single dictionary words.
Is there a file size limit for browser encryption?
No server limit applies; total file size depends on your device browser's available RAM.
More Tools on FormatFlow
Browser-based utilities across text, JSON, CSV, encoding, and security.
JSON Formatter & Beautifier
Indent, syntax-check, or minify JSON payloads right inside your browser.
CSV Cleaner
Fix messy CSV files by trimming spaces, blank rows, and header names.
Random Password Generator
Generate random 12 to 64-character passwords and batches in your browser.
Word Counter
Check word counts, reading time, speaking time, and top keyword frequency.
Base64 Decoder
Decode standard or URL-safe Base64 strings back into UTF-8 text.
Markdown Editor Online
Write GitHub Flavored Markdown with live split-pane preview and HTML export.