Python bridge for SecureCrypto.dll: encryption, hashing, signing, key management
Project description
SecureCrypto-PythonBridge
🔐 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 (
.encformat with salt + IV) - Hashing (SHA256, SHA512)
- HMAC generation & verification (HMAC-SHA256, HMAC-SHA512)
- Keypair generation, import/export
- Signature file helpers (
.sigworkflow) - Clean Pythonic API wrapping the .NET DLL
📦 Installation
- Install pythonnet:
pip install pythonnet
- Clone this repository and place
SecureCrypto.dllandsecurecrypto.pynext 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
- Cheatsheet (PDF) — one-page quick reference
- Implementation Ideas — how to use this library in real projects
📂 Examples
You can find runnable demo scripts in the examples/ folder:
aes_example.py— AES string encryption & decryptionrsa_hybrid_example.py— Hybrid RSA + AES encrypt/decryptsign_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51d8d35b35097bd7a87459e5b39434182ae80d2a8df825a6b1e8df54ca2239fd
|
|
| MD5 |
da85f667c42a5b4d71e341d18da4f6d7
|
|
| BLAKE2b-256 |
1f0d7feafc21b268be4da448f0a54359d9c9a9e8da9e254bb475c592a93207ef
|
File details
Details for the file securecrypto_bridge-1.0.0-py3-none-any.whl.
File metadata
- Download URL: securecrypto_bridge-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c9f1f3e42b742caf32a55760d22ebd68cf64713c81cb97e74fa0aca97f56ec6
|
|
| MD5 |
8bae8b5355ccc2c4a3af793b405a8a0f
|
|
| BLAKE2b-256 |
d8c30bc6f1603216767ff9a5f0e90db81d5d7d2ca60e8d714c6a0636a9f58419
|