Skip to main content

Encryption and hashing functions for Office VBA files.

Project description

Coverage Status Build Status

MS-OVBA-Crypto

Cryptographic Functions for Office Visual Basic files.

Installation

Use the package manager pip to install MS_OVBA_Compression.

pip install ms_ovba_crypto

Usage

Microsoft VBA files use a custom encryption algorithm to obfuscate visibility and permission fields. The clsid is used as a seed.

import ms_ovba_crypto

data = b'\x00\x00\x00\x00',

clsid = '{9E394C0B-697E-4AEE-9FA6-446F51FB30DC}'
# Random numbers are used in the obfuscation, so the output is not deterministic.
encrypted = ms_ovba_crypto.encrypt(clsid, data)

data = b'\x41\x43\x5A\x5A\x5E\x5A\x5E\x5A\x5E\x5A\x5E'

# returns b'\x00\x00\x00\x00'
ms_ovba_crypto.decrypt(data)

Typing stubs

The project also includes typed stubs for mypy. These stubs are autogenerated by stubgen, so they may be incomplete. Please let me know if they do not meet your needs and I can manage them manually.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

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

Source Distribution

ms_ovba_crypto-2.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ms_ovba_crypto-2.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file ms_ovba_crypto-2.0.0.tar.gz.

File metadata

  • Download URL: ms_ovba_crypto-2.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ms_ovba_crypto-2.0.0.tar.gz
Algorithm Hash digest
SHA256 7809e33cc1ab09e3e7cb8d28add087b01ba2bdfef29fe2cb046c84dab8952cb1
MD5 9b204724520caa9c664f3098536c7e3d
BLAKE2b-256 b42f9649f88140c93e9da31bbfd5c8feb853ce6169ded9529424257056a36e15

See more details on using hashes here.

File details

Details for the file ms_ovba_crypto-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ms_ovba_crypto-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ms_ovba_crypto-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9789d5bdead668287b705586dfef121deffaa692bc0ad776987c4b7bebe3ea2d
MD5 8a795be8099a20978c3250d9550237df
BLAKE2b-256 e0642b25002e5b71a731856fafba0d7affeb753f379671c010d0f13b426a28c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page