TekH 7b9318e75c fix: replace ASCII-based DetectEncryption with byte-level trailer scan
Old implementation used Encoding.ASCII.GetString() which:
- Corrupts binary PDF bytes 0x80-0xFF -> '?' (false negatives)
- Matches '/Encrypt' anywhere in document content (false positives)
- Matches '/Encrypted', '/EncryptionKey' etc. (token boundary not checked)

New implementation uses ReadOnlySpan<byte> with three strategies:
1. Search last 2KB (trailer region) - fast path, covers standard PDFs
2. Search first 2KB (linearized PDFs have duplicate trailer at start)
3. Full-file fallback for PDF 1.5+ compressed xref streams, with token
   boundary check (next byte must be space/newline/tab/'<'/'/'/'[')
   to avoid matching '/Encrypted' or '/EncryptionKey'

Also: DevExpressPdfProcessor.ValidateAsync now returns PdfValidationResult
directly (no more PdfMetadata wrapper), includes IsEncrypted field.
2026-08-28 11:45:43 +02:00
2026-07-09 12:53:49 +02:00
2026-06-12 13:38:44 +02:00
Description
No description provided
4.1 MiB
Languages
C# 100%