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. It is based on AES encryption (265 or 128 bytes).

It's main features are:

  • Encrypt any pickable Python object / variables
  • 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)
    • 128, 192 or 256 bits encryption
  • Allow asymmetric encryption (RSA + AES)
    • 1024, 2048 or 4096 bits encryption using AES128 (1024 bits RSA) or AES256 (2048 or 4096 bits RSA)
  • 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

cryptidy requires 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_object = ['foo', 'bar']
encrypted = symmetric_encryption.encrypt_message(some_python_object, 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_object = ['foo', 'bar']
encrypted = asymmetric_encryption.encrypt_message(some_python_object, pub_key)
timestamp, original_object = asymmetric_encryption.decrypt_message(encrypted, priv_key)

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.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cryptidy-1.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file cryptidy-1.1.0.tar.gz.

File metadata

  • Download URL: cryptidy-1.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.9

File hashes

Hashes for cryptidy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 98a145129f24cf34f218a748435bae9ba39959de413803ac44470f0dae7eafde
MD5 2107dbf5f91449125a3fca0c81458aba
BLAKE2b-256 8ceac170fcde0dc4842ce03b6f18c39432aa3d7b8b04d6dde6856f2867cf5c58

See more details on using hashes here.

File details

Details for the file cryptidy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: cryptidy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.9

File hashes

Hashes for cryptidy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95c98c470597af00cae7a817ee76847ce01102520f49eaf59aaddb27ea0a808b
MD5 7739d9ec90b238e7d6dd0acee61b6983
BLAKE2b-256 f1cc7ca34cfc68673ad02638008c05297ea91ef9619a8a2dfdc519027c64845f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page