views:

339

answers:

0

I want to open encrypted OOXML files, which are stored as streams inside a compound OLE file. Microsoft has an API for OOXML, (OOXML Format SDK 2.0, but it seems to lack a way to manipulate encrypted OOXML documents. So, this breaks into two questions.

  • How do you open compound OLE documents in C#? I found this very similar question, (reading compound documents in C#), but I was hoping that there might be a cleaner and more generic way of doing it that I missed.

  • Is there a high-level way to decrypt the EncryptedPackage stream within the OLE document? The two best references I've found are Decrypting Office Documents and MS-OFFCRYPTO Examples. "Decrypting Office Documents" seems to decrypt successfully, but it relies on an external DLL (Lyquidity.OleStorage.dll) to open the OLE document and did not work for me. "MS-OFFCRYPTO Examples" has an example in C# to decrypt the stream but uses a C++ example to get the stream. Both these references look like they work, but is there a higher level API that does the same thing?