A simple tools to hybrid encryption and decryption
Project description
Installation
pip install -U xrypt-xethhung12
Usage
from xrypt_xethhung12.xrypt import load_pub, load_pri, hybrid_encrypt, hybrid_decrypt
sender_pub = load_pub("rsa_public_key.pem")
sender_pri = load_pri("rsa_private_key.pem")
receiver_pub = load_pub("rsa_public_key_2.pem")
receiver_pri = load_pri("rsa_private_key_2.pem")
# normal case
key_str,iv_str,encrypt_data,sign = hybrid_encrypt(receiver_pub, sender_pri, "abcd1234567890".encode("utf-8"))
decrypted_data = hybrid_decrypt(receiver_pri, sender_pub, key_str, iv_str, encrypt_data, sign)
# decrypted_data -> b'abcd1234567890'
# incase the verify key fail
# there will be a exception raised
Scripts
Generate rsa key pair
pri={pri}
pub={pub}
openssl genrsa -out $pri 4096
openssl rsa -in $pri -outform PEM -pubout -out $pub
Build
rm -fr dist
python3 -m build
Build and Deploy
rm -fr dist
python3 -m build
twine upload dist/* -u __token__ -p $pwd
Update version dev
python3 -m xh_py_project_versioning --patch
Update version
python3 -m xh_py_project_versioning --patch -d
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
xrypt_xethhung12-0.0.6.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for xrypt_xethhung12-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e2a1140310ab047b11a4007302e41bea361a162a2910c4dedd610f274ce3b92 |
|
MD5 | 5d3ca75e05006ada3293aac3ee086edb |
|
BLAKE2b-256 | 13ab007de907222b939179e1c211b56e36d4b61272a439f3121f8f96f8eb2be9 |