How protect proprietary Python code? (bytecode obfuscation?, what better?)

gangesmaster tomerfiliba at gmail.com
Mon Apr 17 15:01:32 EDT 2006


well, you can do something silly: create a c file into which you embed
your code, ie.,

 #include<python.h>

char code[] = "print 'hello moshe'";

void main(...)
{
    Py_ExecString(code);
}

then you can compile the C file into an object file, and use regular
obfuscators/anti-debuggers. of course people who really want to get the
source will be able to do so, but it will take more time. and isn't
that
the big idea of using obfuscation?

but anyway, it's stupid. why be a dick? those who *really* want to get
to the source will be able to, no matter what you use. after all, the
code is executing on their CPU, and if the CPU can execute it, so
can really enthused men. and those who don't want to use your product,
don't care anyway if you provide the source or not. so share.


-tomer




More information about the Python-list mailing list