-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
3466 lines (3130 loc) · 161 KB
/
index.html
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Enigma Simulator</title>
<script src="js/embedskulptor.js"></script>
<script src="js/numeric-1.2.6.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<style>
body {
margin: 0;
}
p, li{
font-size: 1.1em;
}
#nav{
z-index: 1000;
list-style-type: none;
margin: 0;
padding: 0;
width: 15%;
background-color: #4D4D4D;
position: fixed;
height: 100%;
overflow: none;
}
li a {
display: block;
color: White;
padding: 8px 0 8px 16px;
text-decoration: none;
}
li a.active {
background-color: #4CAF50;
color: white;
}
li a:hover:not(.active) {
background-color: #222;
color: white;
text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 6px darkblue;
}
#logo_name{
text-decoration: none;
#position: absolute;
top: 0 px;
font-size: 2.2em;
letter-spacing: -1px;
word-spacing: 5px;
font-weight: bold;
color: White;
width: 15%
height: 15%
}
ul.nested_list{list-style-type: square;
color: white;
}
#intro{
#text-align: center;
}
#acknowledgement{
display: none;
}
#mechanics{
display: none;
}
#help{
display: none;
}
#ntu-copyright{
z-index: 1001;
text-align: center;
position: fixed;
left: 20px;
bottom: -10px;
}
.showimage{
width: 250px;
height: 150px;
border: dotted blue 1px;
}
.next{
float: right;
}
.prev{
float: left;
}
.next_btn {
display: inline-block;
border-radius: 4px;
background-color: #4D4D4D;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 22px;
padding: 2px;
width: 130px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.next_btn span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.next_btn span:after {
content: '»';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.next_btn:hover span {
padding-right: 25px;
}
.next_btn:hover span:after {
opacity: 1;
right: 0;
}
.previous_btn {
display: inline-block;
border-radius: 4px;
background-color: #4D4D4D;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 22px;
padding: 2px;
width: 130px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.previous_btn span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.previous_btn span:after {
content: "\ab";
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.previous_btn:hover span {
padding-left: 10px;
}
.previous_btn:hover span:before {
content: "\ab";
opacity: 1;
left: 0;
}
#mechanics-single-letter{
text-align: center;
margin-left: 150px;
}
.title{
width: 100%;
color: white;
padding: 5px;
background: #222;
}
#enigma-instruction{
margin-left: 140px;
}
p.copyright{
z-index: 1002;
font-size: 0.8em;
color: white;
}
a{
text-decoration: none;
color: lightbllue;
}
a.reference{
font-size: 0.74em;
text-decoration: none;
color: black;
font-weight: bold;
}
a.second_reference_source {
font-size: 0.9em;
color: black;
}
p.reference_source {
font-size: 0.9em;
}
p.reference_source a {
font-size: 0.9em;
}
p.ack-reference{
font-size: 0.9em;
}
</style>
</head>
<body>
<ul id="nav">
<div id ="logo_name">ENIGMA MACHINE</div>
<li><a id ='intro-link' class="active" href="javascript:void(0)" onclick = "enableIntro()">Introduction</a></li>
<li><a id ='ack-link' href="javascript:void(0)" onclick = "enableReference()">Acknowledgement</a></li>
<li><a id ='mechanics-link' href="javascript:void(0)" onclick = "enableMechanics()">Enigma Mechanics</a>
</li>
<li><a id ='help-link' href="javascript:void(0)" onclick = "enableHelp()">Using the emulator</a></li>
<li><a id ='emulator-link' href="javascript:void(0)" onclick = "enableEmulator()" ><font color="Yellow">Enigma emulator</font></a></li>
</ul>
<div id = "ntu-copyright">
<p class ="copyright">Back to <a href="../index.html"><font color="Lime"><b>Crypto demos page</b></font></a><p>
<p class ="copyright">© 2016, <a href="http://ntu.edu.sg/home/anwitaman"><font color="white">Anwitaman DATTA</font></a><p>
</div>
<div id ="intro" style="margin-left:15%;padding:1px 16px;">
<h2>The emulator works with <font color="Orange">Firefox & Opera</font></h2>
<div>
<hr/>
<img class ="showimage" src ="images/intro/enigma_intro_image1.jpg"/>
<img class ="showimage" src ="images/intro/enigma_intro_image2.jpg"/>
<img class ="showimage" src ="images/intro/enigma_intro_image3.jpg"/>
<img class ="showimage" src ="images/intro/enigma_intro_image4.jpg"/>
<p><b>Image sources: </b><a id ='ref1' class ="reference" href="javascript:void(0);" onclick = "enableReference()">[1]</a>, <a class ="reference" href="javascript:void(0)" onclick = "enableReference()">[2]</a>, <a class ="reference" href="javascript:void(0)" onclick = "enableReference()">[3]</a>, <a class ="reference" href="javascript:void(0)" onclick = "enableReference()">[4]</a></p>
<hr/>
</div>
<br/>
<h3 class ='title'>Brief history of the Enigma machine</h3>
<p>The Enigma machines were a series of electromechanical rotor ciphers based on a German engineer, Arthur Scherbius's invention <a class ="reference" href="javascript:void(0)" onclick = "enableReference()">[5]</a>. Enigma machines were widely used by Nazi Germany during the World War 2. British scientist Alan Turing, leveraging on earlier breakthrough by three Polish military intelligence cryptanalysts Marian Rejewski, Jerzy Różycki and Henryk Zygalski, led the effort to break the cipher. Poor configuration and usage of the machine also facilitated the cryptanalysis. Breaking Enigma was a very important breakthrough that supported the Allied forces' war efforts, without which the outcome of the war and the world we live in today might have been quite different.
</p>
<h3 class ='title'>About this emulator</h3>
<p>This enigma emulator has been developed by Leelar Thaophialuang as part of a set of <a href="../index.html"><font color="Orange">demonstrators of basic cryptography techniques</font></a> created in the School of Computer Science and Engineering at NTU Singapore under <a href="http://ntu.edu.sg/home/anwitaman"><font color="Orange">Anwitaman Datta</font></a>'s initiative, and captures the functionality and complexity of the Enigma machine. The emulator only simulates the three rotor Enigma M3 (Army; Navy). Reference materials for further reading can be found in the acknowledgement section. The last tab provides the actual emulator (works on Firefox & Opera).</p>
<div class ="next"><button class="next_btn" style="vertical-align:middle" onclick ="enableReference()"><span><a>Next</a></span></button></div>
</div>
<div id ="acknowledgement" style="margin-left:15%;padding:1px 16px;">
<h2>ACKNOWLEDGEMENT</h2>
<h3>Acknowledgement</h3>
<p class="ack-reference">1. This emulator was designed and implemented by <a href="https://www.linkedin.com/in/leelar-thaophialuang-834458b3">Leelar Thaophialuang</a> as part of his final year project in the School of Computer Science and Engineering at NTU Singapore.</p>
<p class="ack-reference">2. <a href ='https://bitbucket.org/bgneal/enigma/' target ="_blank">Brian Neal </a>for providing <a id ='py-enigma-linnk' href ="https://pypi.python.org/pypi/py-enigma/" target="_blank">py-enigma 0.1 Library</a>. This project used py-enigma 0.1 to simulate the enigma emulator.<p>
<h3>References</h3>
The accompanying information (and text/images) in this portal has been derived from the following sources:
<p class ="reference_source">
[1] By Bob Lord - <a rel="nofollow" class="external text" href="http://www.ilord.com/enigma.html" target="_blank">German Enigma Machine</a>, uploaded in english wikipedia on 16. Feb. 2005 by <a href="https://en.wikipedia.org/wiki/User:Matt_Crypto" class="extiw" title="en:User:Matt Crypto" target="_blank">en:User:Matt Crypto</a>, <a href="http://creativecommons.org/licenses/by-sa/3.0/" title="Creative Commons Attribution-Share Alike 3.0<p></p>">CC BY-SA 3.0</a>, <a class ="second_reference_source" href ="https://commons.wikimedia.org/w/index.php?curid=258976" target= "_blank">https://commons.wikimedia.org/w/index.php?curid=258976</a></p>
<p class ="reference_source">
[2] B.Lucattelli.(2006).<a href ="http://lucattelli.com/talks/enig-en/" target ="_blank">
Writing the Enigma Machine in ABAP: An Educational Project</a>[online]. Available at: <a class ="second_reference_source" href ="http://lucattelli.com/talks/enig-en/" target ="_blank">http://lucattelli.com/talks/enig-en/</a>
</p>
<p class ="reference_source">
[3] By <a class ="reference_source" href="https://commons.wikimedia.org/wiki/User:Punishar" target="_blank" title="User:Punishar">Punishar</a> - <span class="int-own-work" lang="en">Own work</span>, <a href="http://creativecommons.org/licenses/by-sa/4.0" title="Creative Commons Attribution-Share Alike 4.0">CC BY-SA 4.0</a>, <a class ="second_reference_source" href ="https://commons.wikimedia.org/w/index.php?curid=48423083" target ="_blank">https://commons.wikimedia.org/w/index.php?curid=48423083</a>
</p>
<p class ="reference_source">
[4] <a href="http://creativecommons.org/licenses/by-sa/3.0/" target="_blank" title="Creative Commons Attribution-Share Alike 3.0<p></p>">CC BY-SA 3.0</a>, <a class = "second_reference_source" href ="https://commons.wikimedia.org/w/index.php?curid=88679" target ="_blank">https://commons.wikimedia.org/w/index.php?curid=88679</a>
</p>
<p class ="reference_source">
[5] <a class = "second_reference_source" href ="https://en.wikipedia.org/wiki/Enigma_machine" target="_blank">https://en.wikipedia.org/wiki/Enigma_machine</a>
</p>
<p class ="reference_source">
[6] <a class = "second_reference_source" href ="https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma" target="_blank">https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma</a>
</p>
<p class ="reference_source">
[7] <a href="http://creativecommons.org/licenses/by-sa/3.0/" target ="_blank" title="Creative Commons Attribution-Share Alike 3.0<p></p>">CC BY-SA 3.0</a>, <a class ="second_reference_source" href ="https://commons.wikimedia.org/w/index.php?curid=23793" target ="_blank" >https://commons.wikimedia.org/w/index.php?curid=23793</a>
</p>
<p class ="reference_source">
[8] Crypto Museum.(2009). <a href = "http://www.cryptomuseum.com/crypto/enigma/" target = "_blank">Enigma Cipher Machine</a>[online]. Available at: <a class ="second_reference_source" href ="http://www.cryptomuseum.com/crypto/enigma/img/exploded.gif" target ="_blank">http://www.cryptomuseum.com/crypto/enigma/img/exploded.gif</a>
</p>
<p class ="reference_source">
[9] By <a href="https://en.wikipedia.org/wiki/User:Wapcaplet" target ="_blank" class="extiw" title="en:User:Wapcaplet">en:User:Wapcaplet</a> - uploaded in english wikipedia on 30. Jul. 2004 by author, <a href="http://creativecommons.org/licenses/by-sa/3.0/" title="Creative Commons Attribution-Share Alike 3.0<p></p>">CC BY-SA 3.0</a>, <a class ="second_reference_source" href ="https://commons.wikimedia.org/w/index.php?curid=258985" target ="_blank">https://commons.wikimedia.org/w/index.php?curid=258985</a>
</p>
<p class ="reference_source">
[10] By Created by
<a href="https://en.wikipedia.org/wiki/User:Wapcaplet" class="extiw" title="en:User:Wapcaplet" target ="_blank">Wapcaplet</a>
in <a href="https://commons.wikimedia.org/wiki/Blender_%28software%29" title="Blender (program)" class="mw-redirect" target ="_blank">Blender</a>.
- Uploaded by <a href="https://en.wikipedia.org/wiki/User:Wapcaplet" class="extiw" title="en:User:Wapcaplet" target ="_blank">Wapcaplet</a>
to the <a href="https://en.wikipedia.org/wiki/Main_Page" class="extiw" title="en:Main Page" target ="_blank">English Wikipedia</a>, <a href="http://creativecommons.org/licenses/by-sa/3.0/" title="Creative Commons Attribution-Share Alike 3.0<p></p>">CC BY-SA 3.0</a>,
<a class = "second_reference_source" href = "https://commons.wikimedia.org/w/index.php?curid=23791" target = "_blank">https://commons.wikimedia.org/w/index.php?curid=23791</a>
</p>
<p class ="reference_source">
[11] T.Long.(2009).<a href ="http://www.terrylong.org/" target ="_blank">
Enigma Simulator by Terry Long</a>[online]. Available at: <a class = "second_reference_source" href = "http://www.terrylong.org/images/screenshots/2.png" target ="_blank">http://www.terrylong.org/images/screenshots/2.png(URL)</a>
</p>
<p class ="reference_source">
[12] T.Sale.<a href ="http://www.codesandciphers.org.uk/enigma/rotorspec.htm" target ="_blank">
Technical Specification of the Enigma</a>[online]. Available at: <a class = "second_reference_source" href = "http://www.codesandciphers.org.uk/enigma/rotorspec.htm", target = "_blank">http://www.codesandciphers.org.uk/enigma/rotorspec.htm(URL)</a>
</p>
<p class ="reference_source">
[13] <a class = "second_reference_source" href = "https://en.wikipedia.org/wiki/Enigma_rotor_details" target = "_blank">https://en.wikipedia.org/wiki/Enigma_rotor_details</a>
</p>
<br/>
<div class ="prev"><button class="previous_btn" style="vertical-align:middle" onclick = "enableIntro()"><span><a> Previous</a></span></button></div>
<div class ="next"><button class="next_btn" style="vertical-align:middle" onclick = "enableMechanics()"><span><a>Next</a></span></button></div>
</div>
<div id ="mechanics" style="margin-left:15%;padding:1px 16px;">
<h2><a name ='keyboard'></a>
ENIGMA MECHANICS</h2>
<div id ="images">
<hr/>
<img class ="showimage" src ="images/mechanics/rotor_image1.png"/>
<img class ="showimage" src ="images/mechanics/rotor_image2.gif"/>
<img class ="showimage" src ="images/mechanics/rotor_image3.png"/>
<img class ="showimage" src ="images/mechanics/rotor_image4.png"/>
<p><b>Image sources: </b><a id ='ref1' class ="reference" href="javascript:void(0)" onclick = "enableReference()">[7]</a>, <a class ="reference" href="javascript:void(0)" onclick = "enableReference()">[8]</a>, <a class ="reference" href="javascript:void(0)" onclick = "enableReference()">[9]</a>, <a class ="reference" href="javascript:void(0)" onclick = "enableReference()">[10]</a></p>
<hr/>
</div>
<br/>
<h3 class ='title'>1. How the Enigma works</h3>
<p>When a plaintext letter is pressed on the keyboard, the pressed key triggers an electric current which goes through the rotated components of the Enigma Machine. Once the current reaches the destination, a bulb that is coresponding to the ciphertext lights up.
Encipherment with Enigma is special in that the same plaintext letter will not yield the same ciphertext letter next time (polyalphabetic substitution). This is due to the fact that every time a letter is typed, the right most rotor is rotated one step so that when the same letter is pressed again,
it would not be enciphered as the same ciphertext letter. To add complexity to the enigma's encipherment, a plugboard was introduced to allow pairs of letters to be swapped before it actually goes through the movable elements of the Enigma. To make things even more complicated, different settings can be applied to every element of the Enigma machine
so that different settings would uniquely generate different overall encryption.
</p>
</br>
<h3 class ='title'>2. The working sequence of a single letter</h3>
</br>
<img id ='mechanics-single-letter' src ="images/mechanics/asingleletter.png"/>
</br>
</br>
<ol id ='enigma-instruction'>
<li>Suppose that the letter 'E' is pressed on the keyboard. Consequent to one keystroke, the right most rotor is being advanced by one step.</li>
</br>
<li>The letter 'E' is entering into the plugboard. The plugbaord swaps the letter 'E' to letter 'W' given that the plugboard setting pairs 'EW' (in the Figure above).</li>
</br>
<li>The letter 'W' is the letter produced by the plugboard and it is now passed to the static rotor. At the static rotor the letter is simply passed to another rotor.</li>
</br>
<li>Every keystroke causes the right rotor to move down one position. As a consequence, the letter 'W' is not mapped to letter 'W'. Instead, it is mapped to letter 'X' since 'X' has moved to the position where 'W' was. The letter 'X' would then be linked to letter 'S' based on the internal wiring mapping determined by the ring setting. Following the same process, after going through the middle rotor and left rotor, the letter is now transformed to letter into 'D' as it is passed to the reflector.
<br/><b>Note:</b> For the middle rotor and the left rotor in this example, we find that the letter 'G' at the middle rotor is mapped to the letter 'G' at the left most rotor because at the initail stage, none of the middle rotor or left rotor are moving yet.</li>
</br>
<li>Different reflectors are wired up differently. In this example, the reflector B links the letter 'D' to letter 'H' and reflects the letter 'H' back to the three movable rotors.</li>
</br>
<li>The letter 'H' now goes back and passes through the rotors, it is substituted, and mapped to one another reapeatly along the way and emerges as the letter 'L'.</li>
</br>
<li>Again, The letter 'L' in the right rotor and the letter 'K' in the Static rotor have the same position. As a result, from the right rotor to the Static rotor, the letter 'L' is changed to the letter 'K' and it is directly passed back to Plugboard.</li>
</br>
<li>The letter 'K' enters the plugboard. The plugbaord swaps the letter 'K' to letter 'A' since the plugboard settings pair 'AK'.</li>
</br>
<li>The letter 'A' reaches the destination at Lampboard. The Lampboard lights up the letter 'A'.</li>
</ol>
</br>
<h3 class ='title'>3. The components of the Enigma Machine</h3>
<h3>3.1 Keyboard</h3>
<p>The keyboard is used to type the text to be encrypted or decrypted. The keyboard accepts the entered letter and relays the letter to the plugboard. It consists of 26 alphabets and it is an old QWERT layout, as shown in following figure. When any key on the keyboard is entered, an electric signal representing the key is sent to the plugboard.</p>
</br>
<img src ="images/mechanics/keyboard.png"/>
<br/>
<br/>
<hr/>
<br/>
<h3>3.2 Plugbaord</h3>
<p>Plugboard (Steckerbrett in German) allows incoming signal or outgoing signal to be swapped first before it goes through the rotors or goes out to the Lampboard. Introduction of the plugboard to the Enigma machine made it more robust. Normally, plugboard setting is manually created by plugging two wires together, and the number of pairs are limited to 10 pairs only. The plugboard has an additional constraint that no single letter can be mapped to two different letters. Any letter that has no pair is implicitly mapped to itself.</p>
</br>
<img src ="images/mechanics/plugboard.png"/>
<p><b>Image source: </b><a id ='ref1' class ="reference" href ="javascript:void(0)" onclick = "enableReference()">[11]</a></p>
<br/>
<hr/>
<br/>
<h3>3.3 Static Rotor</h3>
<p>A static rotor plays the role of a base reference. It has 26 letters with fixed positions. The static rotor seems to be doing nothing (in that it is static) but it has been chosen so that with every step of the right most rotor's rotation, the mapping of the letters between the right rotor and the stator varies significantly.</p>
</br>
<hr/>
<h3>3.4 Movable Rotors</h3>
<p>The rotors (alternatively wheels or drums, Walzen in German) are the main component of the Enigma machine. Every rotor has 26 contacts (letters) associated with 26 pins. The pins and contacts represent the 26 alphabets A-Z. A rotor individually can be seen to realize a monoalphabetic substitution cipher. For instance, in the Rotor 'I' (above Figure), the pin associated with the letter 'A' is wired to the letter 'E'. The complexity and security of the Enigma machine comes from the use of multiple rotors in a cascade, and their changing relative positions, which realize a polyalphabetic substitution. Each rotor has its own notch, used to indicate the step the rotor is in at a given time point.</p>
<h4>3.4.1 Technical specifications of the Enigma rotors:</h4>
<p>Following table shows the internal-wiring/mapping of different rotors at default setting or when ring settings are set to zero.</p>
<table border="1" style="width:100%; text-align: center;">
<tr>
<th>INPUT</th>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
<th>F</th>
<th>G</th>
<th>H</th>
<th>I</th>
<th>J</th>
<th>K</th>
<th>L</th>
<th>M</th>
<th>N</th>
<th>O</th>
<td>P</th>
<th>Q</th>
<th>R</th>
<th>S</th>
<th>T</th>
<th>U</th>
<th>V</th>
<th>W</th>
<th>X</th>
<th>Y</th>
<th>Z</th>
</tr>
<tr>
<th>ROTOR I</th>
<td>E</td>
<td>K</td>
<td>M</td>
<td>F</td>
<td>L</td>
<td>G</td>
<td>D</td>
<td>Q</td>
<td>V</td>
<td>Z</td>
<td>N</td>
<td>T</td>
<td>O</td>
<td>W</td>
<td>Y</td>
<td>H</td>
<td>X</td>
<td>U</td>
<td>S</td>
<td>P</td>
<td>A</td>
<td>I</td>
<td>B</td>
<td>R</td>
<td>C</td>
<td>J</td>
</tr>
<tr>
<th>ROTOR II</th>
<td>A</td>
<td>J</td>
<td>D</td>
<td>K</td>
<td>S</td>
<td>I</td>
<td>R</td>
<td>U</td>
<td>X</td>
<td>B</td>
<td>L</td>
<td>H</td>
<td>W</td>
<td>T</td>
<td>M</td>
<td>C</td>
<td>Q</td>
<td>G</td>
<td>Z</td>
<td>N</td>
<td>P</td>
<td>Y</td>
<td>F</td>
<td>V</td>
<td>O</td>
<td>E</td>
</tr>
<tr>
<th>ROTOR III</th>
<td>B</td>
<td>D</td>
<td>F</td>
<td>H</td>
<td>J</td>
<td>L</td>
<td>C</td>
<td>P</td>
<td>R</td>
<td>T</td>
<td>X</td>
<td>V</td>
<td>Z</td>
<td>N</td>
<td>Y</td>
<td>E</td>
<td>I</td>
<td>W</td>
<td>G</td>
<td>A</td>
<td>K</td>
<td>M</td>
<td>U</td>
<td>S</td>
<td>Q</td>
<td>O</td>
</tr>
<tr>
<th>ROTOR IV</th>
<td>E</td>
<td>S</td>
<td>O</td>
<td>V</td>
<td>P</td>
<td>Z</td>
<td>J</td>
<td>A</td>
<td>Y</td>
<td>Q</td>
<td>U</td>
<td>I</td>
<td>R</td>
<td>H</td>
<td>X</td>
<td>L</td>
<td>N</td>
<td>F</td>
<td>T</td>
<td>G</td>
<td>K</td>
<td>D</td>
<td>C</td>
<td>M</td>
<td>W</td>
<td>B</td>
</tr>
<tr>
<th>ROTOR V</th>
<td>V</td>
<td>Z</td>
<td>B</td>
<td>R</td>
<td>G</td>
<td>I</td>
<td>T</td>
<td>Y</td>
<td>U</td>
<td>P</td>
<td>S</td>
<td>D</td>
<td>N</td>
<td>H</td>
<td>L</td>
<td>X</td>
<td>A</td>
<td>W</td>
<td>M</td>
<td>J</td>
<td>Q</td>
<td>O</td>
<td>F</td>
<td>E</td>
<td>C</td>
<td>K</td>
</tr>
<tr>
<th>ROTOR VI</th>
<td>J</td>
<td>P</td>
<td>G</td>
<td>V</td>
<td>O</td>
<td>U</td>
<td>M</td>
<td>F</td>
<td>Y</td>
<td>Q</td>
<td>B</td>
<td>E</td>
<td>N</td>
<td>H</td>
<td>Z</td>
<td>R</td>
<td>D</td>
<td>K</td>
<td>A</td>
<td>S</td>
<td>X</td>
<td>L</td>
<td>I</td>
<td>C</td>
<td>T</td>
<td>W</td>
</tr>
<tr>
<th>ROTOR VII</th>
<td>N</td>
<td>Z</td>
<td>J</td>
<td>H</td>
<td>G</td>
<td>R</td>
<td>C</td>
<td>X</td>
<td>M</td>
<td>Y</td>
<td>S</td>
<td>W</td>
<td>B</td>
<td>O</td>
<td>U</td>
<td>F</td>
<td>A</td>
<td>I</td>
<td>V</td>
<td>L</td>
<td>P</td>
<td>E</td>
<td>K</td>
<td>Q</td>
<td>D</td>
<td>T</td>
</tr>
<tr>
<th>ROTOR VIII</th>
<td>F</td>
<td>K</td>
<td>Q</td>
<td>H</td>
<td>T</td>
<td>L</td>
<td>X</td>
<td>O</td>
<td>C</td>
<td>B</td>
<td>J</td>
<td>S</td>
<td>P</td>
<td>D</td>
<td>Z</td>
<td>R</td>
<td>A</td>
<td>M</td>
<td>E</td>
<td>W</td>
<td>N</td>
<td>I</td>
<td>U</td>
<td>Y</td>
<td>G</td>
<td>V</td>
</tr>
</table>
<p><b>Source: </b><a id ='ref1' class ="reference" href="javascript:void(0)" onclick = "enableReference()">[12]</a></p>
<h4>3.4.2 Turnover notch positions</h4>
<p>Each rotor has one or two notches. Notch refers to the stepping mechanism. For single stepping, a rotor has only one notch and when the rotor has fully finished one round, it will trigger another rotor to move forward one step. This happens when a pal on the rotor meets the notch. For double stepping, rotor has two notches for triggering another rotor's step. It is not necessary that a rotor to fully finish one round for a next rotor to rotate, since, having two notches, the rotor can meet a notch earlier.</p>
<p><b>Note:</b>Following table corresponds the Enigma machine M3 (Army; navy) only.</p>
<table border="1" style="width:100%; text-align: center;">
<tr>
<td>Rotor Name</td>
<td>Notch</td>
</tr>
<tr>
<td>Rotor I</td>
<td>Q</td>
</tr>
<tr>
<td>Rotor II</td>
<td>E</td>
</tr>
<tr>
<td>Rotor III</td>
<td>V</td>
</tr>
<tr>
<td>Rotor IV</td>
<td>J</td>
</tr>
<tr>
<td>Rotor V</td>
<td>Z</td>
</tr>
<tr>
<td>Rotor VI,VII,VIII</td>
<td>Z and M</td>
</tr>
</table>
<p><b>Source: </b><a id ='ref1' class ="reference" href="javascript:void(0)" onclick = "enableReference()">[13]</a></p>
<hr/>
<br/>
<h3>3.5 Reflector</h3>
<p>Reflector (German: Umkehrwalze) is single-sided. The reflector takes the last input from the left rotor and performs a very simple substitution where its contacts are swapped in pairs. Two possible reflectors are available for the Enigma machine, each of them is wired up with different combination of wirings so that every single letter is reflected differently.</p>
<h4>3.5.1 Technical specifications of the Enigma reflectors</h4>
<table border="1" style="width:100%; text-align: center;">
<tr>
<td>Reflector Model</td>
<td>Pair of wirings</td>
</tr>
<tr>
<td>B</td>
<td>(BR) (CU) (DH) (EQ) (FS) (GL) (IP) (JX) (KN) (MO) (TZ) (VW)</td>
</tr>
<tr>
<td>C</td>
<td>(AF) (BV) (CP) (DJ) (EI) (GO) (HY) (KR) (LZ) (MX) (NW) (TQ) (SU)</td>
</tr>
</table>
<p><b>Source: </b><a id ='ref1' class ="reference" href="javascript:void(0)" onclick = "enableReference()">[12]</a></p>
<hr/>
<br/>
<h3>3.6 Lampboard</h3>
<p>The lampboard follows the same layout as the keyboard. Each letter has its coresponding bulb, which lights up to represent the enciphered or deciphered letter obtained from the encryption and decryption respectively.</p>
<img src ="images/mechanics/lampboard.png"/>
<br/>
<br/>
<hr/>
<br/>
<h3 class ='title'>4. Encryption & Decryption</h3>
<p>Enigma is a symmetric encryption system, so it is assumed that some secrets have already been agreed and exchanged a priori. These secrets are key, ring's order, ring setting, reflector setting, plugboard, and initial display windows.</p>
<div class ="prev"><button class="previous_btn" style="vertical-align:middle" onclick = "enableReference()"><span><a> Previous</a></span></button></div>
<div class ="next"><button class="next_btn" style="vertical-align:middle" onclick = "enableHelp()"><span><a>Next</a></span></button></div>
</div>
<div id ="help" style="margin-left:15%;padding:1px 16px;">
<h2>EMULATOR HELP</h2>
<h3 class ='title'>1. Plugboard Setting</h3>
<p>Plugboard setting is indicated with a red rectangle in the figure below. To set the plugboard, first choose a pair of alphabets. Then click the first alphabet on the right side of the plugboard followed by clicking the second alphabet on the left side of the plugboard. When a character is clicked, the clicked pin will change its background to yellow signaling that the clicked pin is selected. This forms a pair of plugboard setting.</p>
<img src = "images/help/help_plugboard_1.png"/>
<p>Following figure shows the above instructions. Since plugboard setting has a constraint that no single alphabet can be mapped to two different alphbets, in this example we are trying to swap 'K' with 'S'. We find that there are two wires, one is mapping the letter 'K' to the letter 'S' while another one is mapping the letter 'S' to 'K'. The number of pairs are limited to 10 pairs only.</p>
<img src = "images/help/help_plugboard_2.png"/>
<br/>
<br/>
<h3 class ='title'>2. Ring Order Setting (Walzenlage)</h3>
<p>The red rectangle shows the Walzenlage or Ring's order. There are three rotors from left to right: left rotor (outer), middle rotor, and right (inner) rotor. From left to right we can arrange the order of the rotor in any order by clicking the right-arrow button or left-arrow button. This emulator supports 8 differents rotors, namely 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', and 'VIII'. To set the ring's order, three rotors are chosen from these 8 rotors based on ones preference. Duplicating the rotor type is discouraged, example: "II II II", "II I II","II II I", and other duplicated orders.</p>
<img src = "images/help/help_ring_order_setting.png"/>
<br/>
<br/>
<h3 class ='title'>3. Reflector Setting (Umkehrwalze)</h3>
<p>Reflector Setting is highlighted by the red rectangle. In emulator implements two types of reflectors - reflector 'B' and reflector 'C'. To change the setting, click on the right-arrow button or left-arrow button. Different reflectors are wired differently. </p>
<img src = "images/help/help_reflector.png"/>
<br/>
<br/>
<h3 class ='title'>4. Entry Wheel (Eintrittzwalze)</h3>
<p>The wiring of the Eintrittzwalze (ETW, entry wheel) between the Plugboard and the Rotors cannot be manipulated. <br><br>
<h3 class ='title'>5. Ring Setting (Ringstellung)</h3>
<p>Ring Setting is the area of red rectangle. Changing the ring setting makes changes to the internal-wiring mapping. Each rotor has 26 possible ways of setting and setting ranges from 0-25. Changing the setting can be done by clicking left-arrow button or right-arrow button. <!--Other online references, such 26 ways are somtimes represented by alphabets 'A'-'Z'.--></p>
<img src = "images/help/help_ring_setting.png"/>
<br/>
<br/>
<h3 class ='title'>6. Display windows (Grundstellung)</h3>
<p>The display windows are shown in the red rectangle. Display windows are current positions of the three rotor which can be seen by the officer or user. Scrolling up and down the rotor will change the windows value (current positions). Display windows has to be firstly set before encryption/decryption. Display windows are secret from intruders and attackers. Every time a letter is typed, diplay winodow of the right most rotor is increased by one offset, followed by a conditional stepping if any of the midlle rotor or left most rotor meeting corresponding notches.</p>
<img src = "images/help/help_display_windows.png"/>
<br/>
<br/>
<h3 class ='title'>7. Inputs and Outputs</h3>
<p>Inputs and Outputs is the area indicated with a red rectangle, located at the bottom of the Enigma emulator. This is an artefact of the emulator itself, where the input and corresponding output is printed to explicitly keep track of what has been typed as well as what has been the resulting enciphered text.</p>
<img src = "images/help/help_input_output.png"/>
<br/>
<br/>
<h3 class ='title'>8. Reset Enigma</h3>
<p>Reset Button is highlighted by the red rectangle. User can reset the enigma emulator to its default settings by clicking this button.</p>
<img src = "images/help/help_reset.png"/>
<br/>
<br/>
<div class ="prev"><button class="previous_btn" style="vertical-align:middle" onclick ="enableMechanics()"><span><a> Previous</a></span></button></div>
<div class ="next"><button class="next_btn" style="vertical-align:middle" onclick = "enableEmulator()"><span><a>Next</a></span></button></div>
</div>
<script>
(function() {
var options = {"gui": {"show": true }, "console": {"show": false}, "code": {"show": false}};
embedSkulptor(options,(function () {/*
# CodeSkulptor runs in Chrome 18+, Firefox 11+, and Safari 6+.
# Some features may work in other browsers, but do not expect
# full functionality. It does NOT run in Internet Explorer.
import simplegui
import collections
import math
#print("*************** MAIN START *******************")
TIMER = 0
TIMER_COLOR_N = 0
ALPHA_LABELS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
WIRING_FREQ_SET = set((letter, 1) for letter in ALPHA_LABELS)
message = ""
TGLB_WIDTH = 110 #toggle label width
TGLB_HEIGHT = 26 #toggle label height
FOOTER_H = 10
CHIAN_H = 420 #chain height
ROTOR_BOARD_GAP = 25 #rotor board gap
BOARD_W = 280
BOARD_H = 200
RESET_BTN_W = 106
RESET_BTN_H = 18
X_GAP = 5
Y_GAP = 5
REFLECTOR_B = '#5D5E5E'
ROTOR1_B = '#9C9C9C'
ROTOR2_B = '#9C9C9C'
ROTOR3_B = '#9C9C9C'
ETW_B = '#5D5E5E'
PLUG_B = '#5D5E5E'
PIN_BTN_SIZE = 16
PIN_BTN_COLOR = '#DEEBF7'
POSITION = [0,0]
POSITIONKEY = [0,0]
RING_SETTING_POSITION = [0,0]
RESET_POSITION = [0,0]
TEST = [568, 450]
SETTING_CONSOLE = '#2f5653'
KRADIUS = 12
COUNTER = 0
SWITCH_CLCK = 0
#PLUG_SETTING = "AV BS CG DL FU HZ IN KM OW RX"
PLUG_SETTING = ' '
#ring setting 0 --> 25
RING_LIST = ['I','II','III','IV','V','VI','VII','VIII']
RING_INDEX = [2,1,0]
RINGS= [RING_LIST[RING_INDEX[0]], RING_LIST[RING_INDEX[1]], RING_LIST[RING_INDEX[2]]]
REF_LIST = ['B','C']
REF_INDEX = 0
REFLECTOR_SETTING = REF_LIST[REF_INDEX]
RING_SETTING_BORDER = '#1A1A67'
RING_SETTING_COLOR = ['#DEEBF7','#9bbabf']
RING_SETTING = [0,0,0]
DISPLAY = ['A','A','A']
UPDATE = False
LB_BASE_LINK = list(range(5))
KB_BASE_LINK = list(range(5))
CIPHERS = ''
DECIPHERS = ''
CLICKED_CHR =''
OUTPUT_CHR = ''
PLUG_RIGHT_CHR = ''
PLUG_LEFT_CHR = ''
SELECTED_R = False
SELECTED_L = False
LAMPPOSITION = [0,0]
PRESSED_COUNTER = 0
START_INDEX = 0
END_INDEX = 0
TIMER_STEP = 3
SETTING_TIMER = 20
DICT_PAIRED = {}
OX = 5
OY = 5
PlugX = OX+5*TGLB_WIDTH + 5*X_GAP
PlugY = (OY + 3*TGLB_HEIGHT+4*Y_GAP)
PLUGBOARD_AREA = [[PlugX, PlugY], [PlugX + TGLB_WIDTH, PlugY],
[PlugX+TGLB_WIDTH, PlugY + CHIAN_H], [PlugX, PlugY + CHIAN_H]]
RT1_RING_SET = list(range(2))
RT2_RING_SET = list(range(2))
RT3_RING_SET = list(range(2))
SETTING_BTN_W = 30
SETTING_BTN_H = 18
SETTING_BTN_COLOR = '#cccc66'
#rotor1, left
x = (OX + TGLB_WIDTH + X_GAP) + 2
y = (OY + TGLB_HEIGHT + Y_GAP) + Y_GAP - 1
RT1_RING_SET[0] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor1, right
x = (OX + 2*TGLB_WIDTH + X_GAP) - 2 - SETTING_BTN_W
y = (OY + TGLB_HEIGHT + Y_GAP) + Y_GAP - 1
RT1_RING_SET[1] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor2, left
x = (OX + 2*TGLB_WIDTH + 2*X_GAP) + 2
y = (OY + TGLB_HEIGHT + Y_GAP) + Y_GAP - 1
RT2_RING_SET[0] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor2, right
x = (OX + 3*TGLB_WIDTH + 2*X_GAP) - 2 - SETTING_BTN_W
y = (OY + TGLB_HEIGHT + Y_GAP) + Y_GAP - 1
RT2_RING_SET[1] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor3, left
x = (OX + 3*TGLB_WIDTH + 3*X_GAP) + 2
y = (OY + TGLB_HEIGHT + Y_GAP) + Y_GAP - 1
RT3_RING_SET[0] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor3, right
x = (OX + 4*TGLB_WIDTH + 3*X_GAP) - 2 - SETTING_BTN_W
y = (OY + TGLB_HEIGHT + Y_GAP) + Y_GAP - 1
RT3_RING_SET[1] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
RING_SETTING_AREA = [RT1_RING_SET,RT2_RING_SET,RT3_RING_SET]
#reflector setting area
#Reflector, left
REF_SET_AREA = list(range(2))
x = OX
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
REF_SET_AREA[0] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#Reflector, right
x = (OX + TGLB_WIDTH) - 2 - SETTING_BTN_W
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
REF_SET_AREA[1] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#ring order setting area
RT1_RING_OD = list(range(2))
RT2_RING_OD = list(range(2))
RT3_RING_OD = list(range(2))
#rotor1, left
x = (OX + TGLB_WIDTH + X_GAP) + 2
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
#y = (OY + 2*TGLB_HEIGHT + 2*Y_GAP) + Y_GAP - 1
RT1_RING_OD[0] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor1, right
x = (OX + 2*TGLB_WIDTH + X_GAP) - 2 - SETTING_BTN_W
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
RT1_RING_OD[1] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor2, left
x = (OX + 2*TGLB_WIDTH + 2*X_GAP) + 2
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
RT2_RING_OD[0] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor2, right
x = (OX + 3*TGLB_WIDTH + 2*X_GAP) - 2 - SETTING_BTN_W
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
RT2_RING_OD[1] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor 3, left
x = (OX + 3*TGLB_WIDTH + 3*X_GAP) + 2
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
RT3_RING_OD[0] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
#rotor3, right
x = (OX + 4*TGLB_WIDTH + 3*X_GAP) - 2 - SETTING_BTN_W
y = (OY + 2*TGLB_HEIGHT+3*Y_GAP) + Y_GAP - 1
RT3_RING_OD[1] = [[x,y],
[x + SETTING_BTN_W, y],
[x + SETTING_BTN_W, y + SETTING_BTN_H ],
[x, y + SETTING_BTN_H]]
RING_ORDER_AREA = [RT1_RING_OD,RT2_RING_OD,RT3_RING_OD]
#reset button
x = (OX + 5*TGLB_WIDTH + 5*X_GAP) +2
y = OY+ Y_GAP - 1
RESET_BTN_AREA= [[x,y],
[x + RESET_BTN_W, y],
[x + RESET_BTN_W, y + RESET_BTN_H ],
[x, y + RESET_BTN_H]]
#print("AFTER GLOBAL DECLARATION")
#Helper Function to run the enigma machine manipulation
#Helper function to instantiate the enigma
def instantiateEnigma():
global POSITION, LAMPPOSITION, POSITIONKEY
global RING_SETTING, PRESSED_COUNTER,PLUG_SETTING
global UPDATE
global Pub,PubUI,rotor,reflector,enigma,rotorUI,reflectorUI
global RING_INDEX, RING_LIST, RINGS
print(RING_INDEX)
print(RING_LIST)
print(RINGS)
global REF_LIST,REF_INDEX,REFLECTOR_SETTING
global CIPHERS,DECIPHERS
#RING_INDEX = [2,1,0]
#RINGS= [RING_LIST[RING_INDEX[0]], RING_LIST[RING_INDEX[1]], RING_LIST[RING_INDEX[2]]]
POSITION = [0,0]
LAMPPOSITION = [0,0]
POSITIONKEY = [0,0]
PRESSED_COUNTER = 0
CIPHERS = ''
DECIPHERS = ''
if PLUG_SETTING != '':
#plugSettingObject.set_text(PLUG_SETTING)