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 Nightly - Assign Milestones

🔐 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.

🚀 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.0.tar.gz (14.0 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.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for securecrypto_bridge-1.0.0.tar.gz
Algorithm Hash digest
SHA256 51d8d35b35097bd7a87459e5b39434182ae80d2a8df825a6b1e8df54ca2239fd
MD5 da85f667c42a5b4d71e341d18da4f6d7
BLAKE2b-256 1f0d7feafc21b268be4da448f0a54359d9c9a9e8da9e254bb475c592a93207ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for securecrypto_bridge-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c9f1f3e42b742caf32a55760d22ebd68cf64713c81cb97e74fa0aca97f56ec6
MD5 8bae8b5355ccc2c4a3af793b405a8a0f
BLAKE2b-256 d8c30bc6f1603216767ff9a5f0e90db81d5d7d2ca60e8d714c6a0636a9f58419

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