Modular Arithmetic with Applications to Cryptography

Slides:



Advertisements
Similar presentations
Partial Orderings Section 8.6.
Advertisements

Equivalence Relations
Equivalence Relations
Relations Relations on a Set. Properties of Relations.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Number Theory and Cryptography
Congruence class arithmetic. Definitions: a ≡ b mod m iff a mod m = b mod m. a  [b] iff a ≡ b mod m.
Discrete Mathematics Lecture#11.
1 Partial Orderings Based on Slides by Chuck Allison from Rosen, Chapter 8.6 Modified by.
Partially Ordered Sets (POSets)
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
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
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
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.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Discrete Structures – CNS2300
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
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.
2.6 Equivalence Relation §1.Equivalence relation §Definition 2.18: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric,
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
Relations and their Properties
Elements of Coding and Encryption 1. Encryption In the modern word, it is crucial that the information is transmitted safely. For example, Internet purchases,
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
1 Partial Orderings Based on Slides by Chuck Allison from Rosen, Chapter 8.6 Modified by.
Partial Order Relations Lecture 50 Section 10.5 Wed, Apr 20, 2005.
1 Partial Orderings Epp, section Introduction An equivalence relation is a relation that is reflexive, symmetric, and transitive A partial ordering.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
The Relation Induced by a Partition
Direct Proof and Counterexample IV: Division into Cases and the Quotient-Remainder Theorem For each of the following values of n and d, find integers q.
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
Relations and Functions
Unit-III Algebraic Structures
CSE15 Discrete Mathematics 05/03/17
Equivalence Relations
Relations Chapter 9.
Direct Proof and Counterexample III: Divisibility
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Congruence class arithmetic
Prelude to Public-Key Cryptography
Advanced Algorithms Analysis and Design
Reflexivity, Symmetry, and Transitivity
Aaron Bloomfield CS 202 Epp, section ???
Copyright © Cengage Learning. All rights reserved.
Partial Order Relations
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 9 Relations Slides are adopted from.
Direct Proof and Counterexample V: Floor and Ceiling
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Zeph Grunschlag,
Equivalence Relations
Equivalence Relations
Copyright © Cengage Learning. All rights reserved.
교환 학생 프로그램 내년 1월 중순부터 6월 초 현재 학부 2,3 학년?
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

Modular Arithmetic with Applications to Cryptography Cryptography is the study of methods for sending secret messages. It involves encryption, in which a message, called plaintext, is converted into a form, called ciphertext, that may be sent over channels possibly open to view by outside parties. The receiver of the ciphertext uses decryption to convert the ciphertext back into plaintext. In the past the primary use of cryptography was for government and military intelligence, and this use continues to be important.

Modular Arithmetic with Applications to Cryptography For instance, an encryption system once used by Julius Caesar, and now called the Caesar cipher, encrypts messages by changing each letter of the alphabet to the one three places farther along, with X wrapping around to A, Y to B, and Z to C. In other words, say each letter of the alphabet is coded by its position relative to the others—so that A = 01, B = 02, . . . , Z = 26. If the numerical version of the plaintext for a letter is denoted M and the numeric version of the ciphertext is denoted C, then

Modular Arithmetic with Applications to Cryptography The receiver of such a message can easily decrypt it by using the formula For reference, here are the letters of the alphabet, together with their numeric equivalents:

Example 1 – Encrypting and Decrypting with the Caesar Cipher To encrypt the message “HOW ARE YOU” … Translate the letters into their numeric equivalents: 08 15 23 01 18 05 25 15 21. Add 3 to each number. The result is 11 18 26 04 21 08 02 18 24. Substitute the letters that correspond to these numbers. The encrypted message becomes KRZ DUH BRX.

Example 1 – Encrypting and Decrypting with the Caesar Cipher To decrypt the message “L DP ILQH” … Translate the letters into their numeric equivalents: 12 04 16 09 12 17 08. Subtract 3 from each number. The result is 09 01 13 06 09 14 05. Then translate back into letters to obtain the original message: I AM FINE.

Properties of Congruence Modulo n

Properties of Congruence Modulo n Given integers a and n with n > 1: The residue of a modulo n is a mod n, the non-negative remainder when a is divided by n. The numbers 0, 1, …, n – 1 are the complete set of residues mod n. To reduce a modulo n means to set a to be a mod n.

Modular Arithmetic Theorem: Let a, b, c, d and n be integers with n > 1, and suppose a  c (mod n) and b  d (mod n). Then, a + b  c + d (mod n) a – b  c – d (mod n) ab  cd (mod n) am  cm (mod n) for all integers m

Modular Arithmetic

Antisymmetry We have defined three properties of relations: reflexivity, symmetry, and transitivity. A fourth property of relations is called antisymmetry. In terms of the arrow diagram of a relation, saying that a relation is antisymmetric is the same as saying that whenever there is an arrow going from one element to another distinct element, there is not an arrow going back from the second to the first.

Antisymmetry By taking the negation of the definition, you can see that a relation R is not antisymmetric if, and only if, there are elements a and b in A such that a R b and b R a but a  b.

Example 2 – Testing for Antisymmetry of “Divides” Relations Let R1 be the “divides” relation on the set of all positive integers, and let R2 be the “divides” relation on the set of all integers. a. Is R1 antisymmetric? Prove or give a counterexample. b. Is R2 antisymmetric? Prove or give a counterexample.

Example 2 – Solution a. R1 is antisymmetric. Proof: Suppose a and b are positive integers such that a R1 b and b R1 a. [We must show that a = b.] By definition of R1, a | b and b | a. Thus, by definition of divides, there are integers k1 and k2 with b = k1a and a = k2b. It follows that Dividing both sides by b gives

Example 2 – Solution cont’d Now since a and b are both integers k1 and k2 are both positive integers also. But the only product of two positive integers that equals 1 is 1  1. Thus and so [This is what was to be shown.]

Example 2 – Solution b. R2 is not antisymmetric. Counterexample: cont’d b. R2 is not antisymmetric. Counterexample: Let a = 2 and b = –2. Then a | b [since –2 = (–1)  2] and b | a [since 2 = (–1)(–2)]. Hence a R2 b and b R2 a but a  b.

Partial Order Relations A relation that is reflexive, antisymmetric, and transitive is called a partial order. Two fundamental partial order relations are the “less than or equal to” relation on a set of real numbers and the “subset” relation on a set of sets. These can be thought of as models, or paradigms, for general partial order relations.

Example 4 – A “Divides” Relation on a Set of Positive Integers Let | be the “divides” relation on a set A of positive integers. That is, for all a, b  A, Prove that | is a partial order relation on A. Solution: | is reflexive: [We must show that for all a  A, a | a.] Suppose a  A. Then a = 1  a, so a | a by definition of divisibility.

Example 4 – Solution cont’d | is antisymmetric: [We must show that for all a, b  A, if a | b and b | a then a = b.] The proof of this is virtually identical to that of Example 2(a). | is transitive: To show transitivity means to show that for all a, b, c  A, if a | b and b | c then a | c. But this was proved as Theorem 4.3.3. Since | is reflexive, antisymmetric, and transitive, | is a partial order relation on A.

Partial Order Relations

Partially and Totally Ordered Sets Given any two real numbers x and y, either x  y or y  x. In a situation like this, the elements x and y are said to be comparable. On the other hand, given two subsets A and B of {a, b, c}, it may be the case that neither A  B nor B  A. For instance, let A = {a, b} and B = {b, c}. Then and In such a case, A and B are said to be noncomparable.

Partially and Totally Ordered Sets When all the elements of a partial order relation are comparable, the relation is called a total order.

Partially and Totally Ordered Sets A set that is partially ordered but not totally ordered may have totally ordered subsets. Such subsets are called chains. Observe that if B is a chain in A, then B is a totally ordered set with respect to the “restriction” of to B.

Example 9 – A Chain of Subsets The set is partially ordered with respect to the subset relation. Find a chain of length 3 in Solution: Since the set is a chain of length 3 in

Partially and Totally Ordered Sets A maximal element in a partially ordered set is an element that is greater than or equal to every element to which it is comparable. (There may be many elements to which it is not comparable.) A greatest element in a partially ordered set is an element that is greater than or equal to every element in the set (so it is comparable to every element in the set). Minimal and least elements are defined similarly.

Partially and Totally Ordered Sets

Partially and Totally Ordered Sets A greatest element is maximal, but a maximal element need not be a greatest element. However, every finite subset of a totally ordered set has both a least element and a greatest element. Similarly, a least element is minimal, but a minimal element need not be a least element. Furthermore, a set that is partially ordered with respect to a relation can have at most one greatest element and one least element, but it may have more than one maximal or minimal element.

Topological Sorting Is it possible to input the sets of into a computer in a way that is compatible with the subset relation  in the sense that if set U is a subset of set V, then U is input before V? The answer, as it turns out, is yes. For instance, the following input order satisfies the given condition: Another input order that satisfies the condition is

Topological Sorting Given an arbitrary partial order relation on a set A, is there a total order on A that is compatible with ? If the set on which the partial order is defined is finite, then the answer is yes. A total order that is compatible with a given order is called a topological sorting.