Decrypt PDF with Just The User Password #835
-
Is it possible to decrypt a PDF with just the user password and not the owner password?
var reader = new PdfReader("./Nippon.pdf" ,
pw.getBytes());
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Either password should do. If you have a PDF you have both passwords for and OpenPDF can only read it with the owner password, please share the PDF for analysis. (One aside, though: |
Beta Was this translation helpful? Give feedback.
Either password should do.
If you have a PDF you have both passwords for and OpenPDF can only read it with the owner password, please share the PDF for analysis.
(One aside, though:
pw.getBytes()
is not necessarily the correct way to get the bytes of a password. If your document uses AES256 (R=6) encryption, the specification requires "The UTF-8 password string shall be generated from Unicode input by processing the input string with the SASLprep (Internet RFC 4013) profile of stringprep (Internet RFC 3454) using the Normalize and BiDi options, and then converting to a UTF-8 representation." In complex cases this may result in something different than yourpw.getBytes()
.)