Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Similar documents
Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Drill Time: Remainders from Long Division

MA 111, Topic 2: Cryptography

Cryptography Lecture 1: Remainders and Modular Arithmetic Spring 2014 Morgan Schreffler Office: POT 902

Classical Cryptography

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

Lecture 32. Handout or Document Camera or Class Exercise. Which of the following is equal to [53] [5] 1 in Z 7? (Do not use a calculator.

B. Substitution Ciphers, continued. 3. Polyalphabetic: Use multiple maps from the plaintext alphabet to the ciphertext alphabet.

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence.

DUBLIN CITY UNIVERSITY

The number theory behind cryptography

EE 418 Network Security and Cryptography Lecture #3

Data security (Cryptography) exercise book

Math 1111 Math Exam Study Guide

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

Solutions for the Practice Final

CPSC 467: Cryptography and Computer Security

Cryptography. Module in Autumn Term 2016 University of Birmingham. Lecturers: Mark D. Ryan and David Galindo

Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017

Cryptography, Number Theory, and RSA

Grade 7 & 8 Math Circles October 12, 2011 Modular Arithmetic

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 7 November, CS1800 Discrete Structures Midterm Version C

Cryptography CS 555. Topic 20: Other Public Key Encryption Schemes. CS555 Topic 20 1

UNIVERSITY OF MANITOBA DATE: December 7, FINAL EXAMINATION TITLE PAGE TIME: 3 hours EXAMINER: M. Davidson

Sheet 1: Introduction to prime numbers.

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

Distribution of Primes

Week 3: Block ciphers

Fermat s little theorem. RSA.

SOLUTIONS TO PROBLEM SET 5. Section 9.1

Practice Midterm 2 Solutions

Groups, Modular Arithmetic and Geometry

Math 1111 Math Exam Study Guide

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography

ElGamal Public-Key Encryption and Signature

EE 418: Network Security and Cryptography

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

Symmetric-key encryption scheme based on the strong generating sets of permutation groups

MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005

MA/CSSE 473 Day 9. The algorithm (modified) N 1

1 Introduction to Cryptology

Public-Key Cryptosystem Based on Composite Degree Residuosity Classes. Paillier Cryptosystem. Harmeet Singh

Classification of Ciphers

Public Key Cryptography

Solutions for the 2nd Practice Midterm

Dr. V.U.K.Sastry Professor (CSE Dept), Dean (R&D) SreeNidhi Institute of Science & Technology, SNIST Hyderabad, India. P = [ p

Block Ciphers Security of block ciphers. Symmetric Ciphers

Assignment 2. Due: Monday Oct. 15, :59pm

Modular Arithmetic. Kieran Cooney - February 18, 2016

Number Theory and Security in the Digital Age

Modular Arithmetic: refresher.

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm

#27: Number Theory, Part II: Modular Arithmetic and Cryptography May 1, 2009

6.2 Modular Arithmetic

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g.,

Introduction to Modular Arithmetic

TMA4155 Cryptography, Intro

MAT 302: ALGEBRAIC CRYPTOGRAPHY. Department of Mathematical and Computational Sciences University of Toronto, Mississauga.

Chapter 4 The Data Encryption Standard

Secure Function Evaluation

Modular Arithmetic and Doomsday

Application: Public Key Cryptography. Public Key Cryptography

Number Theory and Public Key Cryptography Kathryn Sommers

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

Network Security: Secret Key Cryptography

Math 255 Spring 2017 Solving x 2 a (mod n)

Towards a Cryptanalysis of Scrambled Spectral-Phase Encoded OCDMA

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

Math 319 Problem Set #7 Solution 18 April 2002

MAT199: Math Alive Cryptography Part 2

Discrete Square Root. Çetin Kaya Koç Winter / 11

Modular arithmetic Math 2320

Diffie-Hellman key-exchange protocol

Introduction to Cryptography CS 355

Math 412: Number Theory Lecture 6: congruence system and

Purple. Used by Japanese government. Not used for tactical military info. Used to send infamous 14-part message

Xor. Isomorphisms. CS70: Lecture 9. Outline. Is public key crypto possible? Cryptography... Public key crypography.

DUBLIN CITY UNIVERSITY

Cryptanalysis on short messages encrypted with M-138 cipher machine

Grade 7/8 Math Circles Winter March 24/25 Cryptography

Final exam. Question Points Score. Total: 150

Chapter 10 Error Detection and Correction 10.1

Algorithmic Number Theory and Cryptography (CS 303)

PROPERTIES OF MERSENNE NUMBERS AND PRIMES

Public-key Cryptography: Theory and Practice

The Chinese Remainder Theorem

Lecture 1: Introduction

Outcome 9 Review Foundations and Pre-Calculus 10

CRYPTANALYSIS OF THE PERMUTATION CIPHER OVER COMPOSITION MAPPINGS OF BLOCK CIPHER

University of British Columbia. Math 312, Midterm, 6th of June 2017

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively.

1.6 Congruence Modulo m

Chapter 10 Error Detection and Correction

The Chinese Remainder Theorem

Cryptography s Application in Numbers Station

Error Detection and Correction

#A3 INTEGERS 17 (2017) A NEW CONSTRAINT ON PERFECT CUBOIDS. Thomas A. Plick

Transcription:

Cryptography Codes Lecture 3: The Times Cipher, Factors, Zero Divisors, and Multiplicative Inverses Spring 2015 Morgan Schreffler Office: POT 902 http://www.ms.uky.edu/~mschreffler

New Cipher Times Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext A C B F C I How will the plaintext letter D be encrypted? How will the plaintext letter K be encrypted?

Encryption Method: Times Cipher Definition (Encryption: Times Cipher) A Times Cipher encrypts by multiplying each letter position. The conversion from English plaintext to ciphertext is represented by the formula (mod 26) =. The conversion from plaintext in a language with n letters to ciphertext is represented by the formula (mod n) =. The cipher from the previous slide is represented by 3 (mod 26) =.

Trouble with Times Cipher An enemy agent uses the Times cipher: (mod 26) =. For the times cipher 4 (mod 26) =, how is the letter I encrypted? For the times cipher 4 (mod 26) =, how is the letter V encrypted? What could be wrong with the cipher 4 (mod 26) =?

Related Idea: Zero-Divisors Recall the Times Cipher 4 (mod 26) = sent both I and V to N. This is because 4 (mod 26) is something called a zero divisor. Definition (Zero Divisor) A zero divisor modulo n is a number a 0 (mod n) where some other number b 0 (mod n) gives a b (mod n) = 0. (Zero-Divisor for n = 6) The values a = 2 (mod 6) and b = 3 (mod 6) are not equal to zero (mod 6). However, a b (mod n) = 2 3 (mod 6) = 6 (mod 6) = 0 (mod 6). Because a b (mod n) = 0, we can say that both a = 2 (mod 6) and b = 3 (mod 6) are zero-divisors.

Drill Time: Zero Divisors Answer these questions about zero-divisors, then check your answers with a neighbor! Does 3 multiply with 2 (mod 6) to make zero? Does 3 multiply with 12 (mod 18) to make zero? Is there a non-zero number to multiply 2 (mod 4) to make zero? Is there a non-zero number to multiply 3 (mod 4) to make zero? Is there a non-zero number to multiply 2 (mod 10) to make zero?

Drill Time: Zero Divisors Answer these questions about zero-divisors, then check your answers with a neighbor! Is 6 (mod 15) a zero-divisor? Is 10 (mod 15) a zero-divisor? Is 14 (mod 21) a zero-divisor? Is 9 (mod 33) a zero-divisor? Find a value n so that 4 (mod n) is a zero-divisor. Find a value n so that 11 (mod n) is a zero-divisor.

Times Cipher and Zero Divisors Why is 13 (mod 26) a zero divisor for an English language times cipher? Why is 8 (mod 26) a zero divisor for an English language times cipher? Do you think 7 (mod 26) is a zero divisor for an English-language Times Cipher? Why or why not?

Times Cipher and Zero Divisors Greek Alphabet Alien Alphabet! @ # $ % & Q Σ Ψ 1 2 3 4 5 6 7 8 9 10 11 Is 10 (mod 24) a zero divisor for a Greek language times cipher? Why or Why not? Is 3 (mod 11) a zero divisor for an Alien language times cipher? Why or why not?

Related Idea: Unit Definition (Unit) A nonzero value a < n which is not a zero divisor modulo n is called a unit modulo n. If a > n or a < 0, we say a is a unit modulo n if a (mod n) is a unit when simplified. (Identifying units mod n) The value 12 (mod 19) is a unit. This is because 12 (mod 19) is not a zero divisor. The value 23 (mod 20) is not yet reduced! Note that 23 = 3 (mod 20). Since 3 (mod 20) is not a zero-divisor, 3 (mod 20) must be a unit. This says that 23 (mod 20) is a unit too! The value 4 (mod 20) is not a unit, since 4 5 = 0 (mod 20), making 4 a zero divisor modulo 20.

Is Guess and Check the Only Way to Find Zero Divisors? When determining if 12 (mod 19) or 3 (mod 20) were zero divisors, we had to multiply by every nonzero number to see if we got zero. There must be a better way! Definition (Factor/Divisor) A factor (or divisor) of an integer n is any number a that has a partner b with a b = n. Put another way, a is a factor of n if n a is a whole number. Note Let n = 0 in the first definition above. Does it look familiar? That s where the name zero-divisor comes from! Since 3 8 = 24, the integer n = 24 has factors a = 3 and b = 8. Other factors for n = 24 are 1, 2, 4, 6, and 12. The integer n = 17 only has factors 1 and 17.

Related Idea: Zero-Divisor Unit Factor Connection Theorem Let a and n be integers. If a and n share a factor which isn t 1, then a is a zero-divisor modulo n. Otherwise, a is a unit modulo n. (Identifying zero-divisors and units mod n) The theorem above allows us to easily list out zero-divisors and units by using factors. Let s consider mod 12. Factors of 12 not equal to 1 are 22, 33, 44, 66, 1212, and the nonzero numbers mod 12 are 1, 2 2, 3 3, 4 4, 5, 6 6, 7, 8 8, 9 9, 10 10, 11. Even numbers have a factor of 2. Numbers 3 and 9 have a factor of 3. Factors 4, 6, and 12 don t pick off any extra numbers. The slashed numbers are the zero divisors modulo 12, and the untouched numbers are the units modulo 12.

English Times Cipher Recall our first Times Cipher example: 3 (mod 26) =. (A C, B F, C I,...) Is 3 (mod 26) a unit? Why or why not? What is 3 9 (mod 26)? Where does the modular equation 9 (mod 26) = send the letter C? Letter F? Letter I? As a pair, 3 (mod 26) and 9 (mod 26) have a special name in modular arithmetic...

Related Idea: Multiplicative Inverse Definition (Multiplicative Inverse) The unit a (mod n) has multiplicative inverse b (mod n) if a b = 1 (mod n). This also says the multiplicative inverse of b (mod n) is a (mod n). In (mod 10), the units are 1, 3, 7, 9. (Verify this!) Notice that 1 1 = 1 (mod 10), so 1 is the multiplicative inverse of 1 (This is true for all n.) 3 7 = 21 (mod 10) = 1 (mod 10), so 3 and 7 are multiplicative inverses modulo 10. 9 9 = 81 (mod 10) = 1 (mod 10), so 9 is the multiplicative inverse of itself modulo 10! Keep in mind! Only units have multiplicative inverses!

Drill Time: Multiplicative Inverse Answer these questions, then check your answers with a neighbor! Is 3 the multiplicative inverse to 2 (mod 5)? Is 3 the multiplicative inverse to 7 (mod 11)? Does 4 (mod 7) have a multiplicative inverse?

Finding Multiplicative Inverses, Method 1 Remember, only units have multiplicative inverses. This leads to our first method for finding multiplicative inverses. Theorem (Finding Multiplicative Inverses by Guess and Check) To find the multiplicative inverse of a unit a (mod n), do the following: (i) Make a list of ALL units b (mod n). This list will always start with 1 and end with n 1. (ii) For each value b (mod n) in the list above, calculate a b (mod n). If a b (mod n) = 1 then b is the multiplicative inverse of a. If a b (mod n) 1 then go to the next number in the list. For some values of n (like n = 12) there are very few units, so it is easy to quickly check all products a b (mod n).

of finding Multiplicative Inverses, Method 1 It is easy to check that the units modulo 26 are the odd values, excluding 13. You can easily use Method 1 above to find the multiplicative inverse of all units (mod 26): Unit Value 1 3 5 7 9 11 15 17 19 21 23 25 Mult. Inverse 1 9 21 15 3 19 7 23 11 5 17 25 Notice that multiplicative inverses come in pairs: 9 is the multiplicative inverse of 3 (mod 26) but this also says that 3 is the multiplicative inverse of 9 (mod 26)!

Drill Time: Multiplicative Inverse Answer these questions, then check your answers with a neighbor! What is the multiplicative inverse to 3 (mod 10)? What is the multiplicative inverse to 7 (mod 11)? What is the multiplicative inverse to 5 (mod 12)?

Finding Multiplicative Inverses, Method 2 Theorem To find the multiplicative inverse to a (mod n), make two lists: (i) Make multiples of the value n: {n, 2n, 3n, 4n,...} (ii) Add 1 to every member of the list from step (i): {n + 1, 2n + 1, 3n + 1, 4n + 1,...} Starting with n + 1, divide each number from Step (ii) by a. If the result is a whole number, that result is the multiplicative inverse for a. Otherwise, move to the next number on the list. Check Your Understanding Each number in the list from step (ii) is equal to (mod n)?

of finding Multiplicative Inverses, Method 2 The Ancient Roman Alphabet had only 23 letters. For this language we would use mod 23. Because there are so many units, it is much easier to find multiplicative inverses by Method 2. Let s find the multiplicative inverse of 7 (mod 23). We start by making our lists: (i) Make multiples of the value 23: {23, 46, 69, 92, 115, 138, 161, 184, 207, 230,...} (ii) Add 1 to every member of the list from step (i): {24, 47, 70, 93, 116, 139, 162, 185, 208, 231,...} Now divide each number in list (ii) by 7. On the third number we get 70 7 = 10. This says that 10 (mod 23) is the multiplicative inverse of 7 (mod 23). We can check that 7 10 (mod 23) = 1.

Decryption Method: Times Cipher Definition (Decryption: Times Cipher) A Times Cipher in a language with n letters (mod n) =. can be decrypted by finding a value (called snowflake) so that = 1 (mod n) Decryption can be described completely as (mod n) =. Note: and are multiplicative inverses! For an English Times Cipher (mod n) =, to decrypt we must find the multiplicative inverse of (mod 26). This number is, and the decryption equation is (mod 26) =.

Big Connection: Which General Times Ciphers Work? Theorem (Units and Times Cipher Decryption) The Times Cipher (mod n) = is only valid when is a unit modulo n. (Why?) Decryption of this Times Cipher is given by =, where is the multiplicative inverse to. (A Language with 18 Characters) The values that can be in a language with 18 characters are... 1, 5, 7, 11, 13, 17 A Curious Fact In any language with more than 2 characters, there are always an even number of valid values of!

Times Ciphers in Different Languages Greek Alphabet Alien Alphabet! @ # $ % & Q Σ Ψ 1 2 3 4 5 6 7 8 9 10 11 Does = 5 give a valid times cipher for the English alphabet? If so, what is the decryption key? Does = 4 give a valid times cipher for the Greek alphabet? If so, what is the decryption key? Does = 8 give a valid times cipher for the Alien alphabet? If so, what is the decryption key?