Any reliable obfurscator for Python 2.5

sturlamolden sturlamolden at
Sun Apr 20 23:55:19 CEST 2008

On Apr 20, 8:49 pm, Roy Smith <r... at> wrote:

> Hiding your source code is not easy (perhaps impossible) in Python, for
> reasons which have been covered at length on a regular basis in this forum.
> If you only ship .pyc or .pyo files, there is still enough information
> recoverable in the field that most businesses which want to keep their
> source code hidden would feel excessively exposed.

Every know and then, I see someone complaining you cannot sell
programs written i Python or Java, because the bytecodes are so easily
reverse engineered. The same guys usually have no problem with C#,
because the executable are called 'something.exe'. The fact that
a .NET executable also contain bytecodes, seems to be of little

It is very easy to obfuscate Python bytecodes beyond normal
comprehension. All that is required is to put the .pyc files in a
zipped folder and encrypt it. Then it's a matter of triviality to
produce a C program that decrypts the zipped folder, embeds a Python
interpreter, and runs the decrypted program. But even this scheme is
not foolproof against an extremely skilled and determined adversary.
Nothing really is. What measures to take depend on the threat.

If the threat prevents distribution of code in any form, one can
always provide critical parts as a web service and distribute nothing
except XML.

More information about the Python-list mailing list