Recently, I'v got a PDF file from my friend, I opened it up with my Adobe Reader X, and I see a SECURED note on the title bar. I find the properties of this file, it says that the security method of this file is "Password Security" and the PDF version is 1.7 level 8. I can't edit it without knowing the password to this file.
Since the reader X opened the file without asking me a password, the content should not be encrypted, the reader X is just following a protocol which tell it not allow people to edit the file. So if someone write a program that did not follow the protocol, the password will be useless. Then I was confused about this problem, is it possible to write that program? If not, I must be wrong and the content of the pdf must be encrypted.
But another problem is: How do Adobe Reader get the content without knowing the password?
Thanks a lot.
PS: I found some PDF password remove program, and try them on this PDF file, none of them works, and that is why I put the version of the file format in the question. Plus, I can open this file with only Adobe Reader X and later. So I think Adobe has change the encrypt algorithm.
As you correctly pointed out, the document is not effectively encrypted - it's kind of a DRM, i.e. it is obfuscated/encrypted with a known key and they hope that every software able to read it will apply the restrictions. (Likely applying an army of lawyers to software that doesn't.)
That said, the iTextPDF library (download here) has a
public static boolean
calledunethicalreading
with the documentation stating "The iText developers are not responsible if you decide to change the value of this static parameter."I'm not sure if iTextPDF supports PDF 1.7 (that's the reason your password removal programs don't work - they only support older formats), but if it does, the following software will parse an unprotected PDF file or one for which you provide a password, and write a new one. I am not responsible if you decide to change a certain assignment of a certain parameter in the first line of the
main()
method...You will need to download both iText and the "extra jars" and put them somewhere on your classpath.