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.

from ms_ovba_crypto import MsOvbaCrypto

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 = MsOvbaCrypto.encrypt(clsid, data)

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

# returns b'\x00\x00\x00\x00'
MsOvbaCrypto.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.1.tar.gz (4.7 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.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ms_ovba_crypto-2.0.1.tar.gz
  • Upload date:
  • Size: 4.7 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.1.tar.gz
Algorithm Hash digest
SHA256 1bfced6bfab8a41a64a285156a67cf67e861de32fe402d5f4689ec311a5d3c58
MD5 a1610e4315c4b80260b2ecdece65efdc
BLAKE2b-256 b8e2fdfee0d5749833081fb1b00d1e4aad8f6d7a6b6264b46d7ad7b116d246ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ms_ovba_crypto-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0ab57b4494368c32154d7302a06529a5f0207d795f786fba4ae1289cc949e4d
MD5 f7bb0a10fb52a85d232ef3504d90fba5
BLAKE2b-256 a006ea8aeb1b121f63ff530f7398dd67300a0e01763e2f47cc7c3104f2fce666

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