OpenPDF
OpenPDF copied to clipboard
"Unknown encryption type R = 5"
Is your feature request related to a problem? Please describe. Similar to #375, which resolved "R = 6" exceptions, I am getting "Unknown encryption type R = 5" with certain files.
Describe the solution you'd like Files with R = 5 encryption type supported.
Describe alternatives you've considered I could try PDFBox.
Your real name Brett Rowberry
Additional context Here's a file that can produce the exception r-equals-5.pdf.
MKL implemented support for R=6 some time ago (one of the best additions to openPDF imho). However R=5 is a proprietary adobe extension which has been deprecated and should not be used. (Thats why it wasn't implemented) You are of course free to implement it - perhaps mkl can give you some pointers. Maybe it is only extending R=4 with AES256?
@Lonzak already correctly explained that R=5 encryption is part of an Adobe extension to PDF that never became standard and only is mentioned as deprecated and forbidden to use in ISO 32000-2. In contrast to his assumption "Maybe it is only extending R=4 with AES256", though, the R=5 algorithm is more related to R=6 than R=4. The differences between R=5 and R=6 mostly are additional variable numbers of hashing rounds in the latter to make breaking the encryption harder for brute force and quantum approaches.
In contrast to his assumption "Maybe it is only extending R=4 with AES256", though, the R=5 algorithm is more related to R=6 than R=4.
...was just a (wild) guess ;-)
You are of course free to implement it
I'm going to keep getting PDFs with R = 5. So, either I'll have to:
- implement it as you suggest, or
- switch to PDFBox, which would be a pretty significant change to our code base.
Let's pretend that I write a perfect PR adding R = 5 support and it's merged. How long would it take to get a new version out in Maven Central?
@brettrowberry please submit that perfect PR adding R = 5 support. I am sure the new version would be available within reasonable time in Maven Central. I am also seeing this Unknown encryption type R = 5 error in production, however the percentage is not very large.
@brettrowberry any progress on this?
I am also encountering the Unknown Encryption type R=5 error. Can you fix this please? @brettrowberry
I think we can safely say I'm not going to get around to doing this. Sorry!