forked from ioccc-src/temp-test-ioccc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1253 lines (1129 loc) · 63.7 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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- END: this line ends content from: inc/top.default.html -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<link rel="stylesheet" href="../../ioccc.css">
<link href="https://fonts.googleapis.com/css2?family=Outfit:[email protected]&display=swap" rel="stylesheet">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2020/ferguson2 - Most enigmatic</title>
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
<meta name="description" content="2020 IOCCC entry ferguson2 - Most enigmatic">
<meta name="keywords" content="IOCCC, 2020, IOCCC 2020, IOCCC entry, ferguson2, Most enigmatic">
</head>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- END: this line ends content from: inc/head.default.html -->
<!-- -->
<!-- This web page was formed via the tool: bin/readme2index.sh -->
<!-- The content of main section of this web page came from: 2020/ferguson2/README.md -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2020/ferguson2/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2020/ferguson2/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2020/ferguson2/README.md !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/topbar.default.html -->
<div class="theader">
<nav class="topbar">
<div class="container">
<div class="logo">
<a href="../../index.html" class="logo-link">
IOCCC
</a>
</div>
<div class="topbar-items">
<div class="item">
<span class="item-header">
Entries
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../years.html" class="sub-item-link">
Winning entries
</a>
</div>
<div class="outfit-font">
<a href="../../authors.html" class="sub-item-link">
Winning authors
</a>
</div>
<div class="outfit-font">
<a href="../../location.html" class="sub-item-link">
Location of authors
</a>
</div>
<div class="outfit-font">
<a href="../../bugs.html" class="sub-item-link">
Bugs and (mis)features
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
Fixing entries
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#fix_author" class="sub-item-link">
Updating author info
</a>
</div>
</div>
</div>
<div class="item">
<span class="item-header">
Status
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../news.html" class="sub-item-link">
News
</a>
</div>
<div class="outfit-font">
<a href="../../status.html" class="sub-item-link">
Contest status
</a>
</div>
<div class="outfit-font">
<a href="../../next/index.html" class="sub-item-link">
Rules and guidelines
</a>
</div>
<div class="outfit-font">
<a href="../../markdown.html" class="sub-item-link">
Markdown guidelines
</a>
</div>
<div class="outfit-font">
<a href="../../SECURITY.html" class="sub-item-link">
Security policy
</a>
</div>
</div>
</div>
<div class="item">
<span class="item-header">
FAQ
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../faq.html" class="sub-item-link">
Frequently Asked Questions
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#submit" class="sub-item-link">
How to enter
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#compiling" class="sub-item-link">
Compiling entries
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#running_entries" class="sub-item-link">
Running entries
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#help" class="sub-item-link">
How to help
</a>
</div>
</div>
</div>
<div class="item">
<span class="item-header">
About
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../index.html" class="sub-item-link">
Home page
</a>
</div>
<div class="outfit-font">
<a href="../../about.html" class="sub-item-link">
About the IOCCC
</a>
</div>
<div class="outfit-font">
<a href="../../judges.html" class="sub-item-link">
The Judges
</a>
</div>
<div class="outfit-font">
<a href="../../thanks-for-help.html" class="sub-item-link">
Thanks for the help
</a>
</div>
<div class="outfit-font">
<a href="../../contact.html" class="sub-item-link">
Contact us
</a>
</div>
</div>
</div>
</div>
</div>
</nav>
<div class="header-mobile-menu">
<noscript>
<a href="../../nojs-menu.html" class="topbar-js-label">
Please Enable JavaScript
</a>
</noscript>
<button id="header-open-menu-button" class="topbar-mobile-menu">
<img
src="../../png/hamburger-icon-open.png"
alt="hamburger style menu icon - open state"
width=48
height=48>
</button>
<button id="header-close-menu-button" class="hide-content">
<img
src="../../png/hamburger-icon-closed.png"
alt="hamburger style menu icon - closed state"
width=48
height=48>
</button>
<div id="mobile-menu-panel" class="hide-content">
<div class="mobile-menu-container">
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
Entries
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../years.html">
Winning entries
</a>
<a class="mobile-submenu-item" href="../../authors.html">
Winning authors
</a>
<a class="mobile-submenu-item" href="../../location.html">
Location of authors
</a>
<a class="mobile-submenu-item" href="../../bugs.html">
Bugs and (mis)features
</a>
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
Fixing entries
</a>
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
Updating author info
</a>
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
Thanks for the help
</a>
</div>
</div>
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
Status
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../news.html">
News
</a>
<a class="mobile-submenu-item" href="../../status.html">
Contest status
</a>
<a class="mobile-submenu-item" href="../../next/index.html">
Rules and guidelines
</a>
<a class="mobile-submenu-item" href="../../markdown.html">
Markdown guidelines
</a>
<a class="mobile-submenu-item" href="../../SECURITY.html">
Security policy
</a>
</div>
</div>
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
FAQ
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../faq.html">
Frequently Asked Questions
</a>
<a class="mobile-submenu-item" href="../../faq.html#submit">
How to enter
</a>
<a class="mobile-submenu-item" href="../../faq.html#compiling">
Compiling entries
</a>
<a class="mobile-submenu-item" href="../../faq.html#running_entries">
Running entries
</a>
<a class="mobile-submenu-item" href="../../faq.html#help">
How to help
</a>
</div>
</div>
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
About
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../index.html">
Home page
</a>
<a class="mobile-submenu-item" href="../../about.html">
About the IOCCC
</a>
<a class="mobile-submenu-item" href="../../judges.html">
The Judges
</a>
<a class="mobile-submenu-item" href="../../contact.html">
Contact us
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var headerOpenMenuButton = document.getElementById("header-open-menu-button");
var headerCloseMenuButton = document.getElementById("header-close-menu-button");
var mobileMenuPanel = document.getElementById("mobile-menu-panel");
headerOpenMenuButton.addEventListener("click", () => {
headerOpenMenuButton.classList.remove("topbar-mobile-menu");
headerOpenMenuButton.classList.add("hide-content");
headerCloseMenuButton.classList.remove("hide-content");
headerCloseMenuButton.classList.add("topbar-mobile-menu");
mobileMenuPanel.classList.remove("hide-content");
mobileMenuPanel.classList.add("topbar-mobile-panel");
});
headerCloseMenuButton.addEventListener("click", () => {
headerCloseMenuButton.classList.remove("topbar-mobile-menu");
headerCloseMenuButton.classList.add("hide-content");
mobileMenuPanel.classList.add("hide-content");
mobileMenuPanel.classList.remove("topbar-mobile-panel");
headerOpenMenuButton.classList.add("topbar-mobile-menu");
headerOpenMenuButton.classList.remove("hide-content");
});
</script>
<!-- END: this line ends content from: inc/topbar.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<div class="header">
<a href="../../2011/zucker/index.html">
<img src="../../png/ioccc.png"
alt="IOCCC image by Matt Zucker"
width=300
height=110>
</a>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2020/ferguson2 - Most enigmatic</h2>
<h3>Enigma machine</h3>
</div>
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/navbar.mid.html -->
<div class="navbar">
<a class="Left" href="../ferguson1/index.html">← 2020/ferguson1</a>
<a class="Left" href="../index.html">↑ 2020 ↑</a>
<a class="Left" href="../giles/index.html">2020/giles →</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.c">C code</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/Makefile">Makefile</a>
<a class="Right" href="#inventory">Inventory</a>
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2020%2Fferguson2%2Findex.html">✓</a>
</div>
<!-- END: this line ends content from: inc/navbar.mid.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<div class="content" id="content">
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
<h2 id="author">Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- BEFORE: 1st line of markdown file: 2020/ferguson2/README.md -->
<h2 id="to-build">To build:</h2>
<pre><code> make</code></pre>
<p>The author provided alternate code that prints the output one character at a
time to make it a bit more like the real thing in that it isn’t dumped out all
at once. See <a href="#alternate-code">Alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<pre><code> ./prog
# get recode help:
./recode -h
# general syntax for recode passing to Enigma machine:
./recode [options] | ./prog - 2>/dev/null
# general syntax for recode without passing to Enigma machine:
./recode [options]
# recode prompts for settings; pass to Enigma machine:
./recode | ./prog - 2>/dev/null
# recode reads from input file, prompts for settings; passed to Enigma machine:
./recode -finput | ./prog - 2>/dev/null
# recode reads config from string or file; passed to Enigma machine after
# prompting for input:
./recode -R<string|file> | ./prog - 2>/dev/null
# write config to output file; passed to Enigma machine after prompting for
# input:
./recode -o<config> | ./prog - 2>/dev/null
# pseudo-randomly select settings
./recode -r
# show Enigma machine settings after selection / generation:
./recode -v</code></pre>
<p><strong>NOTE</strong>: in <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/recode.c">recode</a> no spaces between options and option arguments
are allowed.</p>
<h2 id="try">Try:</h2>
<pre><code> ./try.sh</code></pre>
<p>What does:</p>
<pre><code> echo | ./recode
echo | ./recode -v</code></pre>
<p>do?</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.alt.c">prog.alt.c</a>, writes a character at a time, sleeping
after each character, so that one can read it more easily (for longer output)
and to make it a bit more like the real thing.</p>
<h3 id="alternate-build">Alternate build:</h3>
<pre><code> make alt</code></pre>
<p>The default time to sleep is 400000 microseconds but you can change this by
doing:</p>
<pre><code> make clobber SLEEP=600000 alt</code></pre>
<p>to change it to 600000 microseconds. It guards against negative numbers.</p>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<pre><code> ./try.alt.sh</code></pre>
<p>Notice how only the last part should use the <code>prog.alt</code>. Why? Try it and find
out! Can you figure out why this works this way?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This code is an <a href="https://youtu.be/ybkkiGtJmkM">enigma</a>. Try to decode it!</p>
<p>There is a good deal of useful documentation that is provided with this entry:</p>
<ul>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/enigma.1">enigma.1</a> - A useful man page for this entry. To render, try:</li>
</ul>
<pre><code> man ./enigma.1</code></pre>
<ul>
<li><a href="recode.html">recode.html</a>
<ul>
<li>Some useful information about <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/recode.c">recode.c</a></li>
</ul></li>
<li><a href="enigma.txt">enigma.txt</a>
<ul>
<li>NOTE: see <a href="recode.html">recode.html</a> (or <a href="recode.html">recode.html</a> for details about how to decrypt this!</li>
</ul></li>
<li><a href="testing-procedure.html">testing-procedure</a>
<ul>
<li>How the author tested the code and why it was necessary to do it in the way it was</li>
</ul></li>
</ul>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>My remarks about my <a href="https://en.wikipedia.org/wiki/German_Army_(1935%E2%80%931945)">Heer</a> (army) and <a href="https://en.wikipedia.org/wiki/Luftwaffe">Luftwaffe</a> (air force) <a href="https://www.cryptomuseum.com/crypto/enigma/index.htm">Enigma
machine</a> <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.c">simulator</a> for
the 27th IOCCC.</p>
<p>I want to dedicate this entry in part to the millions of poor souls that were
lost during the tragedy that is the <a href="https://en.wikipedia.org/wiki/World_War_II">Second World
War</a>. There are so many people
who are unknown, unloved, unclaimed and even unidentified. And who knows what
they might have gone on to do if their lives weren’t - like it is with all other
wars - needlessly taken from them? When one considers it was all because the
most powerful man in the world at the time felt he should rule all others it
makes it somehow even more tragic: there wasn’t even a good reason for the war
(is there ever?).</p>
<p>If one were to write the name of every person who died in the conflict in a
book, it would take so many pages that the book would be so heavy, so long, so
expensive to print and it wouldn’t bring anyone back to life nor would it erase
the suffering. Nothing will. It’s horrible.</p>
<p>There really are no words that can truly describe the tragedy but I wish to with
my <a href="https://www.cryptomuseum.com/crypto/enigma/index.htm">Enigma</a> simulator honour each and every soul who was lost, or suffered, or
suffered the loss of friends or loved ones, as well as the world itself, in and
from one of the greatest tragedies in the history of mankind.</p>
<p>I have more information on this entry like the testing procedure at
<a href="https://ioccc.xexyl.net/2020/enigma" class="uri">https://ioccc.xexyl.net/2020/enigma</a>.</p>
<div id="toc">
<ul>
<li><a href="#ioccc">IOCCC: an Enigma?</a></li>
<li><a href="#nathan">The 1992 Nathan Sidwell entry</a></li>
<li><a href="#usage">Usage</a>
<ul>
<li><a href="#example">Example run</a></li>
</ul></li>
<li><a href="#recode">The recode.c configurator</a></li>
<li><a href="#parsersubtlety">A parser subtlety that could cause confusion</a></li>
<li><a href="#layout">On the source code layout</a></li>
<li><a href="#obfuscation">Obfuscation</a></li>
<li><a href="#bugs">Bugs, limitations, differences from the real Enigma machines and general notes</a></li>
<li><a href="#kriegsmarine">Kriegsmarine support?</a></li>
<li><a href="#portability">Portability</a></li>
<li><a href="#winning">Winning thoughts, dedications and thanks</a></li>
<li><a href="#resources">Resources</a></li>
</ul>
</div>
<div id="ioccc">
<h3 id="ioccc-an-enigma">IOCCC: an Enigma?</h3>
</div>
<p>Is there a better single word that could describe the code that is IOCCC? I’m
sure there are some other words that are equally as valid but I believe ‘Enigma’
is a great word nonetheless.</p>
<p>However it’s curious that no winning entry has ever been a simulator of the
<a href="https://en.wikipedia.org/wiki/Enigma_machine">German Enigma machine</a>. I was
actually quite surprised (though pleased as it gave me the chance to learn about
it and submit and win an entry) at that because it’s such a brilliant piece of
engineering of the time even though it had a critical flaw: that no letter could
be itself; this combined with cribs (known or suspected plaintext) - which was
down to carelessness, capturing an Enigma and sometimes settings sheet, as well
as known messages the Germans started out with - allowed for <a href="https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma">cracking the
code</a>.</p>
<p>Combining this entry with two of the <a href="https://en.wikipedia.org/wiki/Morse_code">Morse
code</a> entries is particularly
interesting because that’s what the Germans did: the party sending the message
would first set up the machine, write down the letters and then transmit by
<a href="https://en.wikipedia.org/wiki/Morse_code">Morse code</a> the encoded message. Then
those picking up on the message would note the Morse code, translate it to the
alphabet and then input it into their Enigma machine configured in the same way
and thus have the original message.</p>
<p>The <a href="../../1998/dorssel/index.html">1998 ASCII / Morse code translator</a> entry by <a href="../../authors.html#Frans_van_Dorsselaer">Franz van
Dorsselaer</a> prints the Morse code of text;
and the <a href="../../2014/vik/index.html">2014 Morse audio transcoder</a> by <a href="../../authors.html#Daniel_Vik">Daniel
Vik</a> can be used to allow for the actual sound of it.
With my entry we can complete the loop!</p>
<div id="nathan">
<h3 id="the-1992-nathan-sidwell-entry">The 1992 Nathan Sidwell entry</h3>
</div>
<p>The author <a href="../../authors.html#Nathan_Sidwell">Nathan Sidwell</a> of the <a href="../../1992/nathan/index.html">1992 Worst
Abuse of the Rules</a> had this to say about his program:</p>
<blockquote>
<p>This program is a hello world text encrypter/decrypter. It uses an
<a href="https://www.cryptomuseum.com/crypto/enigma/index.htm">enigma</a> (I think) style
encryption algorithm, where the encryption key character is modified by a value,
determined from the previous character. Non-printable characters (those with
ASCII values <code>< ' '</code> or <code>> 0x7e</code>) are passed unaltered, thus any kind of file
may be successfully processed, but if the original is printable, the processed
file will be too. The input is read from stdin, and the output presented to
stdout. The key, a text string, is presented as a command argument. This is
optional, and if omitted, the file is self-{de,en}crypted. To specify
decryption, a <code>-</code> should be given before the key. (Actually encryption and
decryption proper inverse operations, so you can use decrypt to scramble and
encrypt to descramble, if you’re perverse.)</p>
</blockquote>
<p>But the Enigma algorithm is more complex than that and my entry can encipher
(and by extension decipher) text in the manner of the Enigma machines of the
<a href="https://en.wikipedia.org/wiki/German_Army_(1935%E2%80%931945)">Heer</a> (army) and <a href="https://en.wikipedia.org/wiki/Luftwaffe">Luftwaffe</a> (air
force); the <a href="https://en.wikipedia.org/wiki/Kriegsmarine">Kriegsmarine</a> (navy;
literally <code>War Nazy</code>) was more complex (see section <a href="#kriegsmarine">Kriegsmarine
support?</a> for more information on that.</p>
<p>My entry should also work as a non-military grade Enigma; they had no
<a href="https://www.cryptomuseum.com/crypto/enigma/i/sb.htm">plugboard</a> and by
default mine is empty. I explain how to set up the simulator later.</p>
<p><a href="../../authors.html#Yusuke_Endoh">Yusuke Endoh</a> asked the judges and me if the real
1992 entry source was available. Simon Cooper didn’t have access to it because
it was before his time in the IOCCC; but before the other judges could answer
<a href="../../authors.html#Ilya_Kurdyukov">Ilya Kurdyukov</a> sent a link to the original 1992
code. As of 4 March 2023 the original before unseen code was published but I
leave this in for historical purposes.</p>
<h3 id="usage">Usage</h3>
<p>If you run the program by itself it’ll use the default settings and prompt you
for input (end with EOF). At that point it’ll process the input string and print
the result (after finishing the enciphering).</p>
<p>If you run it like:</p>
<pre><code> ./prog -</code></pre>
<p>It will prompt you for the settings of the machine (example below).</p>
<p>The first group is in the order of
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm">rotor</a> (number),
<a href="https://en.wikipedia.org/wiki/Enigma_rotor_details#Ring_setting">ring setting</a> (letter) and
ring (starting) position (letter). It will do this for the first, second and
then third for each.</p>
<p>Then it will prompt you for the
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#Reflector">reflector</a> (by number).
The first one is reflector B and the second is reflector C.</p>
<p>Finally it’ll prompt you for the <a href="https://www.cryptomuseum.com/crypto/enigma/i/sb.htm">plugboard
pairs</a>.</p>
<p>After that you can input the string and it’ll go from there.</p>
<div id="example">
<h4 id="example-run">Example run</h4>
</div>
<p>BTW: There’s a much more entertaining way to explore this entry. See
<a href="recode.html">recode.html</a> for more details. There’s a secret message that one might like
to decipher. These however show the general program as well as how to use the
two winning entries of the <a href="https://en.wikipedia.org/wiki/Morse_code">Morse
code</a> that I referred to earlier:</p>
<pre><code> $ ./prog -
Ring 1: 3
Setting 1: I
Position 1: O
Ring 2: 1
Setting 2: C
Position 2: C
Ring 3: 5
Setting 3: C
Position 3: Z
Reflector: 2
Plugboard pair 1: CO
Plugboard pair 2: DE
Plugboard pair 3: SN
Plugboard pair 4: XY
Plugboard pair 5: MS
Plugboard pair 6: AT
Plugboard pair 7: VF
Plugboard pair 8: UR
Plugboard pair 9: KL
Plugboard pair 10: BJ
IOCCC
^D
CFDRG</code></pre>
<p>Notice that all output except the deciphered/enciphered text is sent to stdout.</p>
<p>If I didn’t specify the <code>-</code> by e.g. <code>echo IOCCC | ./prog</code> then it will use the
default settings; as the judges suggest this invocation I will not show it here.</p>
<p>But you can also type it out like this:</p>
<pre><code> $ ./prog
IOCCC
UUMMX</code></pre>
<p>The IOCCC comes from stdin; the <code>UUMMX</code> is written to stdout.</p>
<p>If I compile the 2014 entry and copy it to my local directory as
<code>vik</code> I might do:</p>
<pre><code> $ echo TEST|./prog |./vik | mplayer -demuxer rawaudio -</code></pre>
<p>And you would hear <a href="https://en.wikipedia.org/wiki/Morse_code">Morse code</a> of the
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm">Enigma</a> output
of ‘TEST’ (i.e. <code>KCWV</code>)! Or perhaps not in this case. I’m not sure: I discovered
a bug in that entry (Fedora, CentOS and macOS all affected).</p>
<p>For example I can use the syntax provided in the winning remarks along with my
entry to write it to a file. Say:</p>
<pre><code> $ echo TEST|./prog |./vik > test.raw
$ ./vik e < test.raw | ./prog
LEST</code></pre>
<p>Why did that happen? This shows more details:</p>
<pre><code> $ ./vik e < test.raw
SCWV</code></pre>
<p>However as can be seen the first char is wrong:</p>
<pre><code> $ echo TEST|./prog
KCWV</code></pre>
<p>And piping the original output to my entry itself you get the original input:</p>
<pre><code> $ echo TEST | ./prog | ./prog
TEST</code></pre>
<p>I’m not sure what causes that or if there’s a way to fix it but that’s the
idea anyway. Neither do I know if the original transcoding is correct.</p>
<p>What if I use the input string <code>LEST</code> instead? In that case it worked fine:</p>
<pre><code> $ echo LEST | ./prog | ./vik > lest.raw
$ ./vik e < lest.raw | ./prog
LEST</code></pre>
<p>But there’s one obvious question, right? Let’s try the most important one:</p>
<pre><code> $ echo IOCCC | ./prog | ./vik > ioccc.raw
$ ./vik e < ioccc.raw
UUMMX
$ ./vik e < ioccc.raw | ./prog
IOCCC</code></pre>
<p>Phew! The program redeemed itself after the test failure! :)</p>
<p>(Technically above it didn’t print a newline after the output and this is how it
is with some of the things I pasted in the other file and maybe others here
too. Notice also how it showed the same output that my program gave it - <code>UUMMX</code>.)</p>
<p>What about the other <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/dorssel/dorssel.c">Morse code entry</a>?</p>
<pre><code> $ echo IOCCC | ./prog | ./dorssel
..- ..- -- -- -..-</code></pre>
<div id="recode">
<h3 id="the-recode.c-configurator">The recode.c configurator</h3>
</div>
<p>I have included a supplementary program <a href="recode.c">recode.c</a> that can do a number of
things which acts as a kind of wrapper and configurator to my entry. By default
it prompts you for the settings
(<a href="https://en.wikipedia.org/wiki/Enigma_rotor_details">rotors</a>, <a href="https://en.wikipedia.org/wiki/Enigma_rotor_details#Ring_setting">rings and ring
settings</a> and
positions,
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#Reflector">reflector</a> and
<a href="https://www.cryptomuseum.com/crypto/enigma/i/sb.htm">plugboard pairs</a>,
validating input as you go.</p>
<p>After that it prompts for text that you can pass to the Enigma simulator;
alternatively you can specify a file to read in.</p>
<p>It has a randomise mode and it can save/read the settings to/from a file to
allow for duplicity (an archaic term for the state of being double but obviously
for Enigma it has to also mean deceitful).</p>
<p>I recommend using this in a pipeline instead of the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.c">simulator</a> itself
if you want to change the configuration of the simulator because it offers a
much richer experience (and because you can reuse the configuration without
having to type it out again every time).</p>
<p>It does take the effort to try and prevent invalid input (as above) though maybe
I didn’t think of everything. My entry was meant to be a simulator only as far
as the ciphering goes but I thought this would make it much more interesting:
make it more flexible by a wrapper program.</p>
<p>For examples using it you might enjoy a fun message that I have encrypted using
a key that you should be able to figure out (it’s in a list). This might lead to
something else fun as well but I will not say more than that. Anyway, see
<a href="recode.html">recode.html</a> for more details. See also the <a href="recode.1">recode.1</a> and
<a href="enigma.1">enigma.1</a> man pages.</p>
<div id="parsersubtlety">
<h3 id="a-parser-subtlety-that-could-cause-confusion">A parser subtlety that could cause confusion</h3>
</div>
<p>The parser is in a sense rather rudimentary but allows for both interactive and automatic
(e.g., via the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/recode.c">recode</a> program) input.
This does mean that something like the following can happen:</p>
<pre><code> $ ./prog -
Ring 1: 1AB
Setting 1: Position 1: Ring 2: 2CD
Setting 2: Position 2: Ring 3: 3
Setting 3: A
Position 3: B
Reflector: 1A
Plugboard pair 1: BC
Plugboard pair 2: ..
Plugboard pair 3: ..
Plugboard pair 4: DE
Plugboard pair 5: FG
Plugboard pair 6: HI
Plugboard pair 7: JK
Plugboard pair 8: LM
Plugboard pair 9: NO
Plugboard pair 10: PQ
IOCCC
WD
SIRDK</code></pre>
<p>First of all: what is that <code>WD</code>? I didn’t type that but it showed up hitting
<code>ctrl-d</code> to end input.</p>
<p>If everything is input correctly it would show nothing except the actual
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm">Enigma machine</a> output
(maybe at times ^D - I have noticed this at least when I don’t fill in all
<a href="https://www.cryptomuseum.com/crypto/enigma/i/sb.htm">plugboard</a> pairs - which
might or might not be possible with the Enigma machines that had plugboards; I
really do not know). I don’t view this as a bug because the parsing of input is
meant to be simple and in fact you can expect the same output from the same
input even if there are errors in the input.</p>
<p>Anyway as you can see the first <code>1AB</code> was the first ring, setting and position.
After this it wants Ring 2 and I did similar; for ring 3 I did it each variable
by itself. However for the reflector I did <code>1A</code> but it only expects 1 char! So
will that mean that the plugboard pairs are off? Yes it does seem to be so. This
is buffering at play I believe but it’s useful for allowing the <code>recode</code> program
to easily configure the Enigma machine. In the <a href="recode.html">recode.html</a> file
file I give a hint as to how this could be fixed but the caveat is it would
necessitate a need for rewriting
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/recode.c">recode.c</a>.</p>
<p>There’s another thing to be aware of and that’s the way the ranges are enforced.
There are five rotors which obviously are in C 0-4 but in ‘natural language’
1-5 (they were labelled I, II, III, IV and V though).</p>
<p>There are two
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#Reflector">reflectors</a> and the
same applies: in C 0-1 but in human it’s 1-2 (technically these were reflectors B and C in
the Enigma machine which I display by name in <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/recode.c">recode.c</a> just like
with the rotors).</p>
<p>For more information see <a href="recode.html">recode.html</a>.</p>
<p>BTW: If you need a reminder to go to the gym just do your Enigma ABCs and it
should help you remember:</p>
<pre><code> $ echo ABC | ./prog
GYM
$ echo ABC | ./prog | ./prog
ABC</code></pre>
<div id="layout">
<h3 id="on-the-source-code-layout">On the source code layout</h3>
</div>
<p>The layout of <a href="recode.c">recode.c</a> isn’t too significant (but see below) but I want to
mention <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.c">prog.c</a> especially:</p>
<p>I did think of a more artistic layout but
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#Reflector">reflecting</a>
on it I think that the blankness of it can be another way of honouring all the
many people who died in - like all other wars - what was a useless conflict
because - again like all other wars - a powerful human being decided that they
should rule others.</p>
<p>The blankness is a
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#Reflector">reflection</a>
of the millions of people who died unknown, uncared for, unloved, without ever
being acknowledged in their far too short lives, some even unidentified; it’s
the presence of absence.</p>
<p>I find it somehow fitting that the day I have finished this is 30 April 2020,
which was exactly 75 years from the day that the person responsible for the
<a href="https://en.wikipedia.org/wiki/World_War_II">Second World War</a>, Adolf Hitler,
ended his life. (I later made a bug fix but I consider this inconsequential).</p>
<p>As for <a href="recode.c">recode.c</a> though I really love this:</p>
<pre><code> /\
/ This is *not* what you think:</code></pre>
<p>…because it seems so wrong in C code at first glance. Also what does the
‘this’ refer to?</p>
<h3 id="obfuscation">Obfuscation</h3>
<p>It’s an <a href="https://en.wikipedia.org/wiki/Enigma_machine">Enigma machine</a> simulator! Isn’t
that proof that it’s obfuscated itself?! :) Silliness aside <a href="obfuscation.txt">obfuscation.txt</a>
has some of the ways I think this entry is obfuscated. To decipher try:</p>
<pre><code> ./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > obfuscation.md</code></pre>
<p>To encipher:</p>
<pre><code> ./recode -Robfuscation.key -fobfuscation.md | ./prog - 2>/dev/null > obfuscation.txt</code></pre>
<p>The file <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/obfuscation.key">obfuscation.key</a> is the key to decipher/encipher
<a href="obfuscation.txt">obfuscation.txt</a>.</p>
<p>For the lazy <a href="obfuscation.html">obfuscation.html</a> has the deciphered version.</p>
<p>As for the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/obfuscation.key">obfuscation.key</a> file if you observe the contents you’ll find the
word <code>OBFUSCATION</code>:</p>
<pre><code> 2OB5FU1SC2ATIONCDEFGHJKLMPQRYZ
OB FU SC ATION</code></pre>
<div id="bugs">
<h3 id="bugs-limitations-differences-from-the-real-enigma-machines-and-general-notes">Bugs, limitations, differences from the real Enigma machines and general notes</h3>
</div>
<p>Ways that my simulator differs from the real thing. Not all of these are bugs
and some could be considered features; others are just differences.</p>
<ul>
<li><p>Does not check for using the same
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#Reflector">rotor</a>
more than once. The real Enigma machines this would not work because they had to
choose from a set of rotors and there were no duplicates. This shouldn’t be a
problem here however except that it wouldn’t be a possible configuration of the
real Enigma machine. The <code>recode</code> program <em>however does validate this</em> (except
when reading in settings via the <code>-R</code> option which I explain in the
<a href="recode.html">recode.html</a> file.</p></li>
<li><p>The way the <a href="https://www.cryptomuseum.com/crypto/enigma/i/sb.htm">plugboard</a>
- for the machines that had them - is, if you connect A to B then no other
letters can connect to A or B. Earlier there wasn’t proper detection and this
caused invalid output.</p>
<p>Why only 10 pairs when the German alphabet has 26 letters (the Enigma did
not have the Eszett or the umlauts and in any case there is some
disagreement about these being part of the alphabet; anyway for umlauts one
can add an E after the letter and for the Eszett you can use ‘ss’ or ‘SS’
which is what they did)? It’s theoretically possible to have 13 but the
Enigma typically had 10 pairs. It’s easy enough to update my entry to do
this once you de-obfuscate it but I’m not helping there (and in fact I don’t
think I could any more even if I wanted to - at least not easily).</p></li>
<li><p>It does not obviously have the clicking sound associated with the moving
parts of the real machine. I think it would be annoying to have this as it
processes each letter - but with the <a href="../../2014/vik/index.html">2014 Morse audio transcoder</a> entry you
can at least have the output played in Morse code as the Germans did; I think
that’s really cool (I think it’s really cool even if there’s a bug in it). That
it pays homage to that (and another) entry is a bonus here.</p></li>
<li><p>The <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.c">simulator</a> doesn’t report errors but tries to gracefully deal
with them: if one chooses a value out of range it moves it into the range (if >
the max then the max, if < min then the min). If invalid chars are input for the
plugboard pairs then it’s not added to the plugboard etc.</p></li>
<li><p>The real <a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm">Enigma
machines</a> had
only letters: no digits, no punctuation. My entry prints <code>!isalpha()</code> chars
untouched. The Germans had different systems for punctuations, numbers etc. (one
of the documents I link to has these details).</p></li>
<li><p>My entry preserves case of letters. The real Enigma had only one case as it
was just a keyboard and they didn’t need case-sensitivity. Context would be
important as some words in German have different meanings depending on if
capitalised or not (and all nouns are capitalised).</p></li>
<li><p>Later models introduced a fourth rotor. The
<a href="https://en.wikipedia.org/wiki/Kriegsmarine">Kriegsmarine</a> procedures were
also far more complex than the <a href="https://en.wikipedia.org/wiki/German_Army_(1935%E2%80%931945)">Heer</a> (army) and <a href="https://en.wikipedia.org/wiki/Luftwaffe">Luftwaffe</a> (air force)
(though apparently the additional notch provided another flaw). I find this particularly
interesting because it was Hermann Goering who was the Supreme Commander of the
Luftwaffe and the intelligence agency Forschungsamt (FA) was his; it provided
Hitler with invaluable information so one would think the Luftwaffe system would
be more complex! See <a href="#kriegsmarine">Kriegsmarine support?</a> for more
information.</p></li>
<li><p>I only include
<a href="https://en.wikipedia.org/wiki/Enigma_machine#Reflector">reflectors</a> <a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#wiringtables">B and
C</a>.
To have included more would have used too many bytes (each reflector and
<a href="https://www.ciphermachinesandcryptology.com/en/enigmatech.htm#rotors">rotor</a> is
26 characters!) and I could not include them for this reason; I include five
rotors and two reflectors and that’s a total of (<code>5 * 26 + 2 * 26 == 182</code> chars)
but there are as you can see many other strings too. It is however feasible to
update the rotor and reflectors options and you could even make your own
versions if you wanted to. Doing this is an exercise to the reader however (the
idea of trying this makes me cringe because of how I obfuscated things including
encrypting some of it with the Enigma itself).</p></li>
</ul>
<p>There’s one thing I’m unsure of in my implementation. Because of all the
possible settings I used some other simulators as a starting point and more
importantly to validate that my code worked right. These other simulators had
bugs though and so one thing looked odd and I don’t know if it is right or not.
An online simulator appears correct but I don’t see the option to change that
part.</p>
<p>If you notice in the <code>Q()</code> function where I set up specific pointers and other
data there is a call to the macro <code>q</code> but I only refer to the first ring setting
(of which I no longer even know which element it is! Or was it position? I don’t
even know that now for certain). That’s because the Python code did that (though
very differently of course) but I also had to bug-fix the Python in another
part.</p>
<p>I do not know if this is correct but as I show somewhere my entry does match the
online simulator so I presume it is correct. It might be that the Germans tended
to have it at A but again I do not know.</p>
<div id="kriegsmarine">
<h3 id="kriegsmarine-support">Kriegsmarine support?</h3>
</div>
<p>Is it possible to add <a href="https://en.wikipedia.org/wiki/Kriegsmarine">Kriegsmarine</a>
support? I thought so by adding the additional rotors but looking at it again it
appeared that it’s not as simple as adding the rotors to the code and then
updating the references to the array etc.</p>
<p>This is because it had three additional
<a href="https://en.wikipedia.org/wiki/Enigma_rotor_details">rotors</a> - <a href="https://www.cryptomuseum.com/crypto/enigma/m4/index.htm#wheels"><code>VI</code>, <code>VII</code> and
<code>VII</code></a> - and had
<a href="https://en.wikipedia.org/wiki/Enigma_rotor_details#Turnover_notch_positions">two notches</a>
and this changes the way things work. The <a href="https://www.cryptomuseum.com/crypto/enigma/m4/index.htm">Kriegsmarine
M4</a> also had an
additional change which would complicate matters more.</p>
<p>I looked into trying to do this for another version after winning but some of
the obfuscation techniques dramatically complicates even attempting this so I
haven’t even tried.</p>
<p>It is feasible that you could add your own rotors however but I leave this as an
exercise to the reader. I will say that the five rotors I, II, III, IV and V can
be found in the source code verbatim and you could confirm it by looking them
up; however much more would have to be done in order to get them to work, than
to just put the strings in. Again the way I set things up complicates this
greatly.</p>
<h3 id="portability"><a href="#toc">Portability</a></h3>
<p>I have tested it under macOS, Fedora and CentOS Linux and all seems okay under
these platforms. When I was in the final stages of obfuscation I made an error
somehow (or else maybe the vim formatting caused a problem - I have seen this
before) and I had to go back and undo some of the obfuscation to figure out what
was going on (I had a hunch where and I noted it in the obfuscation I believe)
but this made me wonder on if I made any other mistakes since it appeared to be
working before that.</p>
<p>I don’t know if EBCDIC will work but I think it might because it appears that
the alphabet is a contiguous sequence. I don’t believe endianness matters but I
no longer remember what I’ve done in full and I’ve no way to test it.</p>
<p>If there are any inconsistencies in input/output one also has to be certain that
input was put in correctly because as soon as a letter differs the entire
sequence will be off.</p>
<p>The results of my test script (not included here but I will probably have it on
my website) are the same under Fedora, CentOS and macOS.</p>
<h3 id="resources">Resources</h3>
<h4 id="a-note-on-wehrmacht-its-branches-and-other-agencies-and-their-enigma-machines">A note on Wehrmacht, its branches and other agencies and their Enigma machines</h4>
<p>The <a href="https://en.wikipedia.org/wiki/Wehrmacht">Wehrmacht</a> was the defence force
in full which included the <a href="https://en.wikipedia.org/wiki/German_Army_(1935%E2%80%931945)">Heer</a> (army),
<a href="https://en.wikipedia.org/wiki/Luftwaffe">Luftwaffe</a> (air force) and
<a href="https://en.wikipedia.org/wiki/Kriegsmarine">Kriegsmarine</a> (navy). As I said the
Kriegsmarine procedures were more complex: they had additional rotors and one of
their models had a different
<a href="https://en.wikipedia.org/wiki/Enigma_machine#Reflector">reflector</a> system (thin
instead of thick - some of the documents below discuss this). The military
intelligence agency, the Abwehr, had their own system too. Non-military grade
Enigma machines didn’t have the
<a href="https://www.cryptomuseum.com/crypto/enigma/i/sb.htm">plugboard</a>. And so on.</p>
<p>However one of the documents below distinguishes the Kriegsmarine from the
Wehrmacht; when you see this you can read it as the Kriegsmarine versus the rest
of the Wehrmacht rather than the Wehrmacht and the Kriegsmarine.</p>
<p><a href="https://web.archive.org/web/20200710094321/http://users.telenet.be/d.rijmenants/en/enigmaproc.htm">Enigma Message Procedures</a>: The <a href="https://en.wikipedia.org/wiki/German_Army_(1935%E2%80%931945)">Heer</a>,
<a href="https://en.wikipedia.org/wiki/Luftwaffe">Luftwaffe</a> and
<a href="https://en.wikipedia.org/wiki/Kriegsmarine">Kriegsmarine</a>
<a href="https://en.wikipedia.org/wiki/Enigma_machine">Enigma</a>
procedures.</p>
<p><a href="http://enigmaco.de/enigma/enigma.html">Interactive Enigma Machine</a>: Shows wiring of the <a href="https://en.wikipedia.org/wiki/Enigma_machine">Enigma