Skip to main content

cryptidy

Python high level library for symmetric & asymmetric encryption

License Percentage of issues still open Maintainability codecov linux-tests windows-tests GitHub Release

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)

Metadata

Release files for cryptidy 1.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cryptidy 1.2.4
File Size Uploaded
cryptidy-1.2.4.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cryptidy 1.2.4
File Interpreter ABI Platform
cryptidy-1.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / cryptidy-1.2.4.tar.gz

Download URL cryptidy-1.2.4.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dd2984d09c920211a862e5718dc87ea2db8fdc597f5faec961a4d4b30f7fe923
BLAKE2b-256 checksum
How to use checksums
4a1ace39f7d5b1dc3bc53aec644e8b99a154e1ca3f15797fb315742b0a7f5d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / cryptidy-1.2.4-py3-none-any.whl

Download URL cryptidy-1.2.4-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbd3e020200a10721bcf1ab0baad9c6ad46a5029402b4fe6904328b23f5a6198
BLAKE2b-256 checksum
How to use checksums
2155ce1116d87e3ef11440e81b171707c1b2b7f832aaf42af7772f7f617f3ce9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.2.4 This release

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.7

2 release files

1.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page