Skip to main content

Python bridge for SecureCrypto.dll: encryption, hashing, signing, key management

Project description

SecureCrypto-PythonBridge

Python Platform License Build

CI - Python self-test

PyPI

🔐 A ready-to-use .NET cryptography library (SecureCrypto.dll) with a Python wrapper (securecrypto.py) for easy encryption, decryption, hashing, signing, and key management in your own applications.


✨ Features

  • AES (symmetric encryption with password-derived keys)
  • RSA hybrid encryption (AES + RSA for secure key exchange)
  • Digital signatures (sign/verify strings and files)
  • File encryption/decryption (.enc format with salt + IV)
  • Hashing (SHA256, SHA512)
  • HMAC generation & verification (HMAC-SHA256, HMAC-SHA512)
  • Keypair generation, import/export
  • Signature file helpers (.sig workflow)
  • Clean Pythonic API wrapping the .NET DLL

📦 Installation

  1. Install pythonnet:
pip install pythonnet
  1. Clone this repository and place SecureCrypto.dll and securecrypto.py next to your project files.

Installation

From PyPI

pip install securecrypto-bridge

🚀 Quick Usage

import securecrypto as sc

sc.init()  # loads SecureCrypto.dll

# AES encrypt/decrypt
c = sc.encrypt("Hello", "mypassword")
print("Ciphertext:", c)
print("Plaintext:", sc.decrypt(c, "mypassword"))

# Hashing
print(sc.hash_string("abc", sc.ALGORITHMS[0]))

# Hybrid RSA + AES
pub, priv = sc.generate_keypair()
ct = sc.hybrid_encrypt("Top Secret", pub)
print(sc.hybrid_decrypt(ct, priv))

# Signing & verifying
sig = sc.sign_string("hello", priv)
print("Signature valid?", sc.verify_string("hello", sig, pub))

📘 Documentation



📂 Examples

You can find runnable demo scripts in the examples/ folder:

  • aes_example.py — AES string encryption & decryption
  • rsa_hybrid_example.py — Hybrid RSA + AES encrypt/decrypt
  • sign_verify_example.py — Signing and verifying strings & files

Run them with:

python examples/aes_example.py
python examples/rsa_hybrid_example.py
python examples/sign_verify_example.py

⚠️ Security Notes

  • Keep private keys safe. Never share them.
  • Use strong passwords for AES key derivation.
  • Use SHA256/SHA512 over older hash algorithms.
  • HMAC is for shared-secret verification; RSA signatures are for public/private workflows.

📄 License

This project is provided as-is for educational and development use. You are responsible for ensuring compliance with applicable laws and security standards when integrating into your applications.

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

securecrypto_bridge-1.0.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

securecrypto_bridge-1.0.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file securecrypto_bridge-1.0.1.tar.gz.

File metadata

  • Download URL: securecrypto_bridge-1.0.1.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for securecrypto_bridge-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6110b9a2f077743e9a8b98e7e7c51467dd19b6eac0881831721029728ac0e810
MD5 8f2df9232669d236b6b326f6e4051604
BLAKE2b-256 7d3b2b28f5169a9c052f2dbd06ea8a730a931576bf29674636c61d2d90eaf578

See more details on using hashes here.

File details

Details for the file securecrypto_bridge-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for securecrypto_bridge-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73816f67b5adb5d727b3cd6074370ae484404546756c51f1179d32b0e17c4a33
MD5 5cddfc18da148f5e2da8347673e63c32
BLAKE2b-256 b257d0400c86f28b861edda66a97ed4a1f76de51e04e25e66bfc273f7cc4c593

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