Quote:
Originally Posted by CeramicWeasel
Is there a way to tell if a PDF document has been given an owner password but not a user password? I don't care what the passwords are, or about the content of the PDF, but I do need to know what *type* of password protections are on it.
It seems that encrypted PDFs get both an /O and /U entry in the /Filter section regardless of the type of password in use.
|
If there is no user (/U) password the pad string is used in it's entirety. So if you generate the /U value using just the pad string (see algorithms 3.2 and 3.4 in the PDF spec), and it is the same as the /U value in the encrypt dict, then there is no user password.
Note that the algorithms will be slightly different for AES256 encrypted documents (came along with Acrobat 9).