MODULAR ARITHMETIC. Suppose I told you it was 10:00 a.m. What time is it 6 hours from now?

Similar documents
17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.

Cryptography. P. Danziger. Transmit...Bob...

The Vigenère cipher is a stronger version of the Caesar cipher The encryption key is a word/sentence/random text ( and )

( c ) E p s t e i n, C a r t e r a n d B o l l i n g e r C h a p t e r 1 7 : I n f o r m a t i o n S c i e n c e P a g e 1

Public Key Cryptography

Powers in Modular Arithmetic, and RSA Public Key Cryptography

Clock Arithmetic and Euclid s Algorithm

Cryptography and Number Theory

Week 7 An Application to Cryptography

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

secretsaremadetobefoundoutwithtime UGETGVUCTGOCFGVQDGHQWPFQWVYKVJVKOG Breaking the Code

Chapter 2 Classical Cryptosystems

Fall 2017 September 20, Written Homework 02

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

Homework 4 for Modular Arithmetic: The RSA Cipher

Introduction. What is RSA. A Guide To RSA by Robert Yates. Topics

10 Modular Arithmetic and Cryptography

5. Classical Cryptographic Techniques from modular arithmetic perspective

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

For your quiz in recitation this week, refer to these exercise generators:

An Introduction to Cryptography

COMM1003. Information Theory. Dr. Wassim Alexan Spring Lecture 5

CSCI3381-Cryptography

MODULAR ARITHMETIC KEITH CONRAD

Implementation Tutorial on RSA

MONOALPHABETIC CIPHERS AND THEIR MATHEMATICS. CIS 400/628 Spring 2005 Introduction to Cryptography

The Hill Cipher A Linear Algebra Perspective

Number Theory in Cryptography

Notes 10: Public-key cryptography

The RSA public encryption scheme: How I learned to stop worrying and love buying stuff online

Using Matrices for Cryptography

Candidates must show on each answer book the type of calculator used. Only calculators permitted under UEA Regulations may be used.

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Math Circles Cryptography

Sol: First, calculate the number of integers which are relative prime with = (1 1 7 ) (1 1 3 ) = = 2268

Mathematics: Modeling Our World Unit 2: SECRET CODES SUPPLEMENTAL ACTIVITY THE GOLD BUG S2.1

Number theory (Chapter 4)

Math 412: Number Theory Lecture 13 Applications of

My brief introduction to cryptography

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

Introduction to Cryptology Dr. Sugata Gangopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Roorkee

Modular Arithmetic Instructor: Marizza Bailey Name:

Univ.-Prof. Dr. rer. nat. Rudolf Mathar. Written Examination. Cryptography. Tuesday, August 29, 2017, 01:30 p.m.

CHAPTER 12 CRYPTOGRAPHY OF A GRAY LEVEL IMAGE USING A MODIFIED HILL CIPHER

CRYPTOGRAPHY AND LARGE PRIMES *

Cristina Nita-Rotaru. CS355: Cryptography. Lecture 4: Enigma.

CPSC 467b: Cryptography and Computer Security

You separate binary numbers into columns in a similar fashion. 2 5 = 32

6.080/6.089 GITCS April 8, Lecture 15

Math 1350 (FALL 2008) Prelim 1 (10/6/2008) 1. Solution. For the Atbash cipher for the Roman alphabet we have

A Birthday is No Ordinary Day PP STEM K-2

NHMZK LWOGM PLMXG OBMLE LLOXA RURRJ MIZKL OGYHM KL

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks

Simple Math: Cryptography

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Great Theoretical Ideas in Computer Science

1 Modular Arithmetic Grade Level/Prerequisites: Time: Materials: Preparation: Objectives: Navajo Nation Math Circle Connection

Math 299 Supplement: Modular Arithmetic Nov 8, 2013

Lecture 6: Introducing Complexity

Numbers and symbols WHOLE NUMBERS: 1, 2, 3, 4, 5, 6, 7, 8, 9... INTEGERS: -4, -3, -2, -1, 0, 1, 2, 3, 4...

MATH 135 Algebra, Solutions to Assignment 10

19 Lorenz Cipher Machine

1/16 2/17 3/17 4/7 5/10 6/14 7/19 % Please do not write in the spaces above.

Cryptography. pieces from work by Gordon Royle

Constrained and Unconstrained Optimization Prof. Adrijit Goswami Department of Mathematics Indian Institute of Technology, Kharagpur

Jay Daigle Occidental College Math 401: Cryptology

NUMBER THEORY AND CRYPTOGRAPHY

A Taste of Pi: Clocks, Set, and the Secret Math of Spies

Simple Codes MTH 440

Note: This essay is extracted from a Lesson from the forthcoming textbook Mathematics: Building on Foundations.

History of Maths andx

Grade 7 and 8 Math Circles March 19th/20th/21st. Crytography

University of Regina Department of Mathematics & Statistics Final Examination (April 21, 2009)

Classical Cryptography

Algebra 1B notes and problems March 12, 2009 Factoring page 1

Clock Arithmetic. 1. If it is 9 o clock and you get out of school in 4 hours, when do you get out of school?

CLASSICAL ENCRYPTION. Mihir Bellare UCSD 1

Quantum Entanglement and Cryptography. Deepthi Gopal, Caltech

ECE 646 Lecture 5. Motivation: Mathematical Background: Modular Arithmetic. Public-key ciphers. RSA keys. RSA as a trap-door one-way function

Introduction to Cryptography for the Mathematically Challenged

Introduction to Cryptography

Introduction to Cryptography

Daily Start Monday TT 2015.notebook. November 30, 2015

Encryption: The RSA Public Key Cipher

What is Cryptography? by Amit Konar, Dept. of Math and CS, UMSL

Zero. Grade Level: 1-3

COMP6053 lecture: Sampling and the central limit theorem. Jason Noble,

Algebra: Linear UNIT 16 Equations Lesson Plan 1

and its Extension to Authenticity

International Journal of Pure and Applied Mathematics Volume 5 No , A PUBLIC-KEY CRYPTOSYSTEM BASED ON DIOPHANTINE EQUATIONS

Innovation and Cryptoventures. Cryptology. Campbell R. Harvey. Duke University, NBER and Investment Strategy Advisor, Man Group, plc.

What is proof? Lesson 1

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Lecture (04) Classical Encryption Techniques (III)

one approach to improve security was to encrypt multiple letters invented by Charles Wheatstone in 1854, but named after his

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

Chapter Three. Deciphering the Code. Understanding Notation

THE RSA CRYPTOSYSTEM

Mathematical Foundations of Cryptography

Security of Networks (12) Exercises

Transcription:

MODULAR ARITHMETIC. Suppose I told you it was 10:00 a.m. What time is it 6 hours from now? The time you use everyday is a cycle of 12 hours, divided up into a cycle of 60 minutes. For every time you pass 12, you start over with 1 again. This is "mod 12" arithmetic. Let's set up a picture. You put 0 through 11 in a circle. Then to figure out what the answer to a modular math question, you begin at 0 and count around the clock a certain amount of times. The number you end up on is the answer. Example: We want to calculate 32 (mod 12). We start at 0 and go all the way back to 0. This uses up 12 of the hours. We have 32-12 =20 left. We go around again. We have 20-12 = 8 left. Therefore 32 (mod 12) is equal to 8 or 32 8 (mod 12) What is 27 (mod 12)? What is 38 (mod 12)? What is -7 (mod 12)? What about 155 mod 12? QUESTION: Why do you think we label the clock 0 through 11, instead of 1-12? Okay, now try 155 mod 12 again.

Classwork: 1. It would be mod if we did minutes instead of hours. 2. Where would the minute hand be 342 minutes from 10:00? 3. What time would it be (including the hour) for problem 2? 4. If it is 10:50 now, what time will it be in 268 minutes? 5. What month would it be 43 months from now? 6. If it is 1:00 right now, what time was it 76 hours ago? 7. Today is March 17, 2005, which is also known as St. Patrick s Day. Which day of the week will St. Patrick s Day fall on NEXT YEAR? 8. Try to figure out which day of the week you were born on? Remember that there are 365 days in most years and 366 days in leap years (.,1992, 1996, 2000, 2004,.).

CRYPTOGRAPHY We hope you understood the modular arithmetic lesson. This kind of mathematics is used in defending the United States and other countries during wars and other times when there is information that has to be kept confidential. It was used during the Civil War in the 1860's and even thousands of years ago during Caesar's Roman Empire. People who wanted to communicate with allies but not their enemies would send encrypted messages back and forth. An encrypted message takes the letters and numbers of a message and transforms them into a different series of letters and numbers that do not make sense unless you know the code to unscramble them. If you know the code, then you can read the message. Amazingly complex scrambling procedures can stump highly trained people and even computers. We will talk about simple ciphers. A cipher is the method by which you encrypt a message. Before we begin, we must first create a numerical alphabet by assigning numbers, beginning with zero, to each letter of the 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 Most ciphers use modular arithmetic during some steps of the encryption and decryption process. We have used the numbers 0 through 25 to represent English letters, so we will use mod 26 in all our cipher examples.

SHIFT CIPHER We will encipher the message BRIAN IS A SPY using a shift cipher of 7, or a shift key of 7. Step 1: We translate our message into our numerical alphabet. B R I A N I S A S P Y Step 2: We now shift our cipher by adding our shift value (7) to each of the numbers from our codewords. B: I: S: R: S: P: I: Y: A: A: N: Step 3: We now translate the numbers back into our letters using our numerical alphabet. So BRIAN IS A SPY becomes To make life harder for spies, most encrypters remove punctuation and group the letters in "words" that are usually five letters long. Therefore BRIAN IS A SPY, with a shift key of 7, is really written: Another Example: Encipher the message Shamrock Shake using a shift key of 20. DECIPHERING AN ENCODED MESSAGE. Suppose you know the shift key is 10. Decrypt the following message. (What would you need to do to each letter to get your original letter back?) MBIZD YQBKZ RI

Using Frequency of Letters to help us out, if we are using a shift cipher Table 1: Frequency of occurrence of the 26 Letters in a random sample of 100 characters Letter Frequency Letter Frequency A 8.167 N 6.749 B 1.492 O 7.507 C 2.782 P 1.929 D 4.253 Q 0.095 E 12.702 R 5.987 F 2.228 S 6.327 G 2.015 T 9.056 H 6.094 U 2.758 I 6.966 V 0.978 J 0.153 W 2.360 K 0.772 X 1.974 L 4.025 Y 0.074 M 2.406 Z 0.074 Suppose we have the following ciphertext, which has been enciphered using the shift cipher: DPYOT YCPTY QZCNP XPYED TXXPO TLEPW J 1. What is the most frequent letter used in this ciphertext? 2. If is e, then our key is. If is e, then our key is 3. Decode the message using the cheat sheet handout for each of the possible keys.

0 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 1 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 A 2 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B P 3 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C l 4 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D a 5 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E i 6 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F n 7 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G t 8 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H e 9 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I x 10 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J t 11 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K 12 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L 13 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M 14 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N 15 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O 16 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P 17 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q 18 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R 19 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S 20 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T 21 V W X Y Z A B C D E F G H I J K L M N O P Q R S T U 22 W X Y Z A B C D E F G H I J K L M N O P Q R S T U V 23 X Y Z A B C D E F G H I J K L M N O P Q R S T U V W 24 Y Z A B C D E F G H I J K L M N O P Q R S T U V W X 25 Z 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

MULTIPLICATION CIPHER This is similar to the shift cipher, except that you multiply and divide instead of add and subtract. We'll start with a simple example. Let's work with the word SIMPLE SIMPLE in the numeric alphabet is 1) We will use the "multiplier" 7. Multiply the numeric alphabet numbers each by the "multiplier" and do (mod 26). S becomes I becomes M becomes P becomes L becomes E becomes 2) Use the multiplier 10 and encrypt the word FANS. (F =5, A = 0, N = 13, S = 18) 3) Does this seem right to you? Why do you think this happened? 4) Which multipliers will be okay when doing (mod 26)? Decrypting a multiplier cipher How do we decrypt a message using the multiplication cipher? We already know that SIMPLE encrypted with multiplier 7 is WEGBZC. How do we get back to SIMPLE from WEGBZC? Before we answer this question, let s first go back to something we already know how to do. If we wanted to solve 7x=33, we multiply 7 by its multiplicative inverse 1/7. This gives us 1 on the left hand side. Decipher WEGBZC: we need to multiply each number by the inverse of 7 in modular arithmetic. The inverse of 7 (mod 26) is a number N so that 7*N is equal to 1 (mod 26). 5) What is the inverse of 7 (mod 26)? 6) Now multiply each letter in WEGBZC by your answer to get back to SIMPLE