Rotor: WWII Enigma

Rotor is a software implementation of the German Enigma machine of WW II.   Rotor was once included in the Python standard library, but was removed from Python 2.4, in large part because Rotor is not considered cryptographically strong, but Rotor can be effective for instructional and low-value encryption purposes.  

Note: THIS CODE IS PROVIDED WITHOUT WARRANTY OR GUARANTEE OF ANY KIND.
             USE AT YOUR OWN RISK.

 
Usage:

    import rotor
    
    mykey     = 'abcd'
    numrotors = 12
    message   = 'Kilroy was here'
    
    r = rotor.newrotor(mykey, numrotors)
    ciphertext = r.encrypt(message)
    
    r2 = rotor.newrotor(mykey, numrotors)
    plaintext = r2.decrypt(ciphertext)
    
        
Download:

    source, demos, etc rotor.zip dnld
    compiled for Python 2.5 MacOSX PPC and x86 dnld
    compiled for Python 2.4 MacOSX PPC dnld
    Linux PPC dnld
    Linux x86 dnld
    win32 dnld

 
References:

      http://en.wikipedia.org/wiki/Enigma_machine
      http://www.python.org/doc/2.2.3/lib/module-rotor.html
      http://effbot.org/librarybook/rotor.htm

 

Larry Bugbee, July 2006