The German Enigma Machine

http://www.cs.miami.edu/~harald/enigma/enigma.html

for close up views of the Enigma:

http://home.earthlink.net/~nbrass1/abwehr.htm
 
 
 
 
 
 
 
 
 
 
 
 
 
 

http://www.u571.com/globalnav/gnf.pl?url=http%3A//www.u-571.com/




 

Numerical Implementation

of the Caesar Cipher

using Modular Arithmetic

Modular Arithmetic:

25 % 3 = 1 means 1 is the remainder when 25 is divided by 3.

Uses of Modular Arithmetic we've seen:

Stripping off digits of a number (% 10)

Finding binary representation of a number (% 2)

Determining if an integer is odd or even (% 2)

Telling Time: In "clock arithmetic" there are only 12 numbers (hours):

0 (=12) 1 2 3 4 5 6 7 8 9 10 11

In clock arithmetic (% 12)

5 + 10 = ______

2 - 5 = _______

-5 = ________

Clock Arithmetic is denoted Z12

Life in Z12 has some familiar features but some thing's are very different:

-5 = 7 (the "negative" of a number may be bigger than the number!).

2 * 6 = 0 (The product of two nonzero numbers may = 0)

5 * 5 = 1 so = 5. The reciprocal of 5 is 5 (multiplicative inverse)

Not every number has an inverse:

The equation 2x = 1 has no solution in Z12
 
 
 
 
 
 
 
 

Caesar Cipher is done with arithmetic Modulo 26.

Represent letters by their position in alphabet
 
 
 
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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

If we shift by 14, then

S --> 19 --> 19 + 14 = 33 % 26 = 7 --> G
 

Operations in Modular Arithmetic

Addition and Multiplication are very easy.

Subtraction is easy.

Division is tricky, but not hard.
 
 
 
 

Finding Square Roots appears to be incredibly hard. No efficient technique is known.

Does 41 have a square root (mod 100)?

Is there an x such that x*x % 100 = 41 ?

Does 51 have a square root (mod 100)?