Helper for hybrid AES-RSA encryption
Project description
sqlalchemy-state-machine is a helper for hybrid AES-RSA encryption.
Installation
hybrid-rsa-aes is available on PyPI. Use pip to install:
$ pip install hybrid-rsa-aes
Basic Usage
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from hybrid_rsa_aes import HybridCipher
rsa_private_key = rsa.generate_private_key(
public_exponent=65537, key_size=2048, backend=default_backend()
)
rsa_public_key = rsa_private_key.public_key()
encrypt_message = HybridCipher().encrypt(rsa_public_key=rsa_public_key, data={"test": "demo"})
decrypt_message = HybridCipher().decrypt(
rsa_private_key=rsa_private_key, cipher_text=encrypt_message
)
assert "test" in decrypt_message and decrypt_message["test"] == "demo"
License
sqlalchemy-state-machine is developed and distributed under the Apache 2.0 license.
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
hybrid-rsa-aes-0.2.0.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for hybrid_rsa_aes-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06cbada98b8aee2c34556433e634200da3867bdd92645786c16f627211356556 |
|
MD5 | 5c9d16d19cec07d6043ccd66b2bec2aa |
|
BLAKE2b-256 | 6dd0c2fbf383640464547652f6ceb637a2868a1f2d7a12d3fdff93de638e4fac |