The plugboard is essentially a configurable reflector. See the Enigma Simulator section below for a link to an easy-to-use Enigma.
The double-step algorithm can be implemented more simply and more generalized: At each step, the set of rotors that rotate is all rotors that is in the notch position, plus the rotors after each of those, plus the first rotor. Any time you have a function of the form function() ask yourself "Why isn't this two functions?" British scientist Alan Turing, leveraging on earlier breakthrough by three Polish military intelligence cryptanalysts Marian Rejewski, Jerzy. Enigma machines were widely used by Nazi Germany during the World War 2.
Split up the forward and backward direction through the rotors into two functions. The Enigma machines were a series of electromechanical rotor ciphers based on a German engineer, Arthur Scherbius's invention 5. Either make those static constants/factories or pull them up (into Enigma) Rotors and reflectors should be fully configurable instead of taking a name for predefined rotors/reflector. Enigma machines became more and more complex and were heavily used by the German army.
The first machines were invented at the end of World War I by German engineer Arthur Scherbius and were mainly used to protect commercial, diplomatic and military communication. It is easier to do arithmetic in numbers than in letters. The Enigma machines are a series of electro-mechanical rotor cipher machines. A number of these machines were used during World War 2 by the German Army, Navy and Air Force, this website has simulations for both the three rotor Enigma I used by the Heer (Army) and Luftwaffe (Air Force) and the four rotor Enigma M4 used by the Kriegsmarine (German Navy). I'd work mostly in numbers and convert to/from letter only for input/output. Enigma is the brand name of a series of cipher machines developed in Germany between 19. If you do not care about browser support, or only targeting these browsers, use es modules. from pyenigma import enigma > from pyenigma import rotor > print(rotor.ROTORGRIII) Name: III Model: German.