This repo provides:
- SecureCrypto.dll — a .NET cryptography library exposing AES, RSA, HMAC, and hashing utilities.
- securecrypto.py — a Python wrapper that makes the DLL’s methods accessible as simple Python functions.
Together, these tools give developers a ready-to-use crypto layer for application development without having to re-implement security primitives.
- Encrypt PDFs, images, or backups before uploading to cloud storage.
- Decrypt only on-demand when the user authenticates.
- Use
encrypt_file/decrypt_file.
- Use Hybrid RSA + AES to send messages securely:
- Encrypt with the recipient’s public key.
- Decrypt with the recipient’s private key.
- Verify authenticity with
sign_string/verify_string.
- Sign requests with HMAC (
hmac) using a shared secret. - Verify with
hmac_verifyon the server. - Prevents tampering and replay attacks.
- Sign uploaded documents or configuration files with
sign_file_to. - Distribute the public key to clients.
- Let clients verify authenticity with
verify_file_from.
- Use
hash_fileto generate SHA256 or SHA512 digests. - Store hashes alongside files to detect corruption or tampering.
- Ideal for software distribution pipelines.
- Use
encrypt/decryptfor string-level AES. - Store ciphertext in your database; only decrypt when needed.
- Add HMACs for tamper detection.
- Sign update packages with a private key.
- Client apps verify the signature before installation.
- Prevents malicious or altered updates.
- Lightweight signing and verification for sensor data.
- Hash configs for tamper detection.
- Hybrid encryption for secure command delivery.
- Generate a keypair (
generate_keypair). - Encrypt a file with AES (
encrypt_file). - Encrypt the AES key/IV with the recipient’s RSA public key (
hybrid_encrypt). - Share the
.encfile and RSA-encrypted key. - Recipient decrypts the key with private RSA, then decrypts the file.
- Server signs data with
sign_file. - Client downloads both data and
.sigfile. - Client verifies with
verify_file_from. - Any tampering breaks verification.
- Always protect your private keys — never distribute them.
- Use strong passwords for AES key derivation.
- Favor SHA256/SHA512 over older algorithms.
- HMAC is for shared-secret authentication; RSA signatures are for asymmetric verification.