Posted on 2008-10-24 23:41:04-07 by joe312213 in response to 9120
Re: 128 bit pdf encryption (and password bug)
Hi,

I've been busy trying to fix it myself. Made some progress. Fixed the 40bit implementation for a start, so now user and owner passwords can be different! (meaning you can actually make use of the user permissions now), I've also managed to get 128bit encryption being written and reread by the library (I can extract text from pages faithfully), but so far Adobe Reader accepts the passwords but displays a blank page... I'm close!

Basically how I tackled it was to go back to the pdf spec and implement each algorithm 3.1 - 3.7 as the spec describes it. One thing I noticed was you don't implement step 4 or 3.5 in your code (you do the xor on the key for all 20 RC4 calls). I was doing this, but Reader wouldn't accept the passwords. I swapped back in your _compute_u sub and it accepted the passwords (but displayed a blank page..). I'll send you my code.
Direct Responses: 11183 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.