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-1.0.6.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-1.0.6-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ms_ovba_crypto-1.0.6.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-1.0.6.tar.gz
Algorithm Hash digest
SHA256 d3dddf671b127d87428db95fbe060cce5417e68c7ae4bbce27b62c23c8002e72
MD5 8724e507b8635319f0fdff1b867857a0
BLAKE2b-256 3d2d5e7db870746b9867686d25d80f52376eda0d7e0850306e70d5c64b2d647c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ms_ovba_crypto-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f26e3df0b7a83f623639c1bda8317dab4615ed0dfcce24c47b546211e8419212
MD5 11fac69bfdf98577132baa3bb5a000e4
BLAKE2b-256 c46413c094a10ae0c3113878ac93c22ef38c12c21e0a4802c16cec507a946e20

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