multienc
A refined hybrid encryption/decryption library for secure data transmission.
Installation
pip install multienc
Usage
from multienc.crypto import RSAKeyManager, AESCipher, MultiEncrypter
# Configuration
PRIVATE_KEY_PATH = "private_key.pem"
PUBLIC_KEY_PATH = "public_key.pem"
PRIVATE_KEY_PASSWORD = b"secure-password" # Replace with a secure password
CLIENT_PUBLIC_KEY_FOR_AES = "clientpubkey1234" # Must match the client's key
UID = "user123" # Unique user identifier
# Initialize the key manager (generates keys if they don't exist)
rsa_key_manager = RSAKeyManager(PRIVATE_KEY_PATH, PUBLIC_KEY_PATH, PRIVATE_KEY_PASSWORD)
# Initialize the AES cipher
aes_cipher = AESCipher(CLIENT_PUBLIC_KEY_FOR_AES)
# Initialize the multi-encrypter
multi_encrypter = MultiEncrypter(rsa_key_manager, aes_cipher)
# Encryption
data = {"message": "This is a secret message!"}
encrypted_payload = multi_encrypter.encrypt_refined_hybrid(data, UID)
print("Encrypted payload:", encrypted_payload)
# Decryption
# (Assume you've received the encrypted_payload from the client)
decrypted_data = multi_encrypter.decrypt_refined_hybrid(encrypted_payload, UID)
print("Decrypted data:", decrypted_data)
Important:
- Replace
"secure-password"with a strong, randomly generated password for your RSA private key. - Ensure the
CLIENT_PUBLIC_KEY_FOR_AESmatches the value used by the client for AES key derivation. - Handle RSA key generation and storage securely. Do not hardcode the private key password in production.
- The
UIDshould be unique per user or session.
Metadata
Release files for multienc 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| multienc-0.1.0.tar.gz | 13.0 kB | Without provenance | Details for multienc-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| multienc-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for multienc-0.1.0-py3-none-any.whl |
Total release size: 20.7 kB
Release files / multienc-0.1.0.tar.gz
| Download URL | multienc-0.1.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
210d8592da3f4130fb05d11c377009760821cb5d15c798f6b85ed7b488fa5ad0
|
|
BLAKE2b-256 checksum How to use checksums |
05170a81ef9ad88afc65c3ab2b1d59f62a695cc448921f55b02cf6715fadfb76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / multienc-0.1.0-py3-none-any.whl
| Download URL | multienc-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83fa419a051006dafe022d13b0e23afc3a01853137205a00024138d9742783a4
|
|
BLAKE2b-256 checksum How to use checksums |
6405b66d82b85c2b7850c59fae14ef44c343df1c9ece18cc2125d8cd0871a37c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for multienc 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.