[Announce] pyobfuscate

From: Peter Astrand (peter_at_cendio.se)
Date: 02/17/04


Date: Tue, 17 Feb 2004 16:08:33 +0100 (CET)
To: python-list@python.org


I've written a Python source code obfuscator. The project home page is
http://www.lysator.liu.se/~astrand/projects/pyobfuscate/. I'm including a
copy of the README file below.

pyobfuscate - Python source code obfuscator
===========================================

pyobfuscate is a source code obfuscator: It makes Python source code
hard to read for humans, while still being executable for the Python
interpreter.

Why obfuscate?
--------------

Obfuscation makes little sense for Open Source
(http://www.opensource.org/) programs, but vendors developing
commercial applications are usually not happy with shipping the
original source code to customers.

Several obfuscators for other languages, like Java, already
exists. With Python, the problem is even more severe than with Java,
because Python bytecode is not compatible between different Python
versions. Also, bytecode is very easy to "decompile" to source code by
using "decompyle": http://www.crazy-compilers.com/decompyle/.

If shipping original source code is the only option for distributing
Python applications, then many vendors might choose another
programming language instead.

What does pyobfuscate do?
-------------------------

pyobfuscate transforms the source code in several ways. Some of these
transformations are reversible (can be "un-obfuscated"); some are
not. Here's a list of what pyobfuscate currently does:

* Removes comments and docstrings (not reversible)

* Changes indentation (reversible)

* Adds whitespace between tokens (somewhat reversible)

* Renames functions, classes and variables (not reversible)

* Inserts bogus lines instead of blank lines.

Limitations
-----------

pyobfuscate operates on one single source file at a time. It does not
obfuscate the interface between several files.

pyobfuscate cannot obfuscate methods, class variables or other
attributes, currently. See the TODO for more information.

-- 
Peter Åstrand		www.thinlinc.com
Cendio			www.cendio.se
Teknikringen 3		Phone: +46-13-21 46 00
583 30 Linköping


Relevant Pages

  • [Announce] pyobfuscate
    ... I've written a Python source code obfuscator. ... pyobfuscate is a source code obfuscator: ... obfuscate the interface between several files. ...
    (comp.lang.python)
  • Re: noob question: "TypeError" wrong number of args
    ... better understanding of Python's object model. ... def method: ... Python source code and outputs the same source code with only one change: ...
    (comp.lang.python)
  • Re: Why is there no Smalltalk-like IDE for Ruby?
    ... Its easy to say that - but I recently worked on a Python project and contrary to the comments others have made - I found that even some of the most recognized python IDE's are weak at cross referencing- yes they can do it but it often takes 5-10 seconds and then the resutls were placed in some other window making it awkward to see the references. ... In contrast, all of the Smalltalk implementation make cross referencing and navigation instant - its smooth, you dance between methods easily, and find what you need without thnking about it. ... Someone said to me it was becuase there is no image and so they have to look through all their possible source code - I can think of many workarounds to that - but then it occurs to me that I often have large images with all my source code in them and it doesn't seem to make a difference - so I guess its just funding. ...
    (comp.lang.smalltalk)
  • Re: hide python code !
    ... harder to turn back into source code. ... there is a version floating around which works for Python 2.4 I've ... binaries don't work on your newly-upgraded system and the vendor is on ... The question keeps getting asked because a lot of new programmers are ...
    (comp.lang.python)
  • Re: marked-up Python code
    ... I would like to experiment with marked-up Python source code. ... pieces of text in my editor and have this information saved _in my ... "all" the Python parser has to do is skip the mark-up. ...
    (comp.lang.python)