{ "info": { "author": "AnonymousDapper", "author_email": "dapper@a-sketchy.site", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: C", "Programming Language :: Python :: 3", "Topic :: Security :: Cryptography" ], "description": "[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)\n[![forthebadge](https://forthebadge.com/images/badges/made-with-c.svg)](https://forthebadge.com)\n\n[![mit](https://img.shields.io/github/license/mashape/apistatus.svg)](https://gitlab.a-sketchy.site/AnonymousDapper/ct_crypto/blob/master/LICENSE)\n\n[![pypi](https://img.shields.io/pypi/v/ct_crypto.svg)](https://pypi.org/project/ct-crypto)\n\n# CT_Crypto - PyChickenTicket crypto module\n\n## Docs\n\n### `encrypt(data, password)`\n\n\nEncrypt data (assuming nonce and salt are packed in) with\ngiven password, and return decrypted data.\n\nIf data is decrypted with non-default length parameters,\nthe encryption must have been done with the same parameters.\n\n```\n Parameters\n -----------\n data: bytes\n The binary data to encrypt.\n\n password: str\n The password to encrypt the data with.\n\n Returns\n --------\n bytes\n Bytes object containing the decrypted data.\n\n Raises\n -------\n TypeError\n If argument datatypes are incorrect\n\n ValueError\n If argument length is incorrect\n\n RuntimeError\n If data decryption authentication fails\n\n MemoryError\n If key derivation or decryption fails\n```\n\n### `decrypt(data, password)`\n\n\nDecrypt data (assuming nonce and salt are packed in) with\ngiven password, and return decrypted data.\n\nIf data is decrypted with non-default length parameters,\nthe encryption must have been done with the same parameters.\n\n```\n Parameters\n -----------\n data: bytes\n The binary data to encrypt.\n\n password: str\n The password to encrypt the data with.\n\n Returns\n --------\n bytes\n Bytes object containing the decrypted data.\n\n Raises\n -------\n TypeError\n If argument datatypes are incorrect\n\n ValueError\n If argument length is incorrect\n\n RuntimeError\n If data decryption authentication fails\n\n MemoryError\n If key derivation or decryption fails\n```\n\n### `get_def(def_index)`\n\n\nTakes an index and returns the value of the libsodium\nconstant associated with that index.\n\nIndex -> Constant table below\n\n```\n 0 -> crypto_box_SEEDBYTES\n 1 -> crypto_pwhash_SALTBYTES\n 2 -> crypto_pwhash_PASSWD_MIN\n 3 -> crypto_pwhash_PASSWD_MAX\n 4 -> crypto_pwhash_BYTES_MIN\n 5 -> crypto_pwhash_BYTES_MAX\n 6 -> crypto_pwhash_OPSLIMIT_MIN\n 7 -> crypto_pwhash_OPSLIMIT_MAX\n 8 -> crypto_pwhash_MEMLIMIT_MIN\n 9 -> crypto_pwhash_MEMLIMIT_MAX\n 10 -> crypto_secretbox_KEYBYTES\n 11 -> crypto_secretbox_MACBYTES\n 12 -> crypto_secretbox_NONCEBYTES\n 13 -> crypto_secretbox_MESSAGEBYTES_MAX\n```\n\n```\n Parameters\n -----------\n def_index: int\n Index of the constant you want to fetch.\n\n Returns\n --------\n int\n Value of the specified constant\n\n Raises\n -------\n KeyError\n If the index has no associated constant\n```\n\n### `genkey(key_size)`\n\nGenerates a secure secret key that is `key_size` bytes long.\n\n```\n Parameters\n -----------\n key_size: int\n Determines the length of the generated key\n\n Returns\n --------\n bytes\n The generated key\n\n Raises\n -------\n ValueError\n If key size is below 32\n```\n\n### `random_bytes(buffer_size)`\n\nGenerates cryptographically-secure random bytes, up to `buffer_size`.\n\nReturns `None` if `buffer_size` is 0.\n\n```\n Parameters\n -----------\n buffer_size: int\n Determines the size of the buffer used to hold the random bytes.\n\n Returns\n --------\n bytes\n Buffer of random bytes\n```\n\n### `hexdigest(data)`\n\nReturns the hexdigest for the given value.\n\nReturns `None` if `data` is empty.\n\n```\n Parameters\n -----------\n data: bytes\n Bytes object to calculate the hexdigest for.\n\n Returns\n --------\n str\n The hexdigest in string format.\n\n Raises\n -------\n MemoryError\n If memory could not be allocated for the hex buffer\n```\n\n### `derive_key(password, salt, key_size)`\n\nDerives a secret key from a password and hash using the Argon2id algorithm.\nGenerated key is `key_size` bytes long.\n\nReturns `None` if any argument is empty.\n\n```\n Parameters\n -----------\n password: str\n Password to use for key derivation.\n\n salt: bytes\n Bytes object storing the salt to use for key derivation.\n\n key_size: int\n Determines size of the generated key.\n\n Returns\n --------\n bytes\n The secret key.\n\n Raises\n -------\n MemoryError\n If memory could not be allocated for derivation.\n```\n\n### `encrypt_secret(data, key, nonce)`\n\nEncrypts `data` with `key` and `nonce`, using the\nXSalsa20 stream cipher for encryption and Poly1305\nMAC for authentication.\n\nReturns `None` if any argument is empty.\n\n```\n Parameters\n -----------\n data: bytes\n The data to encrypt.\n\n key: bytes\n The secret key to use for encryption.\n\n nonce: bytes\n The nonce to use for encryption.\n\n Returns\n --------\n bytes\n The encrypted data, signed with the MAC tag.\n\n Raises\n -------\n MemoryError\n If memory could not be allocated for encryption\n\n RuntimeError\n If encryption fails\n```\n\n### `decrypt_secret(data, key, nonce)`\n\nDecrypts `data` with `key` and `nonce`, using the\nXSalsa20 stream cipher for encryption and Poly1305\nMAC for authentication.\n\nReturns `None` if any argument is empty.\n\n```\n Parameters\n -----------\n data: bytes\n The data to decrypt.\n\n key: bytes\n The secret key to use for decryption.\n\n nonce: bytes\n The nonce to use for decryption.\n\n Returns\n --------\n bytes\n The decrypted data.\n\n Raises\n -------\n MemoryError\n If memory could not be allocated for decryption\n\n RuntimeError\n If decryption authentication fails\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.a-sketchy.site/AnonymousDapper/ct_crypto", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ct-crypto", "package_url": "https://pypi.org/project/ct-crypto/", "platform": "", "project_url": "https://pypi.org/project/ct-crypto/", "project_urls": { "Homepage": "https://gitlab.a-sketchy.site/AnonymousDapper/ct_crypto" }, "release_url": "https://pypi.org/project/ct-crypto/0.0.62/", "requires_dist": null, "requires_python": "", "summary": "Fast module for PyChickenTicket crypto work", "version": "0.0.62" }, "last_serial": 4233094, "releases": { "0.0.6": [ { "comment_text": "", "digests": { "md5": "822f7d4c1ffbde90ed6ca4e2f1062636", "sha256": "782bcd4b9b844a368b754207fd712c82bb3826a70c2ee2d8b57cd21e47562d0d" }, "downloads": -1, "filename": "ct_crypto-0.0.6.tar.gz", "has_sig": false, "md5_digest": "822f7d4c1ffbde90ed6ca4e2f1062636", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7655, "upload_time": "2018-09-03T01:41:22", "url": "https://files.pythonhosted.org/packages/82/80/f72b71d86f2d4fd3cce833e03ffd02fa190bcc881fc33b64f6ba2551c2dd/ct_crypto-0.0.6.tar.gz" } ], "0.0.61": [ { "comment_text": "", "digests": { "md5": "7a7fd50cb16baf882ee0b72e540e565e", "sha256": "242f3a44b8ceacb67001e2c04d65561c0971b9498eeb83068bb12b40c45713bc" }, "downloads": -1, "filename": "ct_crypto-0.0.61.tar.gz", "has_sig": false, "md5_digest": "7a7fd50cb16baf882ee0b72e540e565e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7366, "upload_time": "2018-09-03T01:49:05", "url": "https://files.pythonhosted.org/packages/f1/8d/4edc5735e92f3e34cd52232f76ac864d0d519c527d6c59cbbd7df8732809/ct_crypto-0.0.61.tar.gz" } ], "0.0.62": [ { "comment_text": "", "digests": { "md5": "586a55cc87c78b552a2d7a4a7073e82b", "sha256": "5fd349081148ac3b081edad05bdbfb34addb2c474e7102e2cbf26b53f149035b" }, "downloads": -1, "filename": "ct_crypto-0.0.62.tar.gz", "has_sig": false, "md5_digest": "586a55cc87c78b552a2d7a4a7073e82b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7369, "upload_time": "2018-09-03T02:14:43", "url": "https://files.pythonhosted.org/packages/ae/9b/317b9d455c79deef69b4b96d9a994158086cc821d21ea92cf82212b920ee/ct_crypto-0.0.62.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "586a55cc87c78b552a2d7a4a7073e82b", "sha256": "5fd349081148ac3b081edad05bdbfb34addb2c474e7102e2cbf26b53f149035b" }, "downloads": -1, "filename": "ct_crypto-0.0.62.tar.gz", "has_sig": false, "md5_digest": "586a55cc87c78b552a2d7a4a7073e82b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7369, "upload_time": "2018-09-03T02:14:43", "url": "https://files.pythonhosted.org/packages/ae/9b/317b9d455c79deef69b4b96d9a994158086cc821d21ea92cf82212b920ee/ct_crypto-0.0.62.tar.gz" } ] }