Friday, 11 February 2011

Python obfuscation

Well there's plenty of talk out there about Python obfuscation. But basically its frowned upon by most, and not that easy (though that's really the case for most languages). But if you'd like to make it a bit harder for people to rip-off your code, then these seem to be the ways to do it:
  • Compile Python code into .pyc - using Python's in-built compileall module - in your code dir run (then delete all your .py files and you can run the .pyc files):
    python -mcompileall .
  • Use [cx]Freeze (or py2exe) to compile your Python project into an executable
  • Use a Python source code obfuscater like this one or that (both a bit old)
  • Use cython instead of Python
  • There are some commercial products out there too (e.g. this)

No comments:

Post a Comment