# cryptidy
## Python high level library for symmetric & asymmetric encryption
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/netinvent/cryptidy.svg)](http://isitmaintained.com/project/netinvent/Cryptidy "Percentage of issues still open")
[![Maintainability](https://api.codeclimate.com/v1/badges/be5d6edea1288951dc07/maintainability)](https://codeclimate.com/github/netinvent/cryptidy/maintainability)
[![codecov](https://codecov.io/gh/netinvent/cryptidy/branch/master/graph/badge.svg?token=E5D9oVnqj7)](https://codecov.io/gh/netinvent/cryptidy)
[![linux-tests](https://github.com/netinvent/cryptidy/actions/workflows/linux.yaml/badge.svg)](https://github.com/netinvent/cryptidy/actions/workflows/linux.yaml)
[![windows-tests](https://github.com/netinvent/cryptidy/actions/workflows/windows.yaml/badge.svg)](https://github.com/netinvent/cryptidy/actions/workflows/windows.yaml)
[![GitHub Release](https://img.shields.io/github/release/netinvent/cryptidy.svg?label=Latest)](https://github.com/netinvent/cryptidy/releases/latest)
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)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/netinvent/cryptidy",
"name": "cryptidy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "cryptography, symmetric, asymmetric, high, level, api, easy",
"author": "NetInvent - Orsiris de Jong",
"author_email": "contact@netinvent.fr",
"download_url": "https://files.pythonhosted.org/packages/61/78/f7809cd56c1d83046aad19a74dd0fc19252ea13cd167dbf55a3c554ba4d9/cryptidy-1.2.3.tar.gz",
"platform": null,
"description": "# cryptidy\r\n## Python high level library for symmetric & asymmetric encryption\r\n\r\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\r\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/netinvent/cryptidy.svg)](http://isitmaintained.com/project/netinvent/Cryptidy \"Percentage of issues still open\")\r\n[![Maintainability](https://api.codeclimate.com/v1/badges/be5d6edea1288951dc07/maintainability)](https://codeclimate.com/github/netinvent/cryptidy/maintainability)\r\n[![codecov](https://codecov.io/gh/netinvent/cryptidy/branch/master/graph/badge.svg?token=E5D9oVnqj7)](https://codecov.io/gh/netinvent/cryptidy)\r\n[![linux-tests](https://github.com/netinvent/cryptidy/actions/workflows/linux.yaml/badge.svg)](https://github.com/netinvent/cryptidy/actions/workflows/linux.yaml)\r\n[![windows-tests](https://github.com/netinvent/cryptidy/actions/workflows/windows.yaml/badge.svg)](https://github.com/netinvent/cryptidy/actions/workflows/windows.yaml)\r\n[![GitHub Release](https://img.shields.io/github/release/netinvent/cryptidy.svg?label=Latest)](https://github.com/netinvent/cryptidy/releases/latest)\r\n\r\nThis library has been written to make encryption / decryption of any python object as simple as possible, while keeping the encryption solution secure.\r\nIt is based on pycryptodomex AES and RSA encrpytion implementations.\r\n\r\nIt's main features are:\r\n - Encrypt any pickable Python object / variable / blob\r\n - Add an UTC timestamp to the encrypted message\r\n - Verify that decrypted messages timestamps aren't in the future or too old (for bad RTC clock diags)\r\n - Allow symmetric encryption (AES-EAX mode)\r\n - 128, 192 or 256 bits encryption\r\n - Allow asymmetric encryption (RSA encryption with SHA384 hash algorithm and above AES encryption)\r\n - 1024, 2048 or 4096 bits RSA encryption with AES-256 session encryption\r\n - Provide the encypted data as base64 string for maximum portability between platforms and encodings\r\n - Unload AES key from memory as soon as possible to help prevent memory attacks\r\n\r\n# Setup\r\n\r\nCurrent cryptidy tests are Python 3.7 and up. \r\nNevertheless, cryptidy v1.2.3 still runs on Python 2.7+ ;)\r\n\r\n\r\n`pip install cryptidy`\r\n\r\n\r\n# Symmetric encryption usage\r\n\r\n```\r\nfrom cryptidy import symmetric_encryption\r\n\r\nkey = symmetric_encryption.generate_key(32) # 32 bytes == 256 bits\r\n\r\nsome_python_objects = ['foo', 'bar'], 'some long string', 12\r\nencrypted = symmetric_encryption.encrypt_message(some_python_objects, key)\r\ntimestamp, original_object = symmetric_encryption.decrypt_message(encrypted, key)\r\n```\r\n\r\n# Asymmetric encryption usage\r\n\r\n```\r\nfrom cryptidy import asymmetric_encryption\r\n\r\npriv_key, pub_key = asymmetric_encryption.generate_keys(2048) # 2048 bits RSA key\r\n\r\nsome_python_objects = ['foo', 'bar'], 'some long string', 12\r\nencrypted = asymmetric_encryption.encrypt_message(some_python_objects, pub_key)\r\ntimestamp, original_object = asymmetric_encryption.decrypt_message(encrypted, priv_key)\r\n```\r\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Python high level library for symmetric & asymmetric encryption",
"version": "1.2.3",
"project_urls": {
"Homepage": "https://github.com/netinvent/cryptidy"
},
"split_keywords": [
"cryptography",
" symmetric",
" asymmetric",
" high",
" level",
" api",
" easy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e23a0c1a4063c830cc1cc6a3d8628fc22856a18a6c4e41dc592431230a09821e",
"md5": "1cd6be0cddbc6b203c848b5a78048420",
"sha256": "139a85d09d5e129d5127ba1ebb38ee3a2922e17e249dcdb24062161000d6b785"
},
"downloads": -1,
"filename": "cryptidy-1.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1cd6be0cddbc6b203c848b5a78048420",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12982,
"upload_time": "2024-10-18T13:15:22",
"upload_time_iso_8601": "2024-10-18T13:15:22.313935Z",
"url": "https://files.pythonhosted.org/packages/e2/3a/0c1a4063c830cc1cc6a3d8628fc22856a18a6c4e41dc592431230a09821e/cryptidy-1.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6178f7809cd56c1d83046aad19a74dd0fc19252ea13cd167dbf55a3c554ba4d9",
"md5": "9383d5470a647fa45b3dcc3819c0ecc8",
"sha256": "4ee7d18079fcf71199d0a815773934916fb369aff5dd4ab0826f7d60c3f554ae"
},
"downloads": -1,
"filename": "cryptidy-1.2.3.tar.gz",
"has_sig": false,
"md5_digest": "9383d5470a647fa45b3dcc3819c0ecc8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12796,
"upload_time": "2024-10-18T13:15:23",
"upload_time_iso_8601": "2024-10-18T13:15:23.467852Z",
"url": "https://files.pythonhosted.org/packages/61/78/f7809cd56c1d83046aad19a74dd0fc19252ea13cd167dbf55a3c554ba4d9/cryptidy-1.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-18 13:15:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "netinvent",
"github_project": "cryptidy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cryptidy"
}