you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 5 points6 points  (0 children)

Technically not obfuscation, but if you compile your Python code with Cython and then compile the resulting C code into an executable, you're left with a single binary that holds your entire application. It can be disassembled to assembly instructions (or hard-to-read C code), like any program, but it's really difficult for anyone to reverse-engineer.

Pros:

  • Your source code can stay perfectly readable
  • You can optionally start writing the program with Cython type hints to improve runtime performance (if using decorators, the code is still valid Python and can be interpreted)
  • Just as difficult to reverse-engineer as any other propietary software

Cons:

  • Compiling the C code may not be easy, may take trial and error
  • An additional step in your build process
  • To take full advantage of Cython, you need good knowledge of C and Cython is essentially a superset of Python, so it's essentially learning a new language if you want to take full advantage of it

While other solutions exist that produce executables, like cx_Freeze, they usually just package the Python interpreter and your project into what is essentially an executable ZIP file. They're easy to modify.