Enigma/primer

From Teknologisk videncenter
< Enigma
Revision as of 12:25, 5 December 2010 by Heth (talk | contribs)
Jump to: navigation, search

The Wheels

The Wheels can be installed in the Enigma in any sequence. If there are five different Wheels in total and the Enigma uses three Wheels. The total number of Wheel combinatins would be <math>5*4*3=60</math>

The actual mechanical Roters in a World War II Enigma. Notice Route Reflector B is installed
The scrambling action of the Enigma rotors are shown for two consecutive letters.

The software enigma

In the software Enigma you would need some random Wheels and a Random Rotor Reftlector. For examle this three bit Enigma.

Three bit Example

Crypt

In the example below if the input=2 its send to Wheel 1 position 2 which output will be 1 and that's input for Wheel 2 which outputs 0 to the Reflector that outputs 7 as input for Reverse Wheel 2 which output's 2 as input for Reverse wheel 1 which Output 0 as the encrypted message.

  • 2->1->0->7->2->0
Input                      0,   1,   <notice>2</notice>,   3,   4,   5,   6,   7 
Wheel 1                    2,   7,   <notice>1</notice>,   5,   6,   3,   0,   4
Wheel 2                    5,   <notice>0</notice>,   7,   2,   1,   6,   4,   3
Reflector                  <notice>7</notice>,   4,   6,   5,   1,   3,   2,   0
Reverse wheel 2            1,   4,   3,   7,   6,   0,   5,   <notice>2</notice>
Reverse wheel 1(output)    6,   2,   <notice>0</notice>,   5,   7,   3,   4,   1

Decrypt

  • Reverse: 0->2->7->0->1->2
Input                      <notice>0</notice>,   1,   2,   3,   4,   5,   6,   7 
Wheel 1                    <notice>2</notice>,   7,   1,   5,   6,   3,   0,   4
Wheel 2                    5,   0,   <notice>7</notice>,   2,   1,   6,   4,   3
Reflector                  7,   4,   6,   5,   1,   3,   2,   <notice>0</notice>
Reverse wheel 2            <notice>1</notice>,   4,   3,   7,   6,   0,   5,   2
Reverse wheel 1(output)    6,   <notice>2</notice>,   0,   5,   7,   3,   4,   1

The wheel notch

Each time a letter/digit is encrypted/decrypted - same process - the Wheels are ticked forward.

Tick 1

Wheel 1 is ticked forward on every encryption/decryption. See below. When the Notch - show in red below - ticks from 7 to 0 it will Tick the next Wheel. See Tick 2.

Wheel positions before Tick number 1
Input                      0,   1,   2,   3,   4,   5,   6,   7 
Wheel 1                    <notice>2,   7,   1,   5,   6,   3,   <error>0</error>,   4</notice>
Wheel 2                    5,   0,   7,   2,   1,   6,   <error>4,</error>   3
Reflector                  7,   4,   6,   5,   1,   3,   2,   0
Reverse wheel 2            <notice>1,   4,   3,   7,   6,   0,   5,   2</notice>
Reverse wheel 1(output)    6,   2,   0,   5,   7,   3,   4,   1
Wheel positions after Tick number 1
Input                      0,   1,   2,   3,   4,   5,   6,   7 
Wheel 1                    <notice>4,   2,   7,   1,   5,   6,   3,   <error>0</error></notice>
Wheel 2                    5,   0,   7,   2,   1,   6,   <error>4</error>,   3
Reflector                  7,   4,   6,   5,   1,   3,   2,   0
Reverse wheel 2            1,   4,   3,   7,   6,   0,   5,   2
Reverse wheel 1(output)    <notice>2,   0,   5,   7,   3,   4,   1,   6</notice>

Tick 2

Wheel 1's Notch is ticked from 7 to 0 it will Tick wheel 2 forward. The reflector will stay stationary.

Wheel positions before Tick number 2
Input                      0,   1,   2,   3,   4,   5,   6,   7 
Wheel 1                    <notice>4,   2,   7,   1,   5,   6,   3,   <error>0</error></notice>
Wheel 2                    5,   0,   7,   2,   1,   6,   <error>4</error>,   3
Reflector                  7,   4,   6,   5,   1,   3,   2,   0
Reverse wheel 2            1,   4,   3,   7,   6,   0,   5,   2
Reverse wheel 1(output)    <notice>2,   0,   5,   7,   3,   4,   1,   6</notice>
Wheel positions after Tick number 2
Input                      0,   1,   2,   3,   4,   5,   6,   7 
Wheel 1                    <notice><error>0</error>,   4,   2,   7,   1,   5,   6,   3</notice>
Wheel 2                    <notice>3,   5,   0,   7,   2,   1,   6,   <error>4</error></notice>
Reflector                  7,   4,   6,   5,   1,   3,   2,   0
Reverse wheel 2            <notice>2,   1,   4,   3,   7,   6,   0,   5</notice>
Reverse wheel 1(output)    <notice>6,  2,   0,   5,   7,   3,   4,   1</notice>