title: Read/write Excel 2007 password-protected documents
body: <p>What method does Office 2007 use for encryption (when choosing Encrypt and setting a password from Office menu)?</p>
  
  <p>My C# app needs to create and read encrypted Excel 2007 files (.xlsx). It is important that these files remain accessible from Excel, so I must use Microsoft's encryption method, can't brew my own.</p>
  
  <p>Normal Excel 2007 file is a ZIP-compressed file, and I'm accessing it using <a href="http://excelpackage.codeplex.com" rel="nofollow noreferrer">ExcelPackage</a>, which internally uses * System.Io.Packaging.Package* (part of .net 3.0).</p>
  
  <p>However, the encryption in Office is <strong>not</strong> the standard ZIP encryption. The Package class seems not to support encryption, and reports a corrupted file. 7Zip opens the file (with no password provided) and shows a few binary files inside. </p>