{"id":13605122,"url":"https://github.com/Falldog/pyconcrete","last_synced_at":"2025-04-12T02:32:49.750Z","repository":{"id":25460033,"uuid":"28890319","full_name":"Falldog/pyconcrete","owner":"Falldog","description":"Protect your python script, encrypt it as .pye and decrypt when import it","archived":false,"fork":false,"pushed_at":"2025-02-25T22:50:36.000Z","size":5518,"stargazers_count":719,"open_issues_count":6,"forks_count":154,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-11T07:07:48.662Z","etag":null,"topics":["obfuscate","obfuscation","protection","python","python-encryption","python-library"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Falldog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-07T00:24:28.000Z","updated_at":"2025-04-10T06:06:04.000Z","dependencies_parsed_at":"2024-04-09T01:49:32.878Z","dependency_job_id":"8dde30e8-f6fc-449a-b6bc-0c5a2fd5ef4a","html_url":"https://github.com/Falldog/pyconcrete","commit_stats":{"total_commits":173,"total_committers":12,"mean_commits":"14.416666666666666","dds":0.2832369942196532,"last_synced_commit":"41913e7977a6ae9cf2efd05e1aae6dc678838405"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falldog%2Fpyconcrete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falldog%2Fpyconcrete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falldog%2Fpyconcrete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falldog%2Fpyconcrete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Falldog","download_url":"https://codeload.github.com/Falldog/pyconcrete/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506933,"owners_count":21115510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["obfuscate","obfuscation","protection","python","python-encryption","python-library"],"created_at":"2024-08-01T19:00:54.887Z","updated_at":"2025-04-12T02:32:49.744Z","avatar_url":"https://github.com/Falldog.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"pyconcrete\n==============\n[![Travis](https://img.shields.io/travis/Falldog/pyconcrete.svg?label=travis)](https://travis-ci.org/Falldog/pyconcrete)\n[![AppVeyor](https://img.shields.io/appveyor/ci/Falldog/pyconcrete.svg?label=appveyor)](https://ci.appveyor.com/project/Falldog/pyconcrete)\n[![PyPI Version](https://img.shields.io/pypi/v/pyconcrete.svg)](https://pypi.python.org/pypi/pyconcrete)\n[![PyPI PyVersion](https://img.shields.io/pypi/pyversions/pyconcrete.svg)](https://pypi.python.org/pypi/pyconcrete)\n[![PyPI License](https://img.shields.io/pypi/l/pyconcrete.svg)](https://pypi.python.org/pypi/pyconcrete)\n\nProtect your python script, encrypt .pyc to .pye and decrypt when import it\n\n--------------\n\n\nProtect python script work flow\n--------------\n* Build the execution `pyconcrete` and read the `MAIN.pye` which encrypted by your passphrase.\n* pyconcrete will decrypt the source file and then launch python interpreter to do the normal python behavior.\n* pyconcrete will hook import module\n* when your script do `import MODULE`, pyconcrete import hook will try to find `MODULE.pye` first\n  and then decrypt `MODULE.pye` via `_pyconcrete.pyd` and execute decrypted data (as .pyc content)\n* encrypt \u0026 decrypt secret key record in `_pyconcrete.pyd` (like DLL or SO)\n  the secret key would be hide in binary code, can't see it directly in HEX view\n\n\nEncryption\n--------------\n* only support AES 128 bit now\n* encrypt \u0026 decrypt by library OpenAES\n\n\nCompatibility\n--------------\nPyconcrete has transitioned to using [meson-python](https://github.com/mesonbuild/meson-python) as its build backend\nstarting from version 1.0.0. This provides a more powerful build mechanism and supports newer Python versions.\n\nFor older Python support:\n* Pyconcrete versions prior to 0.15.2 only support up to Python 3.10.\n* If you need support for Python 3.6 or Python 2.7, please use versions before 0.15.2.\n* Pyconcrete no longer supports Python versions earlier than 3.6.\n\n\nRequirements\n--------------\nFor unix base\n* apt: pkg-config, build-essential, python{version}-dev\n* pip: 23.1+\n\n\nInstallation\n--------------\nDue to security considerations, you must provide a passphrase to create a secret key for encrypting Python scripts:\n* The same passphrase will generate the same secret key.\n* Pre-built packages are not provided, so users must build the package yourself.\n\nBuild Process\n* Pyconcrete relies on Meson to compile the C extension.\n* The installation process will add a `pyconcrete.pth` file to your `site-packages`, enabling `sitecustomize.py` to automatically import Pyconcrete.\n\n### pip\n* Need to config the passphrase for installation. And only pip 23.1+ support passing argument via `-C` or `--config-settings`.\n* Remember to assign `--no-cache-dir` to avoid use pip's cached package which already built by old passphrase.\n```sh\n$ pip install pyconcrete \\\n  --no-cache-dir \\\n  --config-settings=setup-args=\"-Dpassphrase=\u003cYour_Passphrase\u003e\"\n```\n\n* Available arguments. Setup by `--config-settings=setup-args=\"-D\u003cargurment_name\u003e=\u003cvalue\u003e\"`\n  * `passphrase`: (Mandatory) To generate secret key for encryption.\n  * `ext`: Able to assign customized encrypted file extension. Which default is `.pye`.\n\nUsage\n--------------\n\n### Full encrypted\n* convert all of your `.py` to `*.pye`\n```sh\n$ pyecli compile --pye -s=\u003cyour py script\u003e\n$ pyecli compile --pye -s=\u003cyour py module dir\u003e\n$ pyecli compile --pye -s=\u003cyour py module dir\u003e -e=\u003cyour file extension\u003e\n```\n\n* remove `*.py` `*.pyc` or copy `*.pye` to other folder\n* *main*.py encrypted as *main*.pye, it can't be executed by normal `python`.\nYou must use `pyconcrete` to process the *main*.pye script.\n`pyconcrete`(*exe*) will be installed in your system path (ex: /usr/local/bin)\n\n```sh\npyconcrete main.pye\nsrc/*.pye  # your libs\n```\n\n\n### Partial encrypted (pyconcrete as lib) -\u003e (DEPRECATED and not Safe)\n* import pyconcrete in your main script\n  * project layout\n```sh\nmain.py       # import pyconcrete and your lib\npyconcrete/*  # put pyconcrete lib in project root, keep it as original files\nsrc/*.pye     # your libs\n```\n\n\nTest\n--------------\n* test in local\n```sh\n$ pytest tests\n```\n\n* test in docker environment\n```sh\n$ make test\n```\n\n* test in docker environment for specific python version\n```sh\n$ make test 3.10\n```\n\nExample\n--------------\n\n[Django with pyconcrete](example/django)\n\n\n### Reference\nhttps://matthew-brett.github.io/pydagogue/python_msvc.html\nhttps://github.com/cython/cython/wiki/CythonExtensionsOnWindows\n\n\nAnnouncement\n--------------\npyconcrete is an experimental project, there is always a way to decrypt .pye files, but pyconcrete just make it harder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFalldog%2Fpyconcrete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFalldog%2Fpyconcrete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFalldog%2Fpyconcrete/lists"}