PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________

Okay.

After reading the archives and pulling my hair out ... I've gotten pretty
close to creating Rev 2 encryption.  I can correctly set my Owner Password
and my User (Master) Password when both are blank.  Now I have an issue when
I set the Owner Password to non-blank.  I'm correctly setting the /O entry
but my /U entry is not the valid (I'm validating against a PDF file that
I've created).

Anyway, assume I enter an Owner Password of "123".  I correctly generate a
/O entry of:  90 AB 35 4E 56 C3 08 9F 68 25 18 17 86 72 2F 94 7F 3F C7 A8 CF
B6 0B 3A 47 62 E6 33 53 64 44 4C

I leave my User Password as blank so I'll get a padded string of:

28 BF 4E 5E 4E 75 8A 41 64 00 4E 56 FF FA 01 08
2E 2E 00 B6 D0 68 3E 80 2F 0C A9 FE 64 53 69 7A

My /P is set as -4 so I get "FC FF FF FF" for this entry.

My /ID File Identifier is:

b5 68 ce 50 66 f2 15 3d 45 ec 28 0a bb 41 be e5

I combine them as:

User + Owner + P + ID and pass this string to my md5 hash.
I take the first five bytes of my returned hash value and store it into
md5-hash-key.
Then I run my arc4 (User, md5-hash-key)

Does this look right?  Because every time I run it with an Owner password I
always get an incorrect /U value generated.

TIA,
Gordon




To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html

Reply via email to