pyconcrete icon indicating copy to clipboard operation
pyconcrete copied to clipboard

Suggest to apply cython

Open koolay opened this issue 7 years ago • 3 comments
trafficstars

    def load_module(self, fullname):
        if fullname in sys.modules:  # skip reload by now ...
            return sys.modules[fullname]

        data = decrypt_buffer(self.data)  # decrypt pye
        print('----------------------------')
        print(data)   #### plaintext
        print('-------------------------------')

Since result of decrypt_buffer is plain, we can reverse the whole source code?

koolay avatar Nov 24 '17 06:11 koolay

Unfortunately ... Yes, If there is someone try to hack your python code, there is lots way to decrypt .pye to plain text. pyconcrete provide the easy way to encrypt code, but it's not safe enough for the senior python programmer.

If you want to find the more safe encryption way for python, maybe pyconcrete is not the choice.

The other options may be below

  1. modify pyconcrte execution for only execute your entry main pye only. => But, can be hack by gdb attach
  2. modify python BYTE CODE rule, but you need to modify and compile python by source
  3. the more you can do, reference Looking inside the Dropbox

Falldog avatar Nov 25 '17 15:11 Falldog

Is possible compile the python module pyconcrete use cython?

koolay avatar Nov 27 '17 02:11 koolay

cython is a good idea. But there is still a way to patch load_module() in runtime.

Build by cython will make user hard to dump it, because user need to do more thing to hack it. BTW, decrypt_buffer() return value, it should be plaintext as .pyc content. It's not the source of .py

Falldog avatar Nov 27 '17 11:11 Falldog