Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.

Slides:



Advertisements
Similar presentations
Fubswrjudskb Frxuvh qxpehu: / Lqvwuxfwru:Lyrqd Ehcdnryd Wrgdb’v Wrslfv: 1.Orjlvwlfv: -Fodvv olvw -Vboodexv 2. Wkh Pdwk 3. Zkdw lv Fubswrjudskb.
Advertisements

Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
Thinking Mathematically
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
22C:19 Discrete Structures Integers and Modular Arithmetic
Chapter Primes and Greatest Common Divisors ‒Primes ‒Greatest common divisors and least common multiples 1.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
ENGG2013 Unit 11 Row-Rank Feb,
Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer.
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Inverses and GCDs Supplementary Notes Prepared by Raymond Wong
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Section 2.9 The Hill Cipher; Matrices
Introduction to Cryptography
CSE 311 Foundations of Computing I Lecture 12 Primes, GCD, Modular Inverse Spring
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
BY MISS FARAH ADIBAH ADNAN IMK
The Integers and Division
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Integers Number Theory = Properties of Integers
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
CSE 504 Discrete Mathematics & Foundations of Computer Science
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
MATH 224 – Discrete Mathematics
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
CPSC 3730 Cryptography and Network Security
Computer System Security CSE 5339/7339
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
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.
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.
1 Introduction to Abstract Mathematics Chapter 3: Elementary Number Theory and Methods of Proofs Instructor: Hayk Melikya Direct.
Introduction to Cryptography
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
CompSci 102 Discrete Math for Computer Science
Section 4.4: The RSA Cryptosystem Practice HW Handwritten and Maple Exercises p at end of class notes.
RSA Prepared by: SITI ZAINAH ADNAN
Some Number Theory Modulo Operation: Question: What is 12 mod 9?
CSCI 391: Practical Cryptology Substitution Monoalphabetic Ciphers.
Chinese Remainder Theorem Dec 29 Picture from ………………………
Number Theory 이재원 School of Information Technology Sungshin W. University.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
Discrete Mathematics
AF2. Turn off your phones Primes, gcd, some examples, reading.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
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.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Modular Arithmetic with Applications to Cryptography
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Numerical Algorithms x x-1
Classical Ciphers – 2 CSCI284 Spring 2004 GWU
Number Theory.
Presentation transcript:

Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For affine ciphers we use both a multiplicative and an additive parameter…

Affine Ciphers; More Modular Arithmetic Mathematics Background for Affine Ciphers –A natural number is a number in the set {1, 2, 3, …}. –Any natural number can always be written as the product of two other natural numbers. Ex: 6 = 2*320 = 4*57 = 1*7 –Definition: A natural number p is said to be prime if p > 1 and its only divisors are 1 and p. A natural number that is not prime is said to be composite. –Question: Are there an infinite number of primes? Yes. This can be proven but is not the focus of this course. The idea though is to assume not and show that this leads to a contradiction. –The primes are: {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, …} where I have listed the first ten. –Theorem: The Fundamental Theorem of Arithmetic. Every natural number larger then 1 is a product of primes. This factorization can be done in only one way if the order is disregarded. –Example 1: Factor 90 Answer 2*3 2 *5 –Example 2: Factor 935 Answer: 5 * 11 * 17…

Affine Ciphers; More Modular Arithmetic The common prime factors of two numbers can be used to find the greatest common divisor of two numbers (gcd). Definition: The gcd of two natural numbers a and b, denoted gcd(a, b), is the largest natural number that divides both a and b with no remainder. Elementary method for computing the gcd of two numbers: –Decompose the two numbers into prime factorization. –The common factors make up the gcd. –If there are no common factors then the gcd = 1. (The two numbers are said to be relatively prime) Example 3: Find the gcd(20, 30). –Answer: 10 Example 4: Find the gcd(1190, 935). –Answer: 85 Example 5: Find the gcd(15, 26). –Answer: 1…

Affine Ciphers; More Modular Arithmetic Multiplicative Inverses: For a number x in some set S, the multiplicative inverse of x is a number y, also in S, such that xy = 1. –In the real numbers, every nonzero number has a multiplicative inverse. –Consider the set Z (the integers). Only 1 and -1 have multiplicative inverses. –In Z m a number x has a multiplicative inverse if there is a number y such that xy mod m = 1. –Consider the set Z 6. The numbers 1, 5 have inverses. The inverse of 1 is itself. The inverse of 5 is itself. –Fact: If the gcd(b, m) = 1, then b has a multiplicative inverse. the inverse of b is denoted by b -1. –Example 6: In the set R, find the inverses of 2, 10, a. Answer: ½, 1/10,1 / a –Example 8: Does 8 have an inverse modulo 26? Answer: No. gcd(8, 26) = 2. –Example 9: Does 9 have an inverse modulo 26? Answer: yes. gcd(9, 26) = 1. –Table of multiplicative inverses modulo 26Table of multiplicative inverses Example 10: Use the table to find 7 -1 MOD 26.table –Answer: 15…

Affine Ciphers; More Modular Arithmetic Multiplicative Property for Modular Arithmetic: If a ≡ b mod m, then for any number k, ka ≡ kb mod m. –Example 11: Solve 11x – 1 = 5 mod 26 (Note: the inverse of 11 is not 1 / 11. From our table we see that is 19.table Answer x = 114 MOD 26 = 10 MOD 26 = 10 –Example 12: Solve (Note: -9 ≡ 17 mod 26) 8a + b = 18 mod 26 17a + b = 11 mod 26 (subtract the second equation from the first) –Answer: a = 5, b = 4 (Note that a = 31 and b = 30 are also answers, etc.)…

Affine Ciphers; More Modular Arithmetic Mathematical Description of Affine Ciphers –Given a and b in Z 26 where gcd(a, 26) = 1. We encipher a plaintext letter x to obtain a ciphertext letter y, by computing y = (ax + b) MOD 26. Example 13: Encipher “RADFORD” using the affine cipher y = (5x + 4) MOD 26Example 13 –Answer: LETDWLE –The following example illustrates the need for a and b to be relatively prime. Example 14: Encipher “AN” using the affine cipher y = (2x + 1) mod 26…Example 14

Affine Ciphers; More Modular Arithmetic Deciphering an Affine Cipher –For an affine cipher y = (ax + b) mod 26 where gcd(a, 26) = 1, the decipherment is unique. The formula for the decipherment is: y = ax + b y – b = ax a -1 (y – b) = x x = a -1 (y – b) mod 26 –Example 15: Decipher the message “ARMMVKARER” which was encrypted using the affine cipher: y = (3x + 5) MOD 26…Example 15

Affine Ciphers; More Modular Arithmetic Cryptanalysis of Affine Ciphers –For an affine cipher to be deciphered the enemy must know a and b. –There are two methods to decipher an affine cipher: Brute force or Exhaustion method (Try all possible values for a and b). Since there are 12 values for a and 26 values for b, then there are 12 * 26 = 312 total (a, b) pair tests. Frequency analysis: Uses the fact that the most frequently occurring letters in ciphertext produced by shift cipher has a good chance of corresponding to the most frequently occurring letters in the standard English alphabet. The most frequently occurring letters in English are E, T, A, O, I, N, S. –Example 16: Frequency Analysis. Suppose that the two most frequently occurring letters in a ciphertext message are W and H. Assuming that these correspond to E and T, find a and b…Frequency Analysis

Affine Ciphers; More Modular Arithmetic Additional Exercises: Factor the following into a product of prime numbers: 120, 715, Find the following gcd: gcd(30, 40), gcd(150, 500), gcd(187, 455)…!