Try to fix V3 PDF files

This commit is contained in:
NoDRM
2022-03-18 17:26:17 +01:00
parent 93ff0aac20
commit 227bda1ea6
2 changed files with 2 additions and 1 deletions

View File

@@ -1720,7 +1720,7 @@ class PDFDocument(object):
objid = struct.pack('<L', objid ^ 0x3569ac)
genno = struct.pack('<L', genno ^ 0xca96)
key = self.decrypt_key
key += objid[0] + genno[0] + objid[1] + genno[1] + objid[2] + b'sAlT'
key += bytes([objid[0], genno[0], objid[1], genno[1], objid[2]]) + b'sAlT'
hash = hashlib.md5(key)
key = hash.digest()[:min(len(self.decrypt_key) + 5, 16)]
return key