You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decrypt strings/streams on read for the Standard security handler — mirror of StandardSecurityHandler (AES-256 V5/R6; add RC4 / AES-128 V2/V4). Enables reading (and adding LTV to) encrypted signed PDFs.
The v1.6 MVP throws "unsupported yet" on /Encrypt.
Blocked on #121 — a dependency the issue text does not state.
Per-object key derivation for security handler revisions R2–R4 is MD5(fileKey ‖ objNum[0..3] ‖ gen[0..2] [‖ "sAlT" for AESV2]) — it consumes the generation number.
The reader drops generations today (PdfIndirectReference has no Generation; the xref is keyed on
object number alone), so V1/V2/V4 decryption cannot be implemented correctly until #121 lands. Sequence #121 first.
Two further notes for whoever picks this up:
Reader: hybrid /XRefStm trailer is discarded, hiding /Encrypt #183 should land first too. An /Encrypt reachable only through a hybrid /XRefStm dictionary is
currently invisible to the reader, which would become a silent decryption failure rather than a clean error.
/Crypt is not in the filter dispatch table.Filters.cs:109 throws Unknown PDF filter: /{name} for anything unmatched, so a /Crypt entry (ISO 32000-2 §7.4.10, normally /Name /Identity) surfaces as a generic InvalidDataException rather than being handled.
Two primitives have to be hand-written; both have published specs with known-answer vectors, so neither
needs any reference implementation:
RC4 — the BCL has none (its symmetric-cipher support covers AES, 3DES, DES, RC2 only). draft-kaukonen-cipher-arcfour-03
gives the full KSA + PRGA and three test vectors.
MD5 — MD5.HashData is unsupported on Browser WASM (all BCL hash classes defer to OS libraries), which
also puts Windows FIPS-policy behaviour outside our control. RFC 1321
gives the algorithm and seven test vectors. A managed implementation sidesteps both problems and is
permanently immune to CA5351 should AnalysisMode ever be raised.
Hash2B (StandardSecurityHandler.cs:128-172) and the AES helpers (:204-240) are reusable as-is for the
R6 path, and Kernel already grants InternalsVisibleTo("VellumPdf.Reader")
(src/VellumPdf.Kernel/AssemblyInfo.cs:7), so a new internal decryptor in Kernel needs no config change.
Activity
Tim81 commentedon Aug 18, 2026
Blocked on #121 — a dependency the issue text does not state.
Per-object key derivation for security handler revisions R2–R4 is
MD5(fileKey ‖ objNum[0..3] ‖ gen[0..2] [‖ "sAlT" for AESV2])— it consumes the generation number.The reader drops generations today (
PdfIndirectReferencehas noGeneration; the xref is keyed onobject number alone), so V1/V2/V4 decryption cannot be implemented correctly until #121 lands. Sequence
#121 first.
Two further notes for whoever picks this up:
/Encryptreachable only through a hybrid/XRefStmdictionary iscurrently invisible to the reader, which would become a silent decryption failure rather than a clean error.
/Cryptis not in the filter dispatch table.Filters.cs:109throwsUnknown PDF filter: /{name}for anything unmatched, so a/Cryptentry (ISO 32000-2 §7.4.10, normally/Name /Identity) surfaces as a genericInvalidDataExceptionrather than being handled.Two primitives have to be hand-written; both have published specs with known-answer vectors, so neither
needs any reference implementation:
draft-kaukonen-cipher-arcfour-03
gives the full KSA + PRGA and three test vectors.
MD5.HashDatais unsupported on Browser WASM (all BCL hash classes defer to OS libraries), whichalso puts Windows FIPS-policy behaviour outside our control. RFC 1321
gives the algorithm and seven test vectors. A managed implementation sidesteps both problems and is
permanently immune to CA5351 should
AnalysisModeever be raised.Hash2B(StandardSecurityHandler.cs:128-172) and the AES helpers (:204-240) are reusable as-is for theR6 path, and Kernel already grants
InternalsVisibleTo("VellumPdf.Reader")(
src/VellumPdf.Kernel/AssemblyInfo.cs:7), so a new internal decryptor in Kernel needs no config change.fix(reader): honour object generation numbers on resolve (#121)
fix(reader): honour object generation numbers end to end (#192)
fix(reader): detect /Encrypt in XRefStm, harden the endstream scan (#193
test(reader): check in the encrypted fixture corpus for the decrypt work
test(reader): restore a clobbered 1.4.0 entry, and close two corpus gaps
test(reader): commit the encrypted fixture corpus for the decrypt work (
feat(kernel): hand-written RC4 and MD5 for legacy decryption (#203)
1 remaining item
docs: release 2.1.0 — decryption on read, and the docs that describe …
fix(reader): honour object generation numbers end to end (#192)
fix(reader): detect /Encrypt in XRefStm, harden the endstream scan (#193
test(reader): commit the encrypted fixture corpus for the decrypt work (
feat(kernel): hand-written RC4 and MD5 for legacy decryption (#203)
feat(reader): decrypt on read — PdfReader.Open takes a password (#212)
docs: release 2.1.0 — decryption on read, and the docs that describe …
fix(reader): honour object generation numbers end to end (#192)
fix(reader): detect /Encrypt in XRefStm, harden the endstream scan (#193
test(reader): commit the encrypted fixture corpus for the decrypt work (
feat(kernel): hand-written RC4 and MD5 for legacy decryption (#203)
feat(reader): decrypt on read — PdfReader.Open takes a password (#212)
docs: release 2.1.0 — decryption on read, and the docs that describe …
fix(reader): excerpt two more sites and correct the round-1 prose
fix(reader): correct the retention reason and the excerpt helper doc