Skip to main content

Python tool and library for decrypting encrypted MS Office files with a password

Project description


msoffice_decrypt is a Python tool and library for decrypting encrypted
MS Office files with a password. This work is based on I created this project to
solves a specific use case for myself.


Stable release


pip3 install -U msoffice_decrypt

From GitHub


pip3 install -U git+


(command line) Decrypt a file with a password.


msoffice_decrypt -p 7779 Scan_ciwilson.doc Scan_ciwilson_unencrypted.doc


decrypted Scan_ciwilson.doc into Scan_ciwilson_unencrypted.doc

(command line) Decrypt a file trying everything that might be a password in this other file.


msoffice_decrypt -i sample.txt Scan_ciwilson.doc Scan_ciwilson_unencrypted.doc


found password: 7779
decrypted Scan_ciwilson.doc into Scan_ciwilson_unencrypted.doc


.. code:: python

from msoffice_decrypt import MSOfficeDecryptor
decryptor = MSOfficeDecryptor(input_file_path, output_file_path)
if decryptor.is_decryptable:
# generate a list of passwords that might be right
# here we assume sample.txt is a text file that contains the password somewhere
with open('sample.txt', 'r') as fp:
word_list = decryptor.find_password(fp)

# see if any of these passwords are correct
password = decryptor.guess(word_list)

if password:

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
msoffice_decrypt-1.0.0-py3.6.egg (15.4 kB) Copy SHA256 hash SHA256 Egg 3.6
msoffice_decrypt-1.0.0-py3-none-any.whl (10.3 kB) Copy SHA256 hash SHA256 Wheel py3
msoffice_decrypt-1.0.0.tar.gz (10.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page