
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Protect your python script, encrypt .pyc to .pye and decrypt when import it
pyconcrete
and read the MAIN.pye
which encrypted by your passphrase.import MODULE
, pyconcrete import hook will try to find MODULE.pye
first
and then decrypt MODULE.pye
via _pyconcrete.pyd
and execute decrypted data (as .pyc content)_pyconcrete.pyd
(like DLL or SO)
the secret key would be hide in binary code, can't see it directly in HEX viewPyconcrete has transitioned to using meson-python as its build backend starting from version 1.0.0. This provides a more powerful build mechanism and supports newer Python versions.
For older Python support:
For unix base
For windows base
Due to security considerations, you must provide a passphrase to create a secret key for encrypting Python scripts:
Build Process
-C
or --config-settings
.--no-cache-dir
to avoid use pip's cached package which already built by old passphrase.# basic usage
$ pip install pyconcrete \
--no-cache-dir \
--config-settings=setup-args="-Dpassphrase=<Your_Passphrase>"
# assign multiple options
$ pip install pyconcrete \
--no-cache-dir \
--config-settings=setup-args="-Dpassphrase=<Your_Passphrase>" \
--config-settings=setup-args="-Dmode=exe" \
--config-settings=setup-args="-Dinstall-cli=true"
--config-settings=setup-args="-D<argurment_name>=<value>"
passphrase
: (Mandatory) To generate secret key for encryption.ext
: Able to assign customized encrypted file extension. Which default is .pye
.mode
: exe
or lib
. Which default is exe
.install-cli
: Determine to install pyecli
or not. Which default is true
.py
to *.pye
$ pyecli compile --pye -s=<your py script>
$ pyecli compile --pye -s=<your py module dir>
$ pyecli compile --pye -s=<your py module dir> -e=<your file extension>
*.py
*.pyc
or copy *.pye
to other folderpython
.
You must use pyconcrete
to process the main.pye script.
pyconcrete
(exe) will be installed in your system path (ex: /usr/local/bin)
pyconcrete main.pye
src/*.pye # your libs
mode=lib
when installationmain.py # import pyconcrete and your lib
pyconcrete/* # put pyconcrete lib in project root, keep it as original files
src/*.pye # your libs
$ pytest tests
$ make test
$ make test 3.10
Example environment: Windows 11, Visual Studio 2022
..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
..\meson.build:23:31: ERROR: Python dependency not found
https://mesonbuild.com/SimpleStart.html
pyconcrete is an experimental project, there is always a way to decrypt .pye files, but pyconcrete just make it harder.
FAQs
Protect your python script, encrypt .pyc to .pye and decrypt when import it
We found that pyconcrete demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.