Governor’s School for the Sciences Mathematics Day 5
MOTD: Carl Friedrich Gauss (Germany) Genius, worked in many areas of math and physics
Question: Suppose you have a box of valuable stuff you want to send to a friend You and your friend each has a lock and several keys You have to use an untrustworthy messenger service to exchange the box How can you send the contents of your box safely to your friend?
Writing Secret Messages Transform a text message for safe transmission Must have simple rule for encoding and decoding Should be tough to break, eg. by mixing up the letter distribution
Substitution Cipher Make a rule or table giving the replacement for each letter Must be 1-1; thus reversable Doesn’t change the letter distribution Simple rules: additive and multiplicative ciphers
Additive (Shift) Cipher Pick a number P from 1-25 For each letter in the message shift it forward by P letters wrapping around from Z back to A P = 7: A -> H, L -> S, T -> A, Z -> G ILOVEMATH -> PSVCLTHAO Decode by moving backward by P letters or forward by 26-P letters
Cipher Wheel
Modular (Clock) Arithmetic Let S ={0, 1, 2, …, 25} For any number n there is a number r in S and an integer m such that n = 26*m + r We write n = r (mod 26) 32 = 6 (mod 26), -12 = 14 (mod 26) For x,y in S define x + y to be (x+y) (mod 26) x * y to be (x*y) (mod 26) = 1, 13*2 = 0, 4*7 = 2, 3 3 = 1 (Almost) All the rules of arithmetic still work
Additive Cipher II Convert each letter to its position in the alphabet, A->0, B->1, …, Z -> 25 Given shift P use modular arithmetic and add P to each value Convert back to text using the same scheme as above To decode, use –P (or 26-P) as the shift
Example Message: GSS ROCKS Convert: 6,18,18,17,14,2,10,18 Add 11: 17,3,3,2,25,13,21,3 Convert: RDDCZNVD Secret Message: RDDCZ NVD To decode, add 15 (or subtract 11)
Multiplicative Cipher Just like additive, but you multiply by the factor P To decode need Q = P -1, Q*P = 1 Determine Q by trial and error, some P don’t have inverses 5*21 = 105 = 1 (mod 26), 7*15 = 1 All the even numbers and 13 don’t have inverses
Example Message: GSS ROCKS Convert: 6,18,18,17,14,2,10,18 Multiply by 5: 4,12,12,7,18,10,24,12 Convert: EMMHS KYM To decode, multiply by 21
Quiz Bowl Time vs. Dr. Collins Team 3 vs. Denominators of Doom