Enigma Cipher

Key
Ring
Rotors
Reflector
Plugboard

Python代码参考

1
2
3
4
5
6
7
8
9
10
11
from pycipher import Enigma
 
print Enigma(settings=('A','B','C'),rotors=(1,2,3),reflector='B',
     ringstellung=('A','B','C'),steckers=[('P','O'),('M','L'),
     ('I','U'),('K','J'),('N','H'),('Y','T'),('G','B'),('V','F'),
     ('R','E'),('D','C')]).encipher('HELLOWORLD')    
 
print Enigma(settings=('A','B','C'),rotors=(1,2,3),reflector='B',
     ringstellung=('A','B','C'),steckers=[('P','O'),('M','L'),
     ('I','U'),('K','J'),('N','H'),('Y','T'),('G','B'),('V','F'),
     ('R','E'),('D','C')]).decipher('TDJPKAUTPR')