1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
# Copyright (C) 2012 by Brian Neal.
# This file is part of Py-Enigma, the Enigma Machine simulation.
# Py-Enigma is released under the MIT License (see License.txt).
"""data.py - This file contains rotor & reflector data for all the types
we simulate.
"""
# This data is taken from Dirk Rijmenants very informative and useful Enigma
# website: "Techical Details of the Engigma Machine"
# http://users.telenet.be/d.rijmenants/en/enigmatech.htm
#
# Rotors I-V were used by the Heer, Luftwaffe, and Kriegsmarine. The
# Kriegsmarine added rotors VI-VIII to the M3 model, and added Beta & Gamma to
# the M4 model (used with thin reflectors only). Note that Beta & Gamma rotors
# did not rotate.
#
# The Heer, Luftwaffe, & Kriegsmarine M3 machines used reflectors B & C,
# while the Kriegsmarine M4 used thin reflectors B & C.
#
ROTORS = {
'I': {
'wiring': 'EKMFLGDQVZNTOWYHXUSPAIBRCJ',
'stepping': 'Q',
},
'II': {
'wiring': 'AJDKSIRUXBLHWTMCQGZNPYFVOE',
'stepping': 'E',
},
'III': {
'wiring': 'BDFHJLCPRTXVZNYEIWGAKMUSQO',
'stepping': 'V',
},
'IV': {
'wiring': 'ESOVPZJAYQUIRHXLNFTGKDCMWB',
'stepping': 'J',
},
'V': {
'wiring': 'VZBRGITYUPSDNHLXAWMJQOFECK',
'stepping': 'Z',
},
'VI': {
'wiring': 'JPGVOUMFYQBENHZRDKASXLICTW',
'stepping': 'ZM',
},
'VII': {
'wiring': 'NZJHGRCXMYSWBOUFAIVLPEKQDT',
'stepping': 'ZM',
},
'VIII': {
'wiring': 'FKQHTLXOCBJSPDZRAMEWNIUYGV',
'stepping': 'ZM',
},
'Beta': {
'wiring': 'LEYJVCNIXWPBQMDRTAKZGFUHOS',
'stepping': None,
},
'Gamma': {
'wiring': 'FSOKANUERHMBTIYCWLQPZXVGJD',
'stepping': None,
},
}
REFLECTORS = {
'B': 'YRUHQSLDPXNGOKMIEBFZCWVJAT',
'C': 'FVPJIAOYEDRZXWGCTKUQSBNMHL',
'B-Thin': 'ENKQAUYWJICOPBLMDXZVFTHRGS',
'C-Thin': 'RDOBJNTKVEHMLFCWZAXGYIPSUQ',
}
|