Skip to content

samirotiv/pyconcrete

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyconcrete

Protect your python script, encrypt .pyc to .pye and decrypt when import it


Version

0.9.x Beta

Protect python script work flow

  • your_script.py import pyconcrete
  • pyconcrete will hook import module
  • when your script do 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)
  • encrypt & decrypt secret key record in _pyconcrete.pyd (like DLL or SO) the secret key would be hide in binary code, can't see it directly in HEX view

Encryption

  • only support AES 128 bit now
  • encrypt & decrypt by library OpenAES

Usage

  • get the pyconcrete source code
$ git clone <pyconcrete repo> <pyconcre dir>
  • install pyconcrete
$ python setup.py install
  • need to input your passphrase create secret key for encrypt python script.

  • same passphrase will generate the same secret key

  • convert your script to *.pye

$ pyconcrete-admin.py compile_pye --file=<your py script>
$ pyconcrete-admin.py compile_all_pye --dir=<your py module dir>
  • remove *.py or copy *.pye to other folder

  • import pyconcrete in your main script

    • recommendation project layout
main.py  # import pyconcrete and your lib
src/*.pye  # your libs

Usage (pyconcrete as lib)

  • install pyconcrete as lib
$ python setup.py install \
  --install-lib=<your project path> \
  --install-scripts=<where you want to execute pyconcrete-admin.py>
  • import pyconcrete in your main script
    • recommendation project layout
main.py       # import pyconcrete and your lib
pyconcrete/*  # put pyconcrete lib in root, keep it as original files
src/*.pye     # your libs

About

Protect your python script, encrypt it as .pye and decrypt when import it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 75.9%
  • Python 19.9%
  • CMake 2.8%
  • C++ 1.4%