summaryrefslogtreecommitdiff
path: root/src/SW/Enigmatic/document.en.rest.txt
blob: be51083557273b6e7b7606cdc94eeed51f7f14ce (plain)
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
=========
Enigmatic
=========
---------------------------------------------
An emulator of the German WWII Enigma machine
---------------------------------------------
:CreationDate: 2011-08-30 20:16:43
:Id: SW/Enigmatic
:tags: - software
       - perl
 
Why would you ever write one?
=============================
 
During the `YAPC::EU 2011`_ dinner, people (not actually involved in
the organisation of the event) started idly talking about what to put
on the t-shirts for YAPC::EU 2012 in Frankfurt. Several very
inappropriate suggestions were made, mostly involving WWII; at some
point, the Enigma was mentioned, maybe because obfuscated Perl code
does not look that much different from an encrypted message. Then I
thought: I can quite probably write an Enigma emulator as a short
obfuscated Perl program.
 
So I started from a nicely-written, clean version, with the intention
of compressing / obfuscating it later. This "nice" version is about
15KB of source code, 13KB of tests, and 4.5MB of dependencies (mostly
Moose_TryCatch_autobox_)
 
.. _`YAPC::EU 2011`: http://yapceurope.lv/ye2011/
.. _Moose: https://metacpan.org/release/Moose
.. _TryCtach: https://metacpan.org/release/TryCatch
.. _autobox: https://metacpan.org/release/autobox
 
Resources and references
========================
 
Of course, I did not know enough about the actual workings of the
Enigma: having seen a few, and having seen the Turing Bombe in
operation, at `Bletchley Park`_, is not enough to write a proper
emulator. After a relatively short search, I found three main sources:
 
`Technical Details of the Enigma Machine`_, written by someone who
  wrote an emulator
`The Enigma cipher machine`_
`Enigma - a very famous story of cryptology`_
 
From these, I obtained just enough information to understand the mechanisms,
and more importantly, the wiring of the various components. In
addition, I found a `cyhpertext-plaintext pair`_ that I used to check
that my emulator worked exactly as the real thing.
 
.. _`Bletchley Park`: http://www.bletchleypark.org.uk/
.. _`Technical Details of the Enigma Machine`: http://users.telenet.be/d.rijmenants/en/enigmatech.htm
.. _`The Enigma cipher machine`: http://www.codesandciphers.co.uk/enigma/
.. _`Enigma - a very famous story of cryptology`: http://www.mlb.co.jp/linux/science/genigma/enigma-referat/enigma-referat.html
 
.. _`cyhpertext-plaintext pair`: http://users.telenet.be/d.rijmenants/en/m4project.htm