Skip to main content

Module security

Module security 

Source
Expand description

PDF security and encryption support

Implements PDF encryption per PDF specification:

  • RC4-128 (PDF 1.4, /V 2 /R 3)
  • AES-256 (PDF 2.0, /V 5 /R 6)

Supports owner/user passwords and permission flags (PDF spec Table 3.20).

Pure Rust implementation using aes, cbc, sha2, and md5 crates — no C FFI.

Structs§

EncryptionDict
Computed encryption dictionary and keys
PdfPermissions
PDF permission flags per PDF spec Table 3.20
PdfSecurity
PDF encryption settings

Enums§

EncryptionAlgorithm
PDF encryption algorithm

Functions§

generate_file_id
Generate a PDF file ID (two identical 16-byte MD5 hashes)