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

Hi,

Okay.   I'm at the point where I'm generating a valid User and Owner entries
in my encryption dictionary.  These have been verified against my test
document.  Now I need to determine the Encryption Key for my data stream.

Could someone please verify the steps that I'm taking to try and encrypt my
text stream.

Taking the info from PDF Spec 1.4 and Algorithm 3.1, I need to:
1. Determine my object and Gen numbers (eg: object = 20 and gen =0)
2. Take my original Encryption Key (which was previously determined in
Algorithm 3.2) and append low-order the low order bytes of my object and Gen
numbers.  Assuming my Original Encryption key is "8d 46 6d 60 c5", I now
append the combo of Object + Gen which is "30 32 30 30 30".
3. Run the MD5 hash with this 10-byte key, which is now "8d 46 6d 60 c5 30
32 30 30 30".  From the MD5 hash I get a 16 Byte value of:
  46 fc b8 80 ca b5 9e 15 c9 cf 78 e3 6f 83 67 0c
4. I take the first 10-bytes of the 16 Byte value (46 fc b8 80 ca b5 9e 15
c9 cf ) and use this plus my text  as the input to my RC4.
  example call: run rc4 ("Hello World",<16-bytes>)
  I use the output of this call as my text stream.


TIA,
Gordon



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

Reply via email to