Encryption
The trailer's /Encrypt dictionary turns encryption on. Strings and streams are encrypted; the structure (dictionaries, names, numbers) stays in the clear. Each object gets its own key, derived from the file key plus its object and generation numbers.
trailer
<< /Size 42 /Root 1 0 R /ID [<…> <…>]
/Encrypt << /Filter /Standard /V 2 /R 3 /Length 128
/O <…32 bytes…> /U <…32 bytes…> /P -3904 >> >>| /V | /R | Algorithm | Version |
|---|---|---|---|
| 1 | 2 | RC4, 40-bit | 1.1+ |
| 2 | 3 | RC4, 40–128-bit (/Length) | |
| 4 | 4 | Crypt filters: RC4 (/V2) or AES-128 (/AESV2, 1.6) | 1.5 / 1.6, the ISO 32000-1 maximum |
| 5 | 5, 6 | AES-256 (/AESV3) | Adobe extensions to 1.7; R6 standardized in 2.0 |
User password opens the document. Owner password unlocks full rights. /P is a bit field of permissions (print, modify, copy, annotate, fill forms, extract for accessibility, assemble, high-quality print). These are advisory: anyone who can open the file can decrypt it, and honoring /P is up to the reader.
The trailer /ID (two byte strings) feeds the key derivation, which is why it must exist in encrypted files. 1.4 §9.3, 1.7 §14.4
Read:
Digital signatures
A signature is a form field (/FT /Sig) whose value is a signature dictionary. /ByteRange lists the signed spans, which is the whole file except the hex /Contents hole holding the PKCS#7/CMS blob.
<< /Type /Sig /Filter /Adobe.PPKLite /SubFilter /adbe.pkcs7.detached /ByteRange [0 840 960 240] % sign bytes 0–839 and 960–1199 /Contents <3082…000000> % fills bytes 840–959, zero-padded /M (D:20081103120000Z) >>
- Later changes must be incremental updates, or they invalidate the signature.
- SubFilters in 1.7:
adbe.pkcs7.detached,adbe.pkcs7.sha1,adbe.x509.rsa_sha1. - Signatures date from 1.3. Certification signatures (DocMDP, 1.5) and field locking (FieldMDP) control which later changes are allowed; usage-rights signatures (1.5) move to the
/UR3entry in 1.6.
Read: