Python high level library for symmetric & asymmetric encryption
Project description
cryptidy
Python high level library for symmetric & asymmetric encryption
This library has been written to make encryption / decryption of any python object as simple as possible, while keeping the encryption solution secure. It is based on pycryptodomex AES and RSA encrpytion implementations.
It's main features are:
- Encrypt any pickable Python object / variable / blob
- Add an UTC timestamp to the encrypted message
- Verify that decrypted messages timestamps aren't in the future or too old (for bad RTC clock diags)
- Allow symmetric encryption (AES-EAX mode)
- 128, 192 or 256 bits encryption
- Allow asymmetric encryption (RSA encryption with SHA384 hash algorithm and above AES encryption)
- 1024, 2048 or 4096 bits RSA encryption with AES-256 session encryption
- Provide the encypted data as base64 string for maximum portability between platforms and encodings
- Unload AES key from memory as soon as possible to help prevent memory attacks
Setup
Current cryptidy tests are Python 3.7 and up.
Nevertheless, cryptidy v1.2.3 still runs on Python 2.7+ ;)
pip install cryptidy
Symmetric encryption usage
from cryptidy import symmetric_encryption
key = symmetric_encryption.generate_key(32) # 32 bytes == 256 bits
some_python_objects = ['foo', 'bar'], 'some long string', 12
encrypted = symmetric_encryption.encrypt_message(some_python_objects, key)
timestamp, original_object = symmetric_encryption.decrypt_message(encrypted, key)
Asymmetric encryption usage
from cryptidy import asymmetric_encryption
priv_key, pub_key = asymmetric_encryption.generate_keys(2048) # 2048 bits RSA key
some_python_objects = ['foo', 'bar'], 'some long string', 12
encrypted = asymmetric_encryption.encrypt_message(some_python_objects, pub_key)
timestamp, original_object = asymmetric_encryption.decrypt_message(encrypted, priv_key)
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
cryptidy-1.2.3.tar.gz
(12.8 kB
view details)
Built Distribution
cryptidy-1.2.3-py3-none-any.whl
(13.0 kB
view details)
File details
Details for the file cryptidy-1.2.3.tar.gz
.
File metadata
- Download URL: cryptidy-1.2.3.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ee7d18079fcf71199d0a815773934916fb369aff5dd4ab0826f7d60c3f554ae |
|
MD5 | 9383d5470a647fa45b3dcc3819c0ecc8 |
|
BLAKE2b-256 | 6178f7809cd56c1d83046aad19a74dd0fc19252ea13cd167dbf55a3c554ba4d9 |
File details
Details for the file cryptidy-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: cryptidy-1.2.3-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 139a85d09d5e129d5127ba1ebb38ee3a2922e17e249dcdb24062161000d6b785 |
|
MD5 | 1cd6be0cddbc6b203c848b5a78048420 |
|
BLAKE2b-256 | e23a0c1a4063c830cc1cc6a3d8628fc22856a18a6c4e41dc592431230a09821e |