How to Password Protect a PDF
3 methods — Papiral, Python, and Adobe Acrobat
Password-protecting a PDF prevents unauthorised access — essential before emailing sensitive contracts, financial reports, or confidential records. Here are three ways to add password protection to a PDF, from a one-click browser tool to a Python script for batch processing.
Method 1: Using Papiral (fastest, no software, batch support)
Add password protection to one or many PDFs in seconds — no Acrobat required.
- 1Go to the Password Protect PDF tool on Papiral.
- 2Upload your PDF or a ZIP of multiple PDFs.
- 3Enter the password you want to apply. All files in the batch will use the same password.
- 4Click Process and download your password-protected PDFs.
Use a strong, unique password and store it securely — Papiral does not store or recover passwords. If you lose the password, the PDF cannot be opened.
Method 2: Python with pikepdf
For developers who need to apply different passwords per file or automate protection across a pipeline.
- 1Install pikepdf: pip install pikepdf
- 2Use the script below to encrypt a PDF with a user password (required to open) and owner password (required to edit or print).
python
import pikepdf
with pikepdf.open("input.pdf") as pdf:
pdf.save(
"protected.pdf",
encryption=pikepdf.Encryption(
user="open-password", # required to open
owner="owner-password", # required to change restrictions
R=6, # AES-256 encryption
)
)
print("PDF protected successfully.")Set R=6 for AES-256 (strongest). The user password is what recipients need to open the file. The owner password controls edit/print permissions and can be different.
Method 3: Adobe Acrobat
- 1Open your PDF in Adobe Acrobat Pro.
- 2Go to File > Properties > Security tab.
- 3In the Security Method dropdown, choose Password Security.
- 4Check 'Require a password to open the document' and enter your password.
- 5Click OK, confirm the password, and save the document.
Acrobat offers granular permission controls — you can allow printing but not editing, or allow reading but not copying. For simple open-to-read protection, Papiral is much faster.
Frequently asked questions
What type of encryption does Papiral use?
Papiral uses RC4 128-bit encryption, which is broadly compatible with all PDF viewers. For AES-256 encryption (stronger but requires Acrobat 9+), use the Python pikepdf approach above.
Can a password-protected PDF be cracked?
A strong, random password is very difficult to brute-force. Weak or common passwords can be broken with dictionary attacks. Always use a password of at least 12 characters with mixed case, numbers, and symbols.
What's the difference between a user password and an owner password?
A user password (also called the open password) is required to open the PDF at all. An owner password controls permissions — printing, editing, copying. A PDF can have one or both. Papiral applies a user password so the PDF requires the password to open.
Can I remove the password later?
Yes — use Papiral's Unlock PDF tool. Provide the password and Papiral will remove the encryption, giving you an unrestricted PDF.
Ready to try the fastest method?
Add password protection to your PDF files. Recipients must enter the password to open the document.
Protect PDF — free
Papiral
Tabular