-
Notifications
You must be signed in to change notification settings - Fork 1.6k
PyCryptoDome padding issue, AES encryption CBC mode #1221
Copy link
Copy link
Closed
Labels
PdfReaderThe PdfReader component is affectedThe PdfReader component is affectedis-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFworkflow-encryptionFrom a users perspective, encryption is the affected feature/workflowFrom a users perspective, encryption is the affected feature/workflow
Metadata
Metadata
Assignees
Labels
PdfReaderThe PdfReader component is affectedThe PdfReader component is affectedis-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFworkflow-encryptionFrom a users perspective, encryption is the affected feature/workflowFrom a users perspective, encryption is the affected feature/workflow
This is not a fully qualified bug report, because I lack a reproducible example for a number of reasons. However, I originally posted in issue 416 about how I was experiencing decryption issue with a file generated by the Acrobat Sign product. It is a v1.7 PDF, with AES 128-bit encryption. That issue notes a merged fix (#1015).
I downloaded PyPDF2 2.10.0, which then gave a new error about missing PyCryptoDome, which I then installed (v3.15.0). Running my test case again, I received the following error:
I know little about PDF specs, and even less about encryption, however using the PyCryptoDome docs I did find that the following code addition to
_encryption.pyalleviated this issue for my file:Again, lacking a reproducible test case I'm not sure how useful this is but wanted to share my findings in case someone with access to Acrobat Sign can generate a file that demonstrates the same behavior.