Difference between revisions of "Enigma/primer"

From Teknologisk videncenter
Jump to: navigation, search
m (New page: =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 ...)
 
m
Line 6: Line 6:
 
|[[Image:Enigma3.png|400px|thumb|The scrambling action of the Enigma rotors are shown for two consecutive letters.]]
 
|[[Image:Enigma3.png|400px|thumb|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.
 +
<source lang=c>
 +
byte wheel[2][8] = {
 +
/* Wheel 1 */              {  2,  7,  1,  5,  6,  3,  0,  4},
 +
/* Wheel 2 */              {  5,  0,  7,  2,  1,  6,  4,  3} };
 +
 +
/* Notch array for wheels*/
 +
byte wheel_notch[2] =      { 3, 6 };
 +
 +
byte rwheel[2][8] = {
 +
/* Reverse wheel 1 */      {  6,  2,  0,  5,  7,  3,  4,  1},
 +
/* Reverse wheel 2 */      {  1,  4,  3,  7,  6,  0,  5,  2} };
 +
 +
/* Rotor reflector*/
 +
byte rr[8] =                {  7,  4,  6,  5,  1,  3,  2,  0};
 +
</source>
 
[[Category:CoE]]
 
[[Category:CoE]]
=
 

Revision as of 11:34, 5 December 2010

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.

byte wheel[2][8] = {
/* Wheel 1 */               {  2,   7,   1,   5,   6,   3,   0,   4},
/* Wheel 2 */               {  5,   0,   7,   2,   1,   6,   4,   3} };

/* Notch array for wheels*/
byte wheel_notch[2] =       { 3, 6 };

byte rwheel[2][8] = {
/* Reverse wheel 1 */       {  6,   2,   0,   5,   7,   3,   4,   1},
/* Reverse wheel 2 */       {  1,   4,   3,   7,   6,   0,   5,   2} };

/* Rotor reflector*/
byte rr[8] =                {  7,   4,   6,   5,   1,   3,   2,   0};