michaelrsweet/pdfio

Unable to read files password-protected by Adobe Protect PDF online tool

Closed this issue · 4 comments

Apparently PDFio cannot open PDF files that were password-protected via this online tool by Adobe. The encryption label is PDFIO_ENCRYPTION_AES_128. In fact, the files are properly decrypted but afterwards the following error messages appear:

Corrupt stream data.
Unable to decompress stream data for object 4: Data error.
Unable to find pages object.

The same unprotected files are read correctly.

I have tried this by adding a test in the test routine of the provided Visual Studio solution on Windows 11. Thank you.

P.S. The following does not have to do with this issue, but it is just a brief comment. The encryption labeled by PDFIO_ENCRYPTION_AES_256 corresponds to V6 R6. However from the PDF 2.0 specifications I understand that it should be associated with V5 R6; also I have a protected 2.0 PDF which has indeed V=5 and R=6.

Can you attach the before and after PDF files that show this? I've been separately tracking what might be the same issue (#42), but haven't figured out the proper fix yet.

Here they are:
test.pdf
test-protected.pdf
Password is "password" (without quotes).

What's interesting is that the last 16 bytes of the user password value are nul (0)... This is technically allowed (you are supposed to pad with 16 bytes of arbitrary data) but might be significant...

[master 7d22477] Fix opening of certain encrypted PDF files (Issue #62)