Larry Bugbee, July 2006Rotor: WWII EnigmaRotor 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:
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