tags:

views:

45

answers:

1

Help!

I have a password protected Excel 2007 file and I lost the password. Any code in .NET to open such a file?

Basically, I would need just a snapshot of the contents of the file.

Thanks.

+2  A: 

The only way in .Net I can think of would be to automate Excel and keep trying to enter different passwords, but it might be better to try to get hold of some app that might do that for you a bit more efficiently. This is assuming that you've used some simple word as the password, as far as I know there's no shortcuts so it'll have to do a dictionary attack, so if you've used a difficult password it might take a very long time to find otherwise.

ho1
Office 2007 uses [AES128](http://arstechnica.com/microsoft/news/2007/05/microsoft-security-was-priority-for-office-2007.ars) for its default protection scheme, so a dictionary attack is the only option. In addition, there is no chance for a partial decryption to recover a 'snapshot' of the file.
ladenedge