Quote:
Originally Posted by joblack
Might be a new problem - without further investigation it isn't possible to tell more.
|
I've done some more poking about, and in these cases the bookkey recovered in PDFDocument.initialize_ebx() is 16 bytes long, but only the first 8 bytes actually have values, the last 8 bytes are all null. So the length is arguably the 64 bits specified.
However for the decryption to actually work those 8 null bytes have to be present (I tested that by slicing bookkey to make it the specified 64 bits, it resulted in a pdf that came up blank except for some boxes, whereas it decrypted okay with the full bookkey including the nulls), so at least for these pdfs raising of an error when len(bookkey) != length, seems to be the wrong thing to do.