Falldog / pyconcrete

Protect your python script, encrypt it as .pye and decrypt when import it
Apache License 2.0
702 stars 150 forks source link

Trying to license and protect some software I created #13

Closed ghost closed 7 years ago

ghost commented 7 years ago

I'm looking for ways to encrypt my code, compile it and lock it to a user's computer. Will I also be able to compile my script into an exe without a problem even if I use your encryption?

Falldog commented 7 years ago

@jimmycorkhill pyconcrete Apache License is fine for commercial use, so there is no problem. :)

ghost commented 7 years ago

Sorry, I mean license as in serial codes and license keys.

I am selling some software for a game, but there will be attempts to hack it and distribute it for free.

I'm attempting to lock the script to a single user's PC and I want to stop the software being easily reverse-engineered.

Does pyconcrete compile to .exe at all?

Falldog commented 7 years ago

pyconcrete doesn't support the function currently. Short term, you could try on compile .exe by yourself. Reference Embedded python

Compile .exe in embedded python. The source .c maybe look like below

#include <Python.h>

int main(int argc, char *argv[])
{
  Py_SetProgramName(argv[0]);  /* optional but recommended */
  Py_Initialize();
  PyRun_SimpleString("import pyconcrete\n"
                     "import src\n"
                     "src.main()\n");
  Py_Finalize();
  return 0;
}

Long term, pyconcrete may include this feature in setup.py

Falldog commented 7 years ago

Hi @jimmycorkhill You can use new pyconcrete executable file to distribute different license key (pyconcrete) to customers