Skip to content

Latest commit

 

History

History
135 lines (90 loc) · 3.37 KB

machine.rst

File metadata and controls

135 lines (90 loc) · 3.37 KB

Note

This documentation is in draft form. Reports of any errors or suggestions for improvement are welcomed and should be submitted as new issues.

Machine - crypto_enigma.machine

crypto_enigma.machine

Overview

EnigmaConfig ~EnigmaConfig.config_enigma ~EnigmaConfig.config_enigma_from_string ~EnigmaConfig.windows ~EnigmaConfig.components ~EnigmaConfig.positions ~EnigmaConfig.rings ~EnigmaConfig.stage_mapping_list ~EnigmaConfig.enigma_mapping_list ~EnigmaConfig.enigma_mapping ~EnigmaConfig.config_string ~EnigmaConfig.step ~EnigmaConfig.stepped_configs ~EnigmaConfig.print_operation ~EnigmaConfig.enigma_encoding ~EnigmaConfig.print_encoding

Machine configurations

Enigma machine configurations and their functionality are represented using single class:

EnigmaConfig()

Creating configurations

EnigmaConfig.config_enigma

EnigmaConfig.config_enigma_from_string

State

The behavior of an Enigma machine, for both its operation <config_operation> and the encodings <config_encoding> it performs is determined entirely by its state. This state is established when a machine is set to its initial configuration. Operation then produces a series of configurations each with new state

Formally, that state consists of internal <config_state_internal> elements not directly visible to the operator who can only indirectly see changes <config_state_visible> in the positions of the rotors as manifest in the rotor letters at the machine windows. This internal state is entirely responsible for determining the mappings used by the machine <config_state_mappings> to encode messages.

Thes aspects of state can be used to costruct a varity of representations <config_state_strings> of the configuration of an Enigma machine.

Visible state

EnigmaConfig.windows

Internal state

EnigmaConfig.__init__

EnigmaConfig.components

EnigmaConfig.positions

EnigmaConfig.rings

Mappings

The Enigma machine's state determines the it uses to perform encodings <config_encoding>. Thes mappings can be examined in a number of ways:

EnigmaConfig.stage_mapping_list

EnigmaConfig.enigma_mapping_list

EnigmaConfig.enigma_mapping

State representations

EnigmaConfig.config_string

State transitions and operation

EnigmaConfig.step

EnigmaConfig.stepped_configs

EnigmaConfig.print_operation

Encoding

Message encoding

EnigmaConfig.enigma_encoding

EnigmaConfig.print_encoding

EnigmaConfig.make_message