How to protect python code ?

A. Lloyd Flanagan alloydflanagan at attbi.com
Tue Apr 8 09:39:09 EDT 2003


msw <markscottwright at hotmail.com> wrote in message news:<3E921A4C.1020908 at hotmail.com>...
> Dave Brueck wrote:
> > On Mon, 7 Apr 2003, msw wrote:
...
> >>
> >>I'm really interested in this as well, and I think that it's an
> >>important issue for python.  Unfortunately, as I'm sure you've
> >>discovered by now, it's a question that comp.lang.python is
> >>constitionally incapable of answering.  The only answers you will get in
> >>this group are:
> >>
> >>1. intellectual property law is sufficient
> >>2. no protection scheme is perfect
> > 
> > 

I'm going to make a suggestion you may not hear from anybody else in
this group.  If hiding the code is important to you, don't use Python.
 Use C++ or something similiar.

Python was deliberately NOT designed to make it easy to obfuscate or
hide the code.  It's designed for power, readability, and fairly open
access to the internals of the class implementation.  I'd suggest that
the reasons you don't find more on code hiding are two-fold:  1) it's
somewhat technically difficult, and 2) most python users have no need
for it.

So quite aside from points 1 and 2 above, my suggestion is that you're
trying to insert a screw with a socket wrench -- you've just plain got
the wrong tool for the job.  Of course, if the program is written
already, it's a little late to be discovering this.

What about coding the sensitive algorithms in C and calling them from
python?  There are of course decompilers for C as well, but it's at
least harder.




More information about the Python-list mailing list