Difference between revisions of "Enigma"

From Teknologisk videncenter
Jump to: navigation, search
m
m (8 bit Enigma machine)
Line 1: Line 1:
 
=Enigma Articles=
 
=Enigma Articles=
== 8 bit Enigma machine ==
+
= 8 bit Enigma machine =
 
*[[Enigma/Example C-program 8 bit|8 bit enigma for crypting/decrypting files]]
 
*[[Enigma/Example C-program 8 bit|8 bit enigma for crypting/decrypting files]]
 +
== Number of possible keys when using three wheels==
 +
In the example below there is a caculation of possible keys that is
 +
*Three whells of 8 bit each diffently coded (fx. wheel[0]=67,wheel[1]=234 .. wheel[67]=165 .. )
 +
*An 8 bit Rotor-Reflector which is symmetricaly coded. (Fx. rr[0]=67 then rr[67]=0 etc. )
 +
*When the encryption/decryption starts each wheel can be in 1 of 256 positions. Called the notch position
 
<source lang=cli>
 
<source lang=cli>
 
heth@MachoGPU:~/enigma$ <input>bc</input>
 
heth@MachoGPU:~/enigma$ <input>bc</input>

Revision as of 09:26, 4 December 2010

Enigma Articles

8 bit Enigma machine

Number of possible keys when using three wheels

In the example below there is a caculation of possible keys that is

  • Three whells of 8 bit each diffently coded (fx. wheel[0]=67,wheel[1]=234 .. wheel[67]=165 .. )
  • An 8 bit Rotor-Reflector which is symmetricaly coded. (Fx. rr[0]=67 then rr[67]=0 etc. )
  • When the encryption/decryption starts each wheel can be in 1 of 256 positions. Called the notch position
heth@MachoGPU:~/enigma$ <input>bc</input>
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
<input>/* Define the Factorial function */ 
define frac(x) {
  if (x>1) {
    return (x * f (x-1))
  }
  return (1)

}

/* Number of possible alterations of a 8 bit wheel */
wheel=frac(256)
print wheel</input>
85781777534284265411908227168123262515778152027948561985965565037726\
94525531475893774402913604514084503758853423365843061571968346936964\
75322289288497426025679637332563368786442675207626794560187968867971\
52114330770207752664645146470918732610083287632570281898077367178145\
41702505230186084953190681382574810702528175594594769870346657127381\
39286205234756808218860701203611083152093501947437109101726968262861\
60626366243502284094419140842461593600000000000000000000000000000000\
0000000000000000000000000000000

<input> /* Number of installed wheels in enigma */
numberofwheels=3

/* Number of possible alterations of the 8 bit rotor-reflector.
   The rotor-reflector can't point to it-self. (fx. location 8 can't be 8)
*/
rotorreflector=frac(255)
print rotorreflector</input>
33508506849329791176526651237548149420225840635917407025767798842862\
08799035732771005626138126763314259280802118502282445926550135522251\
85672769253319307041281108333032565932204170002979216625073425339051\
37544660457112403384627010340202629925813784231472766366436471553963\
05352541105541439434840109915068285430675068591638581980604162940383\
35658673919826878210492461407660579356286524198217620742862096977680\
31494674313868079724382476891586560000000000000000000000000000000000\
00000000000000000000000000000
<input>

/* Number of possible startpositions of the three wheels.
   they are called a notch from the original mechanical solution
*/ 
notches=256*256*256
print notches</input>
16777216
<input>
/*Total number of Keys when using a 8 bit Enigma with three wheels */
wheel*numberofwheels*rotorreflector*notches</input>
14467425940815419878550914285328747194412838285887202913906796612290\
67116765686074239837002699523310587812021105128921519898929662849673\
80231859551685345801700678590340949512766773530970639425397581454798\
34629363249827620200556239557412599222204518999540726185192515996315\
06978129392323972906002241190936561257411009104030200763332968508802\
10053380885667825490547810051729838486330141341759611086561117956500\
02210195590742957751653052758866489611046357269440002628221514248948\
17132504901094529220429149272922120473850361954385338800798632554213\
60438811591136370963675381915493290515801660130577959111839885736840\
77541504957308491144024012326090397003948528853785364705857026051935\
47050340165465982389653696093503539510788359067272108792866788729818\
77493077624052679059588612553113715864219395902995530561734847463169\
09861780870355495760296743612825305064871402809304345105972352826182\
65297223680000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000