National Cipher Challenge

Slides:



Advertisements
Similar presentations
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
Advertisements

Section 3.8: More Modular Arithmetic and Public-Key Cryptography
 Caesar used to encrypt his messages using a very simple algorithm, which could be easily decrypted if you know the key.  He would take each letter.
What is Elliptic Curve Cryptography?
Chapter 3 Math Vocabulary
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
Mathematics of Cryptography Part I: Modular Arithmetic
MAT 1000 Mathematics in Today's World Winter 2015.
Section 2.1: Shift Ciphers and Modular Arithmetic The purpose of this section is to learn about modular arithmetic, which is one of the fundamental mathematical.
Systems of Equations as Matrices and Hill Cipher.
Day 18. Concepts Plaintext: the original message Ciphertext: the transformed message Encryption: transformation of plaintext into ciphertext Decryption:
Section 2.1: Shift Ciphers and Modular Arithmetic Practice HW from Barr Textbook (not to hand in) p.66 # 1, 2, 3-6, 9-12, 13, 15.
CRYPTOGRAPHY AND THE MATH MAJOR Dr. Mihai Caragiu Mathematics Department Ohio Northern University.
RATIONAL EXPRESSIONS. Rational Expressions and Functions: Multiplying and Dividing Objectives –Simplifying Rational Expressions and Functions –Rational.
CSCI 391: Practical Cryptology Substitution Monoalphabetic Ciphers.
Governor’s School for the Sciences Mathematics Day 5.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
MAT 1000 Mathematics in Today's World Winter 2015.
Solving 2 step equations. Two step equations have addition or subtraction and multiply or divide 3x + 1 = 10 3x + 1 = 10 4y + 2 = 10 4y + 2 = 10 2b +
Dr. Saatchi, Seyed Mohsen 1 Arab Open University - AOU T209 Information and Communication Technologies: People and Interactions Sixth Session.
Introduction to Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.
BY: KAYLEE J. KAMRYN P. CLOE B. EXPRESSIONS * EQUATIONS * FUNCTIONS * AND INEQUALITIES.
Chapter 3 Fractions.
CRYPTOGRAPHY G REEK WORD MEANING “ SECRET WRITING ”
Encryption with Keys and Passwords
3. 3 Solving Equations Using Addition or Subtraction 3
Copyright 2013, 2010, 2007, 2005, Pearson, Education, Inc.
Mathematics of Cryptography
Encryption.
Affine Cipher.
10.3 Solving Linear Systems
Comparative Relational Thinking
Stand Quietly.
Solving Two- Step Equations
Solving 2-Step Variable Equations
Computer and Data Security 4th Class
Solving Two- Step Equations
Warm up 11/1/ X ÷ 40.
Solving 1-Step Integer Equations
3-2: Solving Linear Systems
Solving 2-Step Variable Equations
Solving 2-Step Variable Equations
Solving Two- Step Equations
National Cipher Challenge
Solving 2-Step Variable Equations
Fundamentals of Data Representation
Solving Two- Step Equations
Solving 2-Step Variable Equations
Two Step Equation.
Solving one- and two-step equations
3-2: Solving Linear Systems
Solving Two- Step Equations
Section 10.3 Modular Arithmetic
Topic: Solving Two Step Equations
Two step equation Brackets
Traditional Symmetric-Key Ciphers
National Cipher Challenge
3 Chapter Chapter 2 Graphing.
Lesson 7.
3-2: Solving Linear Systems
Starter.
Solving 2-Step Variable Equations
Solving Linear Equations
Involving One Operation
3-2: Solving Linear Systems
Write an equation for this diagram
Section 9.3 Modular Arithmetic.
Presentation transcript:

National Cipher Challenge A beginner’s guide to codes and ciphers Part 4, breaking the affine shift cipher using modular inverses

Breaking a cipher is like solving an equation. A modern cipher has two components, an algorithm and a key. For the Caesar shift the algorithm is “rotate the alphabet” and the key is the amount of rotation, measured by where the letter A moves to.

We can think of the Caesar shift cipher as “adding” in mod 26 arithmetic.

So decrypting is just like solving the equation y = x + b by rewriting it as y – b = x Where: x is the number representing the plain-text letter y is the number representing the encrypted letter b is the amount of the shift

Now let’s think about the affine shift cipher.

That can be written as x  ax + b so decrypting is just like solving the equation y = ax + b.

The first step in the solution is easy: x = ax + b so y – b = ax so y – b = x a

You can’t divide like this in modular arithmetic! y – b = x a You can add, subtract and multiply, but you can’t divide.

Let’s try an example to see what we should do x  3x + 5 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 Remind the class that we encode A as 1, B as 2 etc, then apply the affine shift x -> 3x +5 so 1 -> 3+5=8, 2->6+5=11 and so on, then we recode using letters so A->H, B-> K and so on. Point out that once you know where A goes then B goes three steps further round the wheel. Use the cipher wheel handout with blank inner wheel to implement the ciphers x -> 3x + 5.

Let’s try an example to see what we should do x  3x + 5 A B C D E F G H I J K L M N Q  T  W Z C  O R P Q S U V W X Y

Time to use the whiteboard: The letter I maps to F which in numerical terms tells us that 3*9 + 5 is congruent to 6 mod 26. subtracting 5 tells us that 3*9 is congruent to 1 mod 26, which it clearly is so “dividing by 3” is the same as “multiplying by 9” and that is how we solve the equation

So dividing by 3 is illegal, but multiplying by 9 has the same effect and is fine! All we need to do to undo multiplication by a is to find a number d so that da is the same as 1 mod 26. We usually denote d as a-1

Here is a table for some of these magic inverses 1 2 3 4 5 6 7 8 9 10 11 12 13   21 15 19 14 16 17 18 20 22 23 24 25 26 If you want an activity for less able students this discussion of inverting mod 26 could be replaced by building cipher wheels to implement the encyption x->3x+b and the decryption x->9(x-b). Just fill in the blank inner wheels on a pair of cipher wheels with the letters C, F, I, (every third letter in turn until they are all used) and I, R, A (every ninth letter in turn) to get the wheels you need. You could discuss how technology enabled people to build better machines for enciphering and talk about the Enigma machine.

What about the gaps in this table What about the gaps in this table? What happens if we try to build a cipher wheel for the affine shift x  2x + 5 instead? As a class start to fill in the wheel with every other letter A, C, E, G, etc. Let them discover that half the letters appear twice and half don’t appear at all. Discuss why this makes the shift x -> 2x useless as part of a cipher.

What other affine shifts don’t work? Discuss the fact that if a is even then you will always get the same behaviour as if a is 2, and that 13 is even worse. Discover the fact that divisors of 26 are the problem. For a stronger group talk about common factors, the greatest common divisor and coprime numbers and explain that the transformations that can be used are x -> ax+b where a and 26 are coprime. For more discussion: bigger alphabets, maybe including punctuation or numerals, would require a bigger modulus, but the same ideas work.