Encryption
PDF Encryption
Password-based or certificate-based protection that restricts access to PDF content.
Technical Detail
Encryption in PDF operates at two levels: a user password (required to open the document) and an owner password (required to change permissions like printing or editing). Modern PDF encryption uses AES-256, replacing the older RC4 algorithm that was vulnerable to known-plaintext attacks. The encryption applies to the document's stream data and strings, while the file structure itself remains readable by PDF parsers for metadata extraction.
Example
```javascript
// PDF encryption settings
const encryptedPdf = await PDFDocument.create();
await encryptedPdf.encrypt({
userPassword: 'view-password', // required to open
ownerPassword: 'admin-password', // required to edit
permissions: {
printing: 'lowResolution',
modifying: false,
copying: false,
}
});
```
Related Formats
Related Tools
M
Merge PDF
S
Split PDF
C
Compress PDF
R
Rotate PDF
A
Add Page Numbers
P
PDF to JPG
W
Watermark PDF
R
Reorder PDF Pages
F
Flatten PDF
E
Edit PDF Metadata
S
Sign PDF
J
JPG to PDF
E
Extract Text from PDF
D
Delete PDF Pages
R
Reverse PDF
E
Extract PDF Pages
E
Extract Odd/Even Pages
R
Resize PDF Pages
C
Crop PDF
I
Insert Blank Pages
D
Duplicate PDF Pages
P
PDF to PNG
A
Add Header & Footer
A
Add Text to PDF
A
Add Image to PDF