Python obfuscator online
(as a web form)
Seriously, this form is offline because python 2.4 is kind of old to support nowadays. Sorry!

News about this obfuscator demo

This web form obfuscates your one-file Python program or module within seconds. It is based on a limited version of the larger-scale BitBoost Python obfuscator, which obfuscates much more complicated programs or packages.

It achieves NON-1:1 mapping of identifiers within your program to obfuscated identifiers. For example, not only is 'self' no longer 'self', but 'self' is generally replaced by a variety of different gibberish identifiers, without impairing program functionality.

Docstrings and comments are also removed.

As a limited demo, this webpage only supports:

Please paste your source code into the box below.

12345678901234567890123456789012345678901234567890123456789012345678901234567890
         1         2         3         4         5         6         7         8

Names to specially spare from obfuscation (but obfuscator should automatically spare most names that are imported from non-obfuscated libraries etc.):


WARNING! Because a table of the main obfuscated identifiers is appended to the demo's output, you should remove that table before you use the obfuscated code!

I would appreciate your feedback about this online obfuscator. Perhaps you would even like to license a more complete version of my obfuscator toolkit?

Click here for contact information.

Please report any bugs!


Technical Commentary

Limits on handling of keyword arguments

Correctly obfuscating python code that includes function or method calls with keyword arguments can have interesting complications.

The full (not free demo) version of the obfuscator supports various options for correctly handling code that includes function or method calls with keyword arguments.

That full range of options is not included in this free web form demo version.

If you make a function call with keyword arguments, the keyword argument names in the function call are presently left unobfuscated in this free demo version of the obfuscator. You might wonder, why does this make some sense as a simple default behavior?

You could read the explanation in the manual of the more full-featured python obfuscator, or you could read the shorter example below.

Suppose the keyword arguments are going into a dictionary, as in this example code from Guido van Rossum's Python Tutorial (Release 2.4.2) wherein the dictionary is named "keywords" ...

  def cheeseshop(kind, *arguments, **keywords):
    print "-- Do you have any", kind, '?'
    print "-- I'm sorry, we're all out of", kind
    for arg in arguments: print arg
    print '-'*40
    keys = keywords.keys()
    keys.sort()
    for kw in keys: print kw, ':', keywords[kw]
  cheeseshop('Limburger', "It's very runny, sir.",
             "It's really very, VERY runny, sir.",
             client='John Cleese',
             shopkeeper='Michael Palin',
             sketch='Cheese Shop Sketch')  
which is intended to print:
  -- Do you have any Limburger ?
  -- I'm sorry, we're all out of Limburger
  It's very runny, sir.
  It's really very, VERY runny, sir.
  ----------------------------------------
  client : John Cleese
  shopkeeper : Michael Palin
  sketch : Cheese Shop Sketch  
The latter part of the output would be totally ruined if we simply obfuscate the keyword argument names, which would change the words 'client', 'shopkeeper' and 'sketch'.


© Copyright 2002-2012 by Chris Niswander. All Rights Reserved.
unimportant tiny image