Hi all, The following few lines are some thoughts about encryption in PDF. The PDF spec for reference is vers. 1.4. The encryption is described in detail in section 3.4 of spec. Not all the PDF file is encrypted: strings and streams composing the document are encrypted, the rest of the file () is in clear (not encrypted).
The objects must be encrypted after the filters are applied, and decrypted before the filters are applied. The encryption catalog defines the 'security handler' used to perform the encryption task. The spec defines a Standard security handler that is a build-in handler. The standard security handler uses the MD5 message-digest algorithm to form the encryption key and the RC4 algorithm to encrypt the data. It uses what is called in spec algorithm 3.2 to compute the encryption key and algorithm 3.1 to encrypt/decrypt data. The building blocks needed to implement standard handler encryption are already there in OOo source tree ( sal/rlt ): - rtl_digest_MD5 to compute the encryption key; - rtl_cipher_ARCFOUR to crypt the string or stream. Of course there are a lot of implementation details I still haven't worked out, but these lines are only a start, so any comment, addition to these will be appreciated. Thanks. -- Regards, beppec56 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
