python obfuscate

Michael Torrie torriem at gmail.com
Fri Apr 11 11:19:08 EDT 2014


On 04/10/2014 07:29 PM, Wesley wrote:
> Hi all, Does python has any good obfuscate?
> 
> Currently our company wanna release one product developed by python
> to our customer. But dont's wanna others see the py code.
> 
> I googled for a while but mostly just say using pyc. Any better one?
> 
> Our product is deployed on Linux bed.

I guess it all depends on what you are really trying to do.

If you're trying to prevent people from making and using unauthorized
copies of your software then even obfuscating the code certainly won't
help that at all.

If you're trying to prevent people from learning trade secrets, then
simply don't put that part of your product in the hands of customers.
And on this point the language doesn't matter.  Could be a binary
compiled from C++.  Someone could, in theory, reverse-engineer and trace
the code and uncover your secret algorithm.  The question is, is it
worth it for the mythical, theoretical, bad guy to do this?  Is it worth
it for you to go to lengths to prevent this theoretical possibility?

If you have IP you truly need to keep secret, separate it out from your
application and stick it on a server and talk to it over some form of RPC.

If you're simply trying to keep the boss happy, simply wrapping up your
python scripts into a self-contained executable format (say py2exe or a
similar tool) is probably good enough.

Most end users will never know or care what you build the app with, even
if you have a directory full of open .py files.  99% of the users of a
popular ebook app called Calibre never know or care that it's made of
python and that you could go in and see the code.  All they care about
is they can click an icon and the program launches and runs.



More information about the Python-list mailing list