I am writing a Python program to decrypt a MS Office encrypted document. Referencing This GitHub Repo for reference.
Now what I want to do is try bunch of commonly used passwords against the document. Sort of a brute force approach. But the issue is when I feed in the password, I don't have any way to know if the decrypted content is garbage meaning that the password was wrong or the decrypted content is the right original content meaning that the password was right.
I know that inside the document structure, this information is usually embedded inside EncryptionInfo
. But I don't understand how do I verify either the password I'm using is correct or the content it is decrypting is correct.
I've tried checking a lot of online sources and one that could help is This YouTube Video and May be this code (I don't think so though) but I am not able to realize this all into a python code because I don't understand all the operations suggested in it properly.
EncryptionInfo
file. I'll post what I have in a while.