> I dont fully understand. What is the difference between a "crypt > filter dictionary" and a "filter dictionary"?
Not to step on the OP, but my take on this: Your opinion and experience are always quite welcome, Ralph :) A standard stream can have a filter chain on it, and one of the filters in the chain can be a 'Crypt' filter. That's what was meant by a "filter dictionary" I think. So crypt filters are just regular filters.. To actually know what algorithm to use in a particular 'Crypt' filter instance, you look at the corresponding DecodeParms entry. This is a dictionary, if present, with Type CryptFilterDecodeParms and a Name key. The value of that Name key indexes the CF dictionary in the global Encryption Dictionary. The values in the CF dictionary are "crypt filter dictionaries" which define the actual cipher, key length, authorization triggers and so on. ..that get some parameters from those "crypt filter dictionaries". Ok, so I think we can implement those crypt filters as regular stm filters. A question that remains is that we will also need to encrypt text strings using those algorightms. The stream interface would be quite inefficient for that application. David, maybe would be a good idea to create a new module 'pdf-crypt' in the base layer containing functions to: - de/encrypt pdf_text_t values. - de/encrypt memory regions (buffers). This interface would be used in the implementation of the crypt stm filters. The pdf-crypt module would centralise the use of libgcrypt and would also contain the MD5, etc functions. What do you think?
