Protect Python Source

Lemniscate d_blade8 at hotmail.com
Fri Nov 1 15:00:11 EST 2002


Christian Tismer <tismer at tismer.com> wrote in message news:<mailman.1036145342.13403.python-list at python.org>...
> Using the Installer gives you the advantage that
> no source code can be seen and even no bytecode
> is visible in the first place. It is of course ungzipped
> from the executable at execution time, but there are
> no visible files, it is in memory, only.

Actually, this isn't quite true.  If you open the exe generated by the
Installer with a text editing program (even NotePad works), your code
is visible in the code (just do a search for you imports or a def
statement and you'll find it.  Usually, I find it in either the dead
center of the file, or towards the end of the file.  In fact, if you
cut and paste, you will have your code back (I've actually done this
before when my wife deleted some of my source back-ups, and it works
perfectly).  Just another warning, putting code out there that you
think is secure because it looks obscure is NEVER a good choice.

For some interesting reading (and some nice laughs along the way),
check out: http://groups.google.com/groups?hl=en&lr=&ie=ISO-8859-1&q=obfuscation&meta=group%3Dcomp.lang.python.*

Have fun,

Lem



More information about the Python-list mailing list