Need advice for obfuscating Python code

Dave Brueck dave at pythonapocrypha.com
Tue Feb 26 22:31:08 EST 2002


Richard Jones <rjones at ekit-inc.com> wrote in message news:<mailman.1014764866.8830.python-list at python.org>...
> On Wed, 27 Feb 2002 10:28, brueckd at tbye.com wrote:
> >
> > [snip solution which encodes the module bytecode in some manner]
> >
> > That should work. Of course, since the code that decrypts and loads your
> > code will be visible, you probably want to use a long key (or another form
> > of encryption) and install the customer importer from a C program that
> > runs an embedded interpreter (installs the importer and then runs the rest
> > of your program).
> 
> Or you could bundle the encoded bytecode in a C module, which makes the 
> solution a lot neater.

Except that then you have to recompile your executable each time any
of your Python modules change, whereas with the above method you can
reuse the same executable until you need to change the key - probably
0 times during the course of development.

Like I said in my original reply though, a good license is usually
more effective anyway.

-Dave



More information about the Python-list mailing list