# cryptidy
## Python high level library for symmetric & asymmetric encryption
[](https://opensource.org/licenses/BSD-3-Clause)
[](http://isitmaintained.com/project/netinvent/Cryptidy "Percentage of issues still open")
[](https://codeclimate.com/github/netinvent/cryptidy/maintainability)
[](https://codecov.io/gh/netinvent/cryptidy)
[](https://github.com/netinvent/cryptidy/actions/workflows/linux.yaml)
[](https://github.com/netinvent/cryptidy/actions/workflows/windows.yaml)
[](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
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_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": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"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/e5/ee/c05e8cdf295fad4e973205c8f4107dbdd9082c087ac1250a13161035ffba/cryptidy-1.2.2.tar.gz",
"platform": null,
"description": "# cryptidy\r\n## Python high level library for symmetric & asymmetric encryption\r\n\r\n[](https://opensource.org/licenses/BSD-3-Clause)\r\n[](http://isitmaintained.com/project/netinvent/Cryptidy \"Percentage of issues still open\")\r\n[](https://codeclimate.com/github/netinvent/cryptidy/maintainability)\r\n[](https://codecov.io/gh/netinvent/cryptidy)\r\n[](https://github.com/netinvent/cryptidy/actions/workflows/linux.yaml)\r\n[](https://github.com/netinvent/cryptidy/actions/workflows/windows.yaml)\r\n[](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\ncryptidy requires Python 2.7+\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.2",
"split_keywords": [
"cryptography",
"symmetric",
"asymmetric",
"high",
"level",
"api",
"easy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ff09ecdf9f66e2ead60bf5d373ea789087dc81ee1ff86bf73a1c3cdba7b86e3c",
"md5": "9fd33eed1f57281b72a09cfbecab35bd",
"sha256": "b9a13f9a2f5b975b19b215d6992e0c6ac990c560a00cf40d8b0b715c15257e39"
},
"downloads": -1,
"filename": "cryptidy-1.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9fd33eed1f57281b72a09cfbecab35bd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 13037,
"upload_time": "2023-03-26T17:21:01",
"upload_time_iso_8601": "2023-03-26T17:21:01.589068Z",
"url": "https://files.pythonhosted.org/packages/ff/09/ecdf9f66e2ead60bf5d373ea789087dc81ee1ff86bf73a1c3cdba7b86e3c/cryptidy-1.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e5eec05e8cdf295fad4e973205c8f4107dbdd9082c087ac1250a13161035ffba",
"md5": "46aecd58f2d635f254472bf102546fec",
"sha256": "9d278950b4e6b4a48aab21fb0f6c063564913e82b8619a246f5dfa8d9d9452f7"
},
"downloads": -1,
"filename": "cryptidy-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "46aecd58f2d635f254472bf102546fec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10971,
"upload_time": "2023-03-26T17:21:03",
"upload_time_iso_8601": "2023-03-26T17:21:03.287480Z",
"url": "https://files.pythonhosted.org/packages/e5/ee/c05e8cdf295fad4e973205c8f4107dbdd9082c087ac1250a13161035ffba/cryptidy-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-26 17:21:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "netinvent",
"github_project": "cryptidy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cryptidy"
}