Bottleneck: easy obscurity "encryption" via xor

Paul Rubin http
Wed Jul 30 07:21:09 EDT 2003


Tino Lange <tl_news at nexgo.de> writes:
> And it seems that Bengt's reciepe is the fastest. For very small strings
> (<255 chars) the method irmen2 should be the best choice - it doesn' have
> to pre-create the translation-table and does everything on-the-fly.

You should be able to use the array module to do the xor's 4 bytes at
a time and get a speedup over the 1-byte version.  The
string.translate version is the fastest, of course, but depends on
using the same translation table for every char in the string.

If you want to encrypt in python, try the p2.py that I posted; it's
been carefully designed with good algorithms and fairly well optimized
and should give much better security than some roll-your-own method.




More information about the Python-list mailing list