pdfk-0.1.0 is not a library.
pdfk - PDF Kit
A Modern PDF CLI tool. Fast, offline, secure.
Install
From source
Homebrew (coming soon)
Usage
Lock — Encrypt a PDF
This creates document_locked.pdf with AES-256 encryption.
Options:
# Write to a specific file
# Modify in place
# Set separate user and owner passwords
# Restrict permissions
# Read password from stdin (avoids shell history)
|
Unlock — Decrypt a PDF
Creates encrypted_unlocked.pdf with encryption removed.
# Write to a specific file
# Modify in place
# Password from stdin
|
Change Password
# Passwords from stdin (one per line: old, then new)
|
Check — Verify a Password
Exits with code 0 if the password is correct, non-zero otherwise. Useful in scripts:
if ; then
fi
Password Types
PDF supports two password types:
- User password — required to open and view the document
- Owner password — controls what actions are allowed (print, copy, edit)
Use --password to set both to the same value, or set them independently:
Secure Password Input
Avoid exposing passwords in shell history:
# Pipe from stdin
|
# Pipe from a password manager
|
Encryption
pdfk uses AES-256 (Revision 6) encryption by default — the strongest encryption defined in the PDF 2.0 specification.
Decryption supports:
- AES-256 R6 (PDF 2.0)
- AES-256 R5 (Adobe Extension Level 3)
Legacy encryption formats (RC4, AES-128) are planned for future versions.