skillfed

msoffcrypto-tool

Python tool and library for decrypting and encrypting MS Office files using a password or other keys

msoffcrypto-tool v6.0.0 12.4M downloads/30d#1,322 on PyPI619
Permissive license MIT AGING released

What it is and what it does

msoffcrypto-tool is a Python library and command-line tool for working with password-protected and encrypted Microsoft Office documents. It handles both modern OOXML formats (Word 2007+, Excel 2007+, PowerPoint 2007+) and legacy binary formats (Word 97–2003, Excel 97–2003, PowerPoint 2002–2003), supporting ECMA-376 Agile and Standard encryption, RC4 CryptoAPI, and XOR obfuscation schemes. The tool can verify passwords before decryption on supported formats and supports multiple key types: passwords, intermediate keys, and private keys for escrow certificates.

You can use it as a standalone CLI tool to decrypt files with a password prompt or command-line argument, test whether a file is encrypted, or encrypt plain OOXML documents. As a library, it provides fine-grained control over key loading, in-memory decryption, and optional integrity verification. The package depends on cryptography for cryptographic operations and olefile for parsing Office binary containers.

Use it for:

  • Decrypt password-protected Word, Excel, or PowerPoint files in batch workflows or automation scripts.
  • Analyze encrypted malicious Office documents (maldocs) in security research or incident response.
  • Extract data from encrypted spreadsheets into memory for processing with pandas or other data tools.
  • Verify password correctness before decryption on ECMA-376 Agile/Standard encrypted files.
  • Programmatically encrypt plain OOXML documents with passwords for secure distribution.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Decrypts and encrypts Microsoft Office files (Word, Excel, PowerPoint) protected with passwords or cryptographic keys, supporting both modern OOXML and legacy binary formats.

Yes, if you need to decrypt or encrypt Microsoft Office files. The package is permissively licensed, has low install friction, and covers a wide range of encryption schemes. However, maintenance is aging (last release 214 days ago), and the encryption feature is experimental—use decryption for production workflows but treat encryption as beta. No known security vulnerabilities.

Install

msoffcrypto-tool on PyPI

pip

pip install msoffcrypto-tool

uv

uv add msoffcrypto-tool

poetry

poetry add msoffcrypto-tool

Installing msoffcrypto-tool

Before you install

Low friction install with only two runtime dependencies (cryptography and olefile). Maintenance status is aging—last release was 214 days ago—but the repository remains active and not archived, with a modest user base of 619 stars.

License in practice

MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you retain the license notice.

Quickstart

pip install msoffcrypto-tool

import msoffcrypto

encrypted = open("encrypted.docx", "rb")
file = msoffcrypto.OfficeFile(encrypted)
file.load_key(password="Passw0rd")
with open("decrypted.docx", "wb") as f:
    file.decrypt(f)
encrypted.close()

Requires Python 3.10 or later (supports up to 3.14); encryption feature is marked experimental.

Verify before relying

  • Whether the experimental encryption feature is production-ready or suitable only for non-critical workflows.
  • Performance characteristics when handling large Office files or batch decryption scenarios.
  • Compatibility with Office files encrypted using non-standard or proprietary key derivation methods.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — cryptography, olefile
Maintenance aging — 214 days since the last release
Last repo commit
First released
Downloads 12,374,350/month — #1,322 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: msoffcrypto_tool-6.0.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

decrypt password protected office filesms office encryption decryptionword excel powerpoint password removaloffice file cryptography toolooxml binary document decryption
office-automationcryptographycli-tool

More Cryptography packages