{ "info": { "author": "nolze", "author_email": "nolze@archlinux.us", "bugtrack_url": null, "classifiers": [], "description": "# msoffcrypto-tool\n\n[![PyPI version](https://badge.fury.io/py/msoffcrypto-tool.svg)](https://badge.fury.io/py/msoffcrypto-tool)\n[![PyPI downloads](https://img.shields.io/pypi/dm/msoffcrypto-tool.svg)](https://pypistats.org/packages/msoffcrypto-tool)\n[![Build Status](https://travis-ci.org/nolze/msoffcrypto-tool.svg?branch=master)](https://travis-ci.org/nolze/msoffcrypto-tool)\n[![Coverage Status](https://codecov.io/gh/nolze/msoffcrypto-tool/branch/master/graph/badge.svg)](https://codecov.io/gh/nolze/msoffcrypto-tool)\n[![Documentation Status](https://readthedocs.org/projects/msoffcrypto-tool/badge/?version=latest)](http://msoffcrypto-tool.readthedocs.io/en/latest/?badge=latest)\n\nmsoffcrypto-tool (formerly ms-offcrypto-tool) is a Python tool and library for decrypting encrypted MS Office files with password, intermediate key, or private key which generated its escrow key.\n\n## Contents\n\n* [Install](#install)\n* [Examples](#examples)\n* [Supported encryption methods](#supported-encryption-methods)\n* [Tests](#tests)\n* [Todo](#todo)\n* [References](#references)\n* [Use cases and mentions](#use-cases-and-mentions)\n* [Contributors](#contributors)\n\n## Install\n\n```\npip install msoffcrypto-tool\n```\n\n## Examples\n\n### As CLI tool (with password)\n\n```\nmsoffcrypto-tool encrypted.docx decrypted.docx -p Passw0rd\n```\n\nPassword is prompted if you omit the password argument value:\n\n```bash\n$ msoffcrypto-tool encrypted.docx decrypted.docx -p\nPassword:\n```\n\nTest if the file is encrypted or not (exit code 0 or 1 is returned):\n\n```\nmsoffcrypto-tool document.doc --test -v\n```\n\n### As library\n\nPassword and more key types are supported with library functions.\n\n```python\nimport msoffcrypto\n\nfile = msoffcrypto.OfficeFile(open(\"encrypted.docx\", \"rb\"))\n\n# Use password\nfile.load_key(password=\"Passw0rd\")\n\n# Use private key\n# file.load_key(private_key=open(\"priv.pem\", \"rb\"))\n# Use intermediate key (secretKey)\n# file.load_key(secret_key=binascii.unhexlify(\"AE8C36E68B4BB9EA46E5544A5FDB6693875B2FDE1507CBC65C8BCF99E25C2562\"))\n\nfile.decrypt(open(\"decrypted.docx\", \"wb\"))\n```\n\n## Supported encryption methods\n\n### MS-OFFCRYPTO specs\n\n* [x] ECMA-376 (Agile Encryption/Standard Encryption)\n * [x] MS-DOCX (OOXML) (Word 2007-2016)\n * [x] MS-XLSX (OOXML) (Excel 2007-2016)\n * [x] MS-PPTX (OOXML) (PowerPoint 2007-2016)\n* [x] Office Binary Document RC4 CryptoAPI\n * [x] MS-DOC (Word 2002, 2003, 2004)\n * [x] MS-XLS (Excel 2002, 2003, 2004) (experimental)\n * [x] MS-PPT (PowerPoint 2002, 2003, 2004) (partial, experimental)\n* [x] Office Binary Document RC4\n * [x] MS-DOC (Word 97, 98, 2000)\n * [x] MS-XLS (Excel 97, 98, 2000) (experimental)\n* [ ] ECMA-376 (Extensible Encryption)\n* [ ] XOR Obfuscation\n\n### Other\n\n* [ ] Word 95 Encryption (Word 95 and prior)\n* [ ] Excel 95 Encryption (Excel 95 and prior)\n* [ ] PowerPoint 95 Encryption (PowerPoint 95 and prior)\n\nPRs are welcome!\n\n## Tests\n\nTests can be run in various ways:\n\n* `python -m nose -c .noserc`\n* `nosetests -c .noserc`\n* `python -m unittest discover`\n* `python setup.py test`\n* `./tests/test_cli.sh`\n\nIf the [cryptography](https://pypi.org/project/cryptography/) package is not installed, tests are skipped. If you have dependencies installed only for a certain python version, replace \"python\" with \"pythonX.Y\" in the above commands.\n\n## Todo\n\n* [x] Add tests\n* [x] Support decryption with passwords\n* [x] Support older encryption schemes\n* [x] Add function-level tests\n* [x] Add API documents\n* [x] Publish to PyPI\n* [x] Add decryption tests for various file formats\n* [x] Integrate with more comprehensive projects handling MS Office files (such as [oletools](https://github.com/decalage2/oletools/)?) if possible\n* [x] Add the password prompt mode for CLI\n* [ ] Redesign APIs (v5.0.0)\n* [ ] Improve error types (v5.0.0)\n* [ ] Use a kind of `ctypes.Structure`\n* [ ] Support encryption\n\n## See also\n\n* \"Backdooring MS Office documents with secret master keys\" \n* Technical Documents \n * [MS-OFFCRYPTO] Agile Encryption \n* LibreOffice/core \n* LibreOffice/mso-dumper \n* wvDecrypt \n* Microsoft Office password protection - Wikipedia \n* office2john.py \n\n## Alternatives\n\n* herumi/msoffice \n* DocRecrypt \n* Apache POI - the Java API for Microsoft Documents \n\n## Use cases and mentions\n\n* \n* \n* \n* \n\n## Contributors\n\n* ", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nolze/msoffcrypto-tool", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "msoffcrypto-tool", "package_url": "https://pypi.org/project/msoffcrypto-tool/", "platform": "", "project_url": "https://pypi.org/project/msoffcrypto-tool/", "project_urls": { "Homepage": "https://github.com/nolze/msoffcrypto-tool" }, "release_url": "https://pypi.org/project/msoffcrypto-tool/4.10.1/", "requires_dist": null, "requires_python": "", "summary": "A Python tool and library for decrypting MS Office files with passwords or other keys", "version": "4.10.1" }, "last_serial": 5621640, "releases": { "4.1.2": [ { "comment_text": "", "digests": { "md5": "3611b40c15bd1163c409095ae9dc71a0", "sha256": "e854087b22d378f4763aca050f56b5577f8fba1d761e7b054a7589762e521f04" }, "downloads": -1, "filename": "msoffcrypto-tool-4.1.2.tar.gz", "has_sig": false, "md5_digest": "3611b40c15bd1163c409095ae9dc71a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8885, "upload_time": "2018-05-12T18:54:28", "url": "https://files.pythonhosted.org/packages/e5/c2/bd71f196bf6b0a6c4a8c84fac59d1b0c78d20cbe7ab607eedde4962634ad/msoffcrypto-tool-4.1.2.tar.gz" } ], "4.1.3": [ { "comment_text": "", "digests": { "md5": "5353ade57a12344d7531b79da7edce33", "sha256": "f14f6972daf430c4fcf9fa20f07252b004e63ca37594165cd7d718ea075d102d" }, "downloads": -1, "filename": "msoffcrypto-tool-4.1.3.tar.gz", "has_sig": false, "md5_digest": "5353ade57a12344d7531b79da7edce33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8929, "upload_time": "2018-05-13T06:41:27", "url": "https://files.pythonhosted.org/packages/fb/0f/42ffe8bbfb1de84027877c59d563b8b92f736a36dfddcf080562d929352c/msoffcrypto-tool-4.1.3.tar.gz" } ], "4.10.0": [ { "comment_text": "", "digests": { "md5": "9cc4d293b898f5fce0822715bc5bf6ee", "sha256": "66a38297308cbf6085b5ae612c48a5d0244ec04b4335164e25db43e3fb4df6d9" }, "downloads": -1, "filename": "msoffcrypto-tool-4.10.0.tar.gz", "has_sig": false, "md5_digest": "9cc4d293b898f5fce0822715bc5bf6ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 212234, "upload_time": "2019-04-14T03:39:20", "url": "https://files.pythonhosted.org/packages/d4/7c/ada57889900508994808ef4f96b36a94d8ffc5e52fe24af983a53560f438/msoffcrypto-tool-4.10.0.tar.gz" } ], "4.10.1": [ { "comment_text": "", "digests": { "md5": "afc022009f2e03aeed48394a62b439da", "sha256": "e6dd01fdb3b44c573dba85b9675e5443520418e17bf8cc0a0f79a3928d3b3963" }, "downloads": -1, "filename": "msoffcrypto-tool-4.10.1.tar.gz", "has_sig": false, "md5_digest": "afc022009f2e03aeed48394a62b439da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 209230, "upload_time": "2019-08-02T02:39:14", "url": "https://files.pythonhosted.org/packages/c5/68/58628967bc5328b22706c74081df4564e853ee68f4dafd6d77e329ae56e8/msoffcrypto-tool-4.10.1.tar.gz" } ], "4.2.3": [ { "comment_text": "", "digests": { "md5": "5b4d3e6325fb7434377490aeaca0f956", "sha256": "ee09fcde61e3125da67800b8ba2fb556b13668ad2e94670a27ba41f4e4ee1660" }, "downloads": -1, "filename": "msoffcrypto-tool-4.2.3.tar.gz", "has_sig": false, "md5_digest": "5b4d3e6325fb7434377490aeaca0f956", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10656, "upload_time": "2018-06-16T13:35:04", "url": "https://files.pythonhosted.org/packages/05/87/b83558967a799972f4441565ed023c0623a7c2345d5e09e2b86e15775554/msoffcrypto-tool-4.2.3.tar.gz" } ], "4.2.4": [ { "comment_text": "", "digests": { "md5": "b14ae941cca3a36deb2e86518ac03ea9", "sha256": "9d6059c09a28830140b35d0b90a64ca4e9580bd957408472100eb5168b0644ee" }, "downloads": -1, "filename": "msoffcrypto-tool-4.2.4.tar.gz", "has_sig": false, "md5_digest": "b14ae941cca3a36deb2e86518ac03ea9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10656, "upload_time": "2018-06-16T13:51:45", "url": "https://files.pythonhosted.org/packages/da/16/c8232f511c1f1d895f7c399cb870952d14136503c3100603b350704da43a/msoffcrypto-tool-4.2.4.tar.gz" } ], "4.2.5": [ { "comment_text": "", "digests": { "md5": "8af37e04476e235cfed0a92334f68d10", "sha256": "45959b6d4ad6ed60a25ec9bd3b9ccf8738a625b53c2c5f3da8479c74886b9f3e" }, "downloads": -1, "filename": "msoffcrypto-tool-4.2.5.tar.gz", "has_sig": false, "md5_digest": "8af37e04476e235cfed0a92334f68d10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10656, "upload_time": "2018-06-16T13:51:44", "url": "https://files.pythonhosted.org/packages/a2/53/a391788b470186f8919c74c7d7d916a65121e5bbd6e388692cab4ef04e3b/msoffcrypto-tool-4.2.5.tar.gz" } ], "4.2.6": [ { "comment_text": "", "digests": { "md5": "f814697f8614aff5d378999de8460d83", "sha256": "c58db276ee91403336750cb2b73ac3f46c02bf5a28765dece2ebbf2ec88ed4f4" }, "downloads": -1, "filename": "msoffcrypto-tool-4.2.6.tar.gz", "has_sig": false, "md5_digest": "f814697f8614aff5d378999de8460d83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10609, "upload_time": "2018-06-16T14:12:36", "url": "https://files.pythonhosted.org/packages/e7/86/e8f206af7cb6f579ce34137b63a025865a85de26a593923dbfa1a56f15ee/msoffcrypto-tool-4.2.6.tar.gz" } ], "4.3.0": [ { "comment_text": "", "digests": { "md5": "6f1ba6b9340cf2593501f664f6c26a61", "sha256": "3e1e834666ab3a31ba1d9437a18d175da024bd92a334c16c3e05f4c674bdc1d9" }, "downloads": -1, "filename": "msoffcrypto-tool-4.3.0.tar.gz", "has_sig": false, "md5_digest": "6f1ba6b9340cf2593501f664f6c26a61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11048, "upload_time": "2018-07-12T15:37:56", "url": "https://files.pythonhosted.org/packages/54/46/b9abbd3576bda92cc5d44d77b286ddff878b2ec1389fe24b538093b7a39b/msoffcrypto-tool-4.3.0.tar.gz" } ], "4.3.1": [ { "comment_text": "", "digests": { "md5": "1ceed4f37cb9daf8685fbf80543ca0d7", "sha256": "9cedbdbd38aef47acdff84dee4f54169e74b9e108d6f608f7b77ca731f9fd75e" }, "downloads": -1, "filename": "msoffcrypto-tool-4.3.1.tar.gz", "has_sig": false, "md5_digest": "1ceed4f37cb9daf8685fbf80543ca0d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11085, "upload_time": "2018-07-12T16:30:50", "url": "https://files.pythonhosted.org/packages/f8/04/49198326d22857fafcc1fa23b34333b1baaa3c549f7530b3c4cb7464e0b9/msoffcrypto-tool-4.3.1.tar.gz" } ], "4.4.0": [ { "comment_text": "", "digests": { "md5": "519ae18143f8c61c6dd9a519c616051b", "sha256": "f73de2248d00a8e639bf3ab36f18ef761775edba540b46565e7c7a111eb89e5b" }, "downloads": -1, "filename": "msoffcrypto-tool-4.4.0.tar.gz", "has_sig": false, "md5_digest": "519ae18143f8c61c6dd9a519c616051b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11667, "upload_time": "2018-08-15T16:37:32", "url": "https://files.pythonhosted.org/packages/cb/59/9b065f66a0f3470adbdf42377e4066e38ee7230279f54ecd2d0eb772bda3/msoffcrypto-tool-4.4.0.tar.gz" } ], "4.5.0": [ { "comment_text": "", "digests": { "md5": "d2236be442cc0be161117bd8eeb5730d", "sha256": "fc8f1aed537ea15b2ab79ce38ae5b7000050e1650e8c4bfd69ee9859c8f46f57" }, "downloads": -1, "filename": "msoffcrypto-tool-4.5.0.tar.gz", "has_sig": false, "md5_digest": "d2236be442cc0be161117bd8eeb5730d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15826, "upload_time": "2018-08-15T16:56:13", "url": "https://files.pythonhosted.org/packages/b4/f4/43601d2799b5c90bbccf5c78f43eb059891ed57d19470ef5651c78429adf/msoffcrypto-tool-4.5.0.tar.gz" } ], "4.6.0": [ { "comment_text": "", "digests": { "md5": "a041bdb63ec42bf797bef598c6e54b14", "sha256": "50b57d0195407817bc3ebfa2ed8b2d0c9bd7ad8e851e8fc4014063e01cbc4658" }, "downloads": -1, "filename": "msoffcrypto-tool-4.6.0.tar.gz", "has_sig": false, "md5_digest": "a041bdb63ec42bf797bef598c6e54b14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15869, "upload_time": "2018-08-21T06:09:40", "url": "https://files.pythonhosted.org/packages/63/ae/8011f8677d5ff3e47dde7ccad0557a1941600828c70ee42f96e616b4c007/msoffcrypto-tool-4.6.0.tar.gz" } ], "4.6.1": [ { "comment_text": "", "digests": { "md5": "463319eddbea08554398734ae3f2d115", "sha256": "0b98d9a78d0f92602dbd60a21a2576661a46b227aaf23658c8c0d60fefac7c21" }, "downloads": -1, "filename": "msoffcrypto-tool-4.6.1.tar.gz", "has_sig": false, "md5_digest": "463319eddbea08554398734ae3f2d115", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15864, "upload_time": "2018-08-24T04:28:55", "url": "https://files.pythonhosted.org/packages/06/17/659724f4c17cb7350b44b72b2c2803c9bdb45075b7502b7f2fcd5504391f/msoffcrypto-tool-4.6.1.tar.gz" } ], "4.6.2": [ { "comment_text": "", "digests": { "md5": "32dea314f6866953a7cb9d47c2bc4196", "sha256": "663c0cb7a6a98ce24195fd9a3d476a9f0e67e0c7d92a4d213cdaae1e1067013e" }, "downloads": -1, "filename": "msoffcrypto-tool-4.6.2.tar.gz", "has_sig": false, "md5_digest": "32dea314f6866953a7cb9d47c2bc4196", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15981, "upload_time": "2018-09-11T10:15:35", "url": "https://files.pythonhosted.org/packages/58/69/cbf2aa2e9c0654a3b28dfb5ee5f64058ec774fb5637cb29d62f7fce0f4c1/msoffcrypto-tool-4.6.2.tar.gz" } ], "4.6.3": [ { "comment_text": "", "digests": { "md5": "d2304c7ea0e6d17e6455199d0e49baf7", "sha256": "d97b14314c9a744b94abdfa7f623af4fccdaf9d34cdb173acaf38351e18a9a39" }, "downloads": -1, "filename": "msoffcrypto-tool-4.6.3.tar.gz", "has_sig": false, "md5_digest": "d2304c7ea0e6d17e6455199d0e49baf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16068, "upload_time": "2018-09-13T18:18:30", "url": "https://files.pythonhosted.org/packages/f2/94/45978721ce282ad575399ef0aaf908f0ebd5371a820ff07ea3bec794f2e7/msoffcrypto-tool-4.6.3.tar.gz" } ], "4.6.4": [ { "comment_text": "", "digests": { "md5": "109dc0099175818bc6b4a9abd226f32f", "sha256": "50fb80df03238d304e0f407e3d51d2a63a9300fb844a990d0a1bd7d67192b582" }, "downloads": -1, "filename": "msoffcrypto-tool-4.6.4.tar.gz", "has_sig": false, "md5_digest": "109dc0099175818bc6b4a9abd226f32f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18382, "upload_time": "2019-02-02T13:19:58", "url": "https://files.pythonhosted.org/packages/6e/61/9353e9f9c493f941662840ed0a58f778fab2386f3021eb5e82fe2bae59ca/msoffcrypto-tool-4.6.4.tar.gz" } ], "4.7.0": [ { "comment_text": "", "digests": { "md5": "2e0f4b4c0a1e9bfed5546652b2ab78f2", "sha256": "29f620bdd57887d5850d234bfa68a222b013ceb6965a9d59f73d5d3688d36c5e" }, "downloads": -1, "filename": "msoffcrypto-tool-4.7.0.tar.gz", "has_sig": false, "md5_digest": "2e0f4b4c0a1e9bfed5546652b2ab78f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23008, "upload_time": "2019-03-20T16:23:39", "url": "https://files.pythonhosted.org/packages/f4/16/be0fc6e4672f328c8c5d6436048cd3038eed2f77f68300d59aec630e49f2/msoffcrypto-tool-4.7.0.tar.gz" } ], "4.8.0": [ { "comment_text": "", "digests": { "md5": "6b2d4d7c3356518dde3f6da52de2b36b", "sha256": "afe36af01d5a94543745889f56bc653747837a30c3b540d981520a2989331733" }, "downloads": -1, "filename": "msoffcrypto-tool-4.8.0.tar.gz", "has_sig": false, "md5_digest": "6b2d4d7c3356518dde3f6da52de2b36b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23267, "upload_time": "2019-03-20T18:02:22", "url": "https://files.pythonhosted.org/packages/d4/85/baa5ee4d79dee95323b3884986422f3357d877efb6fba183ffcb9c0ff3d4/msoffcrypto-tool-4.8.0.tar.gz" } ], "4.9.0": [ { "comment_text": "", "digests": { "md5": "e535496889debe69cabbc563ec4a92ef", "sha256": "cd007f3755f501317e6593c275e432dd69df38d9ae04fe35ed6523bf08bfff39" }, "downloads": -1, "filename": "msoffcrypto-tool-4.9.0.tar.gz", "has_sig": false, "md5_digest": "e535496889debe69cabbc563ec4a92ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211962, "upload_time": "2019-03-27T05:54:41", "url": "https://files.pythonhosted.org/packages/c2/06/1896e4b992434f16e52a3881aa26eb2d36ef5c529f804c4850205fa8bd98/msoffcrypto-tool-4.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "afc022009f2e03aeed48394a62b439da", "sha256": "e6dd01fdb3b44c573dba85b9675e5443520418e17bf8cc0a0f79a3928d3b3963" }, "downloads": -1, "filename": "msoffcrypto-tool-4.10.1.tar.gz", "has_sig": false, "md5_digest": "afc022009f2e03aeed48394a62b439da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 209230, "upload_time": "2019-08-02T02:39:14", "url": "https://files.pythonhosted.org/packages/c5/68/58628967bc5328b22706c74081df4564e853ee68f4dafd6d77e329ae56e8/msoffcrypto-tool-4.10.1.tar.gz" } ] }