π Production-ready cryptographic toolkit that just works
Seamlessly bridge .NET cryptography power with Python simplicity
Building secure applications shouldn't require a PhD in cryptography. SecureCrypto delivers enterprise-grade encryption, signing, and key management through a clean Python API that wraps a battle-tested .NET cryptography library.
import securecrypto_bridge as sc
# It's this simple
encrypted = sc.encrypt("Secret data", "your-password")
decrypted = sc.decrypt(encrypted, "your-password")|
π Encryption Arsenal
π Digital Security
|
π οΈ Developer Experience
π File Operations
|
β οΈ Platform Support: Currently Windows-only (leverages .NET Framework via pythonnet). Cross-platform support is on our roadmap.
# Install from PyPI
pip install securecrypto-bridge
# Or install from source for development
pip install -e .That's it! The library automatically handles .NET DLL loading and initialization.
import securecrypto as sc
# Initialize the library
sc.init()
# π Password-based encryption
secret_data = "My confidential information"
encrypted = sc.encrypt(secret_data, "strong-password-123")
decrypted = sc.decrypt(encrypted, "strong-password-123")
# π Cryptographic hashing
file_hash = sc.hash_string("important-data", sc.ALGORITHMS[0])
# π Public-key cryptography
public_key, private_key = sc.generate_keypair()
ciphertext = sc.hybrid_encrypt("Top secret message", public_key)
plaintext = sc.hybrid_decrypt(ciphertext, private_key)
# βοΈ Digital signatures
signature = sc.sign_string("document-content", private_key)
is_valid = sc.verify_string("document-content", signature, public_key)
print(f"Signature valid: {is_valid}")π Click to expand CLI examples
# Encrypt a file
python -m securecrypto encrypt -p "mypassword" -i document.pdf -o document.enc
# Decrypt it back
python -m securecrypto decrypt -p "mypassword" -i document.enc -o document-restored.pdf# Sign a document
python -m securecrypto sign -k private.pem -i contract.pdf -o contract.sig
# Verify the signature
python -m securecrypto verify -k public.pem -i contract.pdf -s contract.sig# Generate file hash
python -m securecrypto hash -i largefile.zip -a sha256
# Create HMAC with shared secret
python -m securecrypto hmac -p "shared-secret" -i data.json -a sha512python -m securecrypto --helpCLI Reference:
| Command | Purpose | Key Flags |
|---|---|---|
encrypt |
Password-based file encryption | -p (password), -i (input), -o (output) |
decrypt |
Decrypt encrypted files | -p (password), -i (input), -o (output) |
sign |
Create digital signatures | -k (private key), -i (file), -o (signature) |
verify |
Verify signatures | -k (public key), -i (file), -s (signature) |
hash |
Generate file hashes | -i (input), -a (algorithm) |
hmac |
Generate HMAC | -p (password), -i (input), -a (algorithm) |
- π Cheatsheet (PDF) β One-page quick reference for all functions
- π‘ Implementation Ideas β Real-world integration patterns and use cases
The heart of SecureCrypto is a robust .NET class library that implements industry-standard cryptographic algorithms with proper security practices.
Build Requirements:
- .NET Framework 4.8 (Windows)
- Visual Studio 2022 or compatible IDE
- Python bridge requires
pythonnet
Project Structure:
SecureCrypto/
βββ SecureCrypto.sln # Visual Studio solution
βββ SecureCrypto/
β βββ SecureCrypto.csproj # C# project configuration
β βββ CryptoLib.cs # Core cryptographic implementation
Building from Source:
- Open
SecureCrypto.slnin Visual Studio - Build in Release mode
- The compiled DLL will be ready for Python integration
Explore real-world scenarios with our example collection in the examples/ directory:
aes_example.pyβ Master symmetric encryption patternsrsa_hybrid_example.pyβ Learn hybrid encryption workflowssign_verify_example.pyβ Implement digital signature verification
# Try them out
python examples/aes_example.py
python examples/rsa_hybrid_example.py
python examples/sign_verify_example.py- π Private Key Management: Store private keys securely. Never commit them to version control
- πͺ Strong Passwords: Use complex passwords for AES key derivation (12+ characters recommended)
- π Modern Algorithms: Prefer SHA256/SHA512 over legacy hash functions
- π€ Authentication Methods:
- Use HMAC for shared-secret scenarios
- Use RSA signatures for public/private key workflows
- π Regular Updates: Keep the library updated for the latest security patches
This project is released under the MIT License. You're free to use it in your applications, but please ensure compliance with your local security regulations and industry standards.
Built with β€οΈ for developers who value security and simplicity
Report Issues β’ Contribute β’ Documentation