{ "info": { "author": "Soroco Americas Private Limited", "author_email": "opensource@soroco.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: Microsoft :: Windows :: Windows 10", "Operating System :: Microsoft :: Windows :: Windows Server 2008", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.7", "Topic :: Security :: Cryptography", "Topic :: Software Development :: Build Tools" ], "description": "# PYCE\n\n`pyce` is a library to work with encrypted Python bytecode. It adds\nfunctionality to a Python runtime by extending the way the builtin keyword\n`import` works. Currently, it assumes that convergent encryption will be used,\nbut the library can be extended. For example, functionality could be added to\ndecrypt files via [Hashicorp's Vault](https://www.vaultproject.io/) (which also\nsupports convergent encryption as a mode of operation).\n\n`pyce` enables the creation of a Trusted Computing Python environment by\nensuring each deployed file is precisely what the developer intended by\nenforcing end-to-end encryption. Execution halts if even a single bit of an\nimported Python file is modified.\n\n## How do I use it?\n\nFirst, you'll want to encrypt a module or package. **Note: this is a\ndestructive action.** Do not run this on a codebase that is not saved\nelsewhere. This can recursively operate on folders, and supports exclusion\nlists (to not encrypt certain files).\n\n`pyce` expects files to be pre-compiled Python bytecode, using a command\nsimilar to `python3 -mcompileall -b` where `-b` does an in place compilation.\n\n```python\nfrom pyce import encrypt_path\nencrypt_path('pyce/hello.pyc')\n[('pyce/hello.pyce', '443df1d5f9914d13ed27950dd81aa2dd9d3b708be416c388f3226ad398d71a14')]\n```\n\nSecond, register your keys and try importing from the encrypted module or\npackage:\n\n```python\nfrom pyce import PYCEPathFinder\nPYCEPathFinder.KEYS = {'pyce/hello.pyce' : '443df1d5f9914d13ed27950dd81aa2dd9d3b708be416c388f3226ad398d71a14'}\n\nimport sys\nsys.meta_path.insert(0, PYCEPathFinder)\nfrom pyce.hello import hello\nhello()\n```\n\nKey distribution is outside the scope of this project. You will need to\nmaintain keys typically by using a networked key server such as [Hashicorp's\nVault](https://www.vaultproject.io/). You could pass keys by environment\nvariable, `stdin`, or some other mechanism.\n\nTypically, you will leave (exclude) a stub file that is designed to just hook\nPython's import path parsers, setup the keys, and then execute your code.\n\n\n## What can I do with it?\n\n**File Integrity Monitoring:** You could protect your production code running\non application servers by adding in automatic cryptographic checks of imports.\n\n**Licensing:** You could publish encrypted modules to PyPI and only release\ndecryption keys to certain organizations, people, or others! You could publish\nsuch modules anywhere!\n\n**At-rest Code Protection:** You could just protect code at rest by integrating\non-the-fly decryption with an IDE or other software. This would be more of a\nDIY project at this point in time, but `pyce` gives you all the building blocks\nyou need!\n\n## License\n\nAll of this code is released under the [Apache v2.0\nLicense](https://www.apache.org/licenses/LICENSE-2.0).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/soroco/pyce", "keywords": "cryptography encryption import pyce", "license": "Apache Software License Version 2.0", "maintainer": "Soroco Americas Private Limited", "maintainer_email": "opensource@soroco.com", "name": "pyce", "package_url": "https://pypi.org/project/pyce/", "platform": "Windows 10", "project_url": "https://pypi.org/project/pyce/", "project_urls": { "Homepage": "https://github.com/soroco/pyce" }, "release_url": "https://pypi.org/project/pyce/2.0.0/", "requires_dist": [ "cryptography (==2.3.1)" ], "requires_python": ">=3.7, <3.8", "summary": "Execute encrypted Python bytecode.", "version": "2.0.0" }, "last_serial": 4298946, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "98178c34f1a8d31f8af95727792a1560", "sha256": "33d77ebe84414bb7ae23229bea9fe3ec6a492d618e8f836a1867f5aae69712a6" }, "downloads": -1, "filename": "pyce-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "98178c34f1a8d31f8af95727792a1560", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6, <=3.7", "size": 8948, "upload_time": "2018-07-29T14:53:40", "url": "https://files.pythonhosted.org/packages/0a/b8/4730349f86114d4ad6410e2d363855fefa42e37218886c833154cbae824d/pyce-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d3789e9cb7d3fd99214e43414f015fb5", "sha256": "0eeea00d70385740d59ecbb1482101973fee2ac876203155f00f6a0e6f34426e" }, "downloads": -1, "filename": "pyce-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d3789e9cb7d3fd99214e43414f015fb5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <=3.7", "size": 7179, "upload_time": "2018-07-29T14:53:41", "url": "https://files.pythonhosted.org/packages/40/cf/9e4f0a388e6bea327af5f5fcba0002c9c64bc77d6d08ba02812669008111/pyce-1.0.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "53294a9fb78b48e92f5e96909b08e3f4", "sha256": "3a679de025d444dc66250ed73a52f61ef2930ff595b69ba471d6ba438253f877" }, "downloads": -1, "filename": "pyce-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "53294a9fb78b48e92f5e96909b08e3f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7, <3.8", "size": 9055, "upload_time": "2018-09-22T06:34:42", "url": "https://files.pythonhosted.org/packages/39/79/cba14351f49d92d9ece1a5d25700808304a13ba7c57c275397ff7945b894/pyce-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ddaf7ae13db5f01fd0c551874fe961f", "sha256": "edb5d4d44ebec0453f76d7930c85c92af2c036b6ecd5d1ad83f6c3213c7be758" }, "downloads": -1, "filename": "pyce-2.0.0.tar.gz", "has_sig": false, "md5_digest": "1ddaf7ae13db5f01fd0c551874fe961f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7, <3.8", "size": 7265, "upload_time": "2018-09-22T06:34:44", "url": "https://files.pythonhosted.org/packages/4e/cd/9d8d9299e8ad81a0fa0352d242f269a2789228c3976f622c9364ef7e2723/pyce-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "53294a9fb78b48e92f5e96909b08e3f4", "sha256": "3a679de025d444dc66250ed73a52f61ef2930ff595b69ba471d6ba438253f877" }, "downloads": -1, "filename": "pyce-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "53294a9fb78b48e92f5e96909b08e3f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7, <3.8", "size": 9055, "upload_time": "2018-09-22T06:34:42", "url": "https://files.pythonhosted.org/packages/39/79/cba14351f49d92d9ece1a5d25700808304a13ba7c57c275397ff7945b894/pyce-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ddaf7ae13db5f01fd0c551874fe961f", "sha256": "edb5d4d44ebec0453f76d7930c85c92af2c036b6ecd5d1ad83f6c3213c7be758" }, "downloads": -1, "filename": "pyce-2.0.0.tar.gz", "has_sig": false, "md5_digest": "1ddaf7ae13db5f01fd0c551874fe961f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7, <3.8", "size": 7265, "upload_time": "2018-09-22T06:34:44", "url": "https://files.pythonhosted.org/packages/4e/cd/9d8d9299e8ad81a0fa0352d242f269a2789228c3976f622c9364ef7e2723/pyce-2.0.0.tar.gz" } ] }