import rotor

Now this is interesting. Apparently in Python versions up to 2.3, a module was included called rotor that could be used to perform Enigma machine style encryption.

Quoth the Python 2.2.3 documentation:

This module implements a rotor-based encryption algorithm, contributed by Lance Ellinghouse . The design is derived from the Enigma device, a machine used during World War II to encipher messages. A rotor is simply a permutation. For example, if the character `A’ is the origin of the rotor, then a given rotor might map `A’ to `L’, `B’ to `Z’, `C’ to `G’, and so on.

This of course has been deprecated and removed from Python 2.4 and later, but I still have no idea why such a thing was included as part of the standard distribution in the past. Of all of the encryption routines to include, I can’t say I would choose one that was broken in 1944.

That said, if you are looking for real encryption tools to plug into your code, check out the Python Cryptography Toolkit. It includes hash, block, stream, and public key encryption algorithms that should cover just about anything you would need on a routine basis.

One Response to “import rotor”

  1. phuong Says:

    Xin chao, Minh den tu HL, minh mong muon duoc lam quen voi tat ca cac ban. Thanks in advance

Leave a Reply