[Python] Solving Rotor Output Issues in Enigma Machine Emulation

Discussão em 'Python' iniciado por Stack, Janeiro 29, 2025.

  1. Stack

    Stack Membro Participativo

    I'm implementing an Enigma machine in Python for a course assignment. For a specific case, I’m unable to get the expected output result as explained in one of the test cases.

    To investigate further, I emulated the input and settings using the online emulator at Enigma Machine Emulator, which produces the expected output. However, the output at each step, particularly the rotor output, is confusing for me.

    According to the test case: "With rotors I II III, reflector B, ring settings 01 01 01, and initial positions Q E V, encoding an A produces an L." Here’s my understanding (please correct me if I’m wrong):

    1. Rotor III is the rightmost rotor and is executed first.
    2. The initial setting for Rotor III is "V", which is also the notch position. Since the ring setting is 01, it does not significantly impact.
    3. For the remaining Rotors II and I, the initial settings are also set at the notch points. Therefore, by entering the first character, all three rotors will rotate.
    4. Since Rotor III's initial position is set to V (position 21), pressing the input button will increment it to position 1. According to the table mapping "BDFHJLCPRTXVZNYEIWGAKMUSQO," this should result in "U," but the Enigma emulator outputs "Y."

    If I can solve this discrepancy, I will be able to resolve the other issues.

    To use enigma Machine Emulator please enable encryption scrips and configure router as I, II, III with initial position Q E V and Reflector B.

    By pressing A, emulator Rotor III output "Y" as mentioned in screenshot.

    [​IMG]

    Continue reading...

Compartilhe esta Página