Read / write password protected Excel 2007 documents

What method does Office 2007 use for encryption (when you select Encryption and set a password from the Office menu)?

My C # application should create and read encrypted Excel 2007 (.xlsx) files. It is important that these files remain accessible from Excel, so I have to use the Microsoft encryption method, I can not brew my own.

A regular Excel 2007 file is a ZIP compressed file, and I access it using ExcelPackage , which internally uses * System.Io.Packaging.Package * (part of .net 3.0).

Office encryption, however, is not standard ZIP encryption. The Package class does not support encryption and reports a damaged file. 7Zip opens the file (without password) and shows several binaries inside.

+2
source share
3 answers

Based on a few bits and pieces of open source code, I created OoXmlCrypto stream to access Office 2007 encrypted files easily.

This is based on a blog post with source code that does OOXML encryption / decryption.

+2
source

Office 2007 OLE- ( , Office) .

[MS-OFFCRYPTO]: Office .

+3

JFYI: our SecureBlackbox product offers components for encrypting and decrypting OOXML documents, among many other features.

+1
source

All Articles