Skip to main content

Windows-native DPAPI encryption with a clean Python interface.

Project description

Sure! Here's a detailed README draft including all your functions and usage notes for muerte32crypt:


muerte32crypt

Windows-native DPAPI encryption using ctypes. Encrypt and decrypt strings, bytes, or files with optional entropy and descriptions. Includes TPM utilities, certificate handling, RSA, EC & Ed keys, symmetric ciphers, Twofish, and key management.


Features

  • DPAPI encryption/decryption: encrypt, decrypt, encrypt_str, decrypt_str, encrypt_file, decrypt_file

  • TPM utilities: is_tpm_available, generate_tpm_key, seal_data_to_tpm, unseal_data_from_tpm

  • Hashing & HMAC: sha256, sha512, hmac_sha256, hmac_sha512

  • AES: Key wrap/unwrap: aes_key_wrap, aes_key_unwrap AES-GCM encrypt/decrypt: aes_gcm_encrypt, aes_gcm_decrypt, aes_gcm_encrypt_with_nonce, aes_gcm_decrypt_with_nonce AES-CBC encrypt/decrypt: aes_cbc_encrypt, aes_cbc_decrypt

  • RSA: Generate keys: generate_rsa_keypair Encrypt/decrypt: rsa_encrypt, rsa_decrypt Sign/verify: rsa_sign, rsa_verify Serialize/load keys: serialize_private_key, serialize_public_key, load_private_key, load_public_key Get fingerprint: get_public_key_fingerprint

  • Twofish symmetric cipher: twofish_encrypt_raw, twofish_decrypt_raw

  • Certificates: Load/save certs and CSRs: load_cert, save_cert, load_csr, save_csr Generate self-signed certs and CSRs: generate_self_signed_cert, generate_csr Get cert info: get_cert_fingerprint, get_cert_subject, get_cert_issuer, get_cert_sans Verify cert chain: verify_cert_chain

  • Elliptic and EdDSA curves: generate_ec_key, generate_ed_key, list_all_curves, get_curve_name

  • Key Management (class KeyManager):

    • Symmetric key generate/get/delete/rotate
    • RSA keypair generate/import/export/get/delete
    • Derive keys from passwords with PBKDF2
    • Salt generation

Usage example

from muerte32crypt.dpapi import encrypt_str, decrypt_str

encrypted = encrypt_str("my_secret_password", entropy="somesalt")
print(decrypt_str(encrypted, entropy="somesalt"))
from muerte32crypt.keymanagement import KeyManager

km = KeyManager()
km.generate_key("my_sym_key", 32)
key = km.get_key("my_sym_key")
print(key.hex())

priv, pub = km.generate_rsa_keypair("my_rsa_key")
pem = km.export_private_key_pem("my_rsa_key", passphrase=b"mypass")
print(pem.decode())
from muerte32crypt.certs import generate_self_signed_cert, get_cert_subject

cert, key = generate_self_signed_cert("example.com")
print(get_cert_subject(cert))

Installation

pip install muerte32crypt

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

muerte32crypt-1.0.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

muerte32crypt-1.0.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file muerte32crypt-1.0.0.tar.gz.

File metadata

  • Download URL: muerte32crypt-1.0.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for muerte32crypt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1904ac5dfd159c462d3c0a2dcb7e9780e7efb0098a43ff0ce787546cbec181f9
MD5 1c035b9918f896a39ddcdfb65b6c8705
BLAKE2b-256 6c2172fa3bfcdf5b66296eb0668ba4b07e82f35d5e8e29f4c69036724d5772da

See more details on using hashes here.

File details

Details for the file muerte32crypt-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: muerte32crypt-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for muerte32crypt-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0dc2197d08620b96c67ea35f77be2ff59d0dfb7d0bc523dead6de7f9706eab07
MD5 6dfd67eb08b01e4f07765f73d20dba31
BLAKE2b-256 45045d068bc744a56c02aa53b3698a3ededdb9bb838b51e2d816446da3118bae

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