# 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/4a/1a/ce39f7d5b1dc3bc53aec644e8b99a154e1ca3f15797fb315742b0a7f5d66/cryptidy-1.2.4.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.4",
"project_urls": {
"Homepage": "https://github.com/netinvent/cryptidy"
},
"split_keywords": [
"cryptography",
" symmetric",
" asymmetric",
" high",
" level",
" api",
" easy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2155ce1116d87e3ef11440e81b171707c1b2b7f832aaf42af7772f7f617f3ce9",
"md5": "dbad6c0029563b429d31a96f2c51a7fc",
"sha256": "dbd3e020200a10721bcf1ab0baad9c6ad46a5029402b4fe6904328b23f5a6198"
},
"downloads": -1,
"filename": "cryptidy-1.2.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dbad6c0029563b429d31a96f2c51a7fc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 13053,
"upload_time": "2024-12-10T12:23:27",
"upload_time_iso_8601": "2024-12-10T12:23:27.599137Z",
"url": "https://files.pythonhosted.org/packages/21/55/ce1116d87e3ef11440e81b171707c1b2b7f832aaf42af7772f7f617f3ce9/cryptidy-1.2.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4a1ace39f7d5b1dc3bc53aec644e8b99a154e1ca3f15797fb315742b0a7f5d66",
"md5": "8bd4a085f42d8268c98f42b7976991d9",
"sha256": "dd2984d09c920211a862e5718dc87ea2db8fdc597f5faec961a4d4b30f7fe923"
},
"downloads": -1,
"filename": "cryptidy-1.2.4.tar.gz",
"has_sig": false,
"md5_digest": "8bd4a085f42d8268c98f42b7976991d9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12895,
"upload_time": "2024-12-10T12:23:28",
"upload_time_iso_8601": "2024-12-10T12:23:28.683694Z",
"url": "https://files.pythonhosted.org/packages/4a/1a/ce39f7d5b1dc3bc53aec644e8b99a154e1ca3f15797fb315742b0a7f5d66/cryptidy-1.2.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-10 12:23:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "netinvent",
"github_project": "cryptidy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cryptidy"
}