View Single Post
Old 07-12-2010, 04:20 PM   #5
Jim Lester
Evangelist
Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.Jim Lester is less competitive than you.
 
Jim Lester's Avatar
 
Posts: 416
Karma: 14682
Join Date: May 2008
Location: SF Bay Area
Device: Nook HD, Nook for Windows 8
Quote:
Originally Posted by CeramicWeasel View Post
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).
Jim Lester is offline   Reply With Quote