Any reliable obfurscator for Python 2.5

Steve Holden steve at holdenweb.com
Sun Apr 20 10:13:46 EDT 2008


Banibrata Dutta wrote:
> 
> 
> On 4/20/08, *Gabriel Genellina* <gagsl-py2 at yahoo.com.ar 
> <mailto:gagsl-py2 at yahoo.com.ar>> wrote:
> 
>     En Sun, 20 Apr 2008 01:55:51 -0300, Banibrata Dutta
>     <banibrata.dutta at gmail.com <mailto:banibrata.dutta at gmail.com>> escribió:
> 
>      > Wanted to check if there is any known, reliable, FOSS/Libre --
>     Obfurscator
>      > for Python 2.5 code.
> 
>     Why do you want to do that in the first place?
> 
>  
> I need to do to retain the confidentiality for certain core components, 
> which are not supposed to be open. While I do have the option of 
> implementing them in C/C++, I'm trying to see if I can avoid that for 2 
> reasons --
> 1. Its a fairly large and complex set of components, and doing it in 
> C/C++ 'might' take significantly longer.
> 2. I'd try to avoid having mix of languages if possible. It makes the 
> developement easier to maintain/manage over a period of time.
> 
>     There is very few you can do to obfuscate Python code. You can't
>     rename classes nor methods nor global variables nor argument names
>     due to the dynamic nature of Python. All you can safely do is to
>     remove comments and join simple statements using ;
> 
>  
> I do not understand the nuances of dynamic languages completely, so this 
> might be a foolish assumption, but if i make a complete, self-contained 
> Python application (collection of modules), then just before shipping a 
> production copy, why can't I replace 'all' symbols i.e. classes, 
> methods, variables etc ? Esply if I'm compiling the source ?
> 
>     If you remove docstrings, some things may break. Even renaming local
>     variables isn't safe in all cases.
> 
>  
> Hmmm... but I'm aware of atleast 2 Obfuscators one commercial and one 
> FOSS, that seem to exist for Python. The commercial one is what I might 
> try if I don't find anything FOSS. The FOSS one seems to be a dead 
> project. If they are (or have been) there, I guess obfuscation is a 
> doable thing, no ?
>  
The Python world isn't particularly paranoid about obfuscation. It's 
quite easy to publish compiled code only (.pyc and/or .pyo files), and 
that offers enough protection for most.

The sad fact is that there seems to be an almost direct inverse 
correlation between the worth of the code and the authors' desire to 
protect it from piracy.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list