pub enum Cipher {
None,
Rc4,
Aes128,
Aes256,
}Expand description
The cipher a crypt filter selects (Table 25’s /CFM).
Variants§
None
/None — the security handler decrypts privately. pdfcer cannot know
how, so a document that routes real content through it is refused
upstream; Identity-like passthrough is the only safe reading.
Rc4
/V2 — RC4 with the file key length. Implemented.
Aes128
/AESV2 — AES-128 in CBC mode, IV prefixed to the data. Implemented
(increment 2). Keyed by Algorithm 1 with the sAlT suffix, T1.
Aes256
/AESV3 — AES-256 in CBC mode. Implemented (increment 3) at
/R 5 only.
The cipher is reached through Algorithm 3.1a, whose entire content is
“use the 32-byte file encryption key directly” — there is no per-object
derivation to select here (T24), which is why
FileKey::object_key short-circuits on /V ≥ 5 before it looks at
the cipher at all.
/R 6 also selects /AESV3 and reaches the same cipher — it shares
this whole path with /R 5, differing only in the hash (r5::Hasher,
Algorithm 2.B for Pass 5.4), never in the cipher.