Mathematics of Cryptography

Slides:



Advertisements
Similar presentations
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
Advertisements

Cryptography and Network Security
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.
1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
More about Polynomials
Congruence class arithmetic. Definitions: a ≡ b mod m iff a mod m = b mod m. a  [b] iff a ≡ b mod m.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
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,
Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
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.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
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
February 24, 2015Applied Discrete Mathematics Week 4: Number Theory 1 Modular Arithmetic Let a be an integer and m be a positive integer. We denote by.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Mathematics of Cryptography Modular Arithmetic, Congruence,
CPSC 3730 Cryptography and Network Security
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Chapter 4 – Finite Fields
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
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.
Tuesday’s lecture: Today’s lecture: One-way permutations (OWPs)
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Discrete Mathematics
Lecture 2-3 Basic Number Theory and Algebra. In modern cryptographic systems, the messages are represented by numerical values prior to being encrypted.
Cryptography Lecture 14 Arpita Patra © Arpita Patra.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: 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.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
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.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
Number-Theoretic Algorithms
The Relation Induced by a Partition
Lecture 4 The Euclidean Algorithm
B504/I538: Introduction to Cryptography
Advanced Algorithms Analysis and Design
Congruence class arithmetic
Advanced Algorithms Analysis and Design
Integers and Division Section 3.4.
CMSC Discrete Structures
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Number Theory and Modular Arithmetic
Applied Discrete Mathematics Week 3: Algorithms
Applied Discrete Mathematics Week 4: Number Theory
Number Theory (Chapter 7)
Foundations of Discrete Mathematics
Prime and Relatively Prime Numbers
Lecture 20 Guest lecturer: Neal Gupta
Enough Mathematical Appetizers!
Week #5 – 23/25/27 September 2002 Prof. Marie desJardins
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
Copyright © Zeph Grunschlag,
Modular Inverses Recall the simple encryption function
Applied Discrete Mathematics Week 10: Introduction to Counting
Cryptography Lecture 16.
Discrete Mathematics Chapter 4 Number Theory. Discrete Mathematics Chapter 4 Number Theory.
Number Theory: Prime & Composite Numbers
Section 9.3 Modular Arithmetic.
Presentation transcript:

Mathematics of Cryptography

Topics Integer Arithmetic Modular Arithmetic Matrices Linear Congruence

Integer Arithmetic Set of Integers Binary Operations Denoted by Z, contains all integral natural numbers (with no fraction) from negative infinity to positive infinity. Binary Operations Takes two inputs and gives one output. We will be using, addition, subtraction and multiplication Z= {………,-4-3,-2,-1,0,1,2,3,4………}

Z= {………,-4-3,-2,-1,0,1,2,3,4………} + - x a c b

Integer Division a=q x n +r Z= {………,-4,-3,-2,-1,0,1,2,3,4………} a If we divide ‘a’ by ‘n’ then we end up with ‘q’ and ‘r’ such that a = q x n + r, where ‘a’ - dividend, ‘q’ - quotient, ‘r’ - remainder and ‘n’ - divisor. Two restrictions are imposed: ‘n’ should be positive integer and ‘r’ should be non-negative integer. Z= {………,-4,-3,-2,-1,0,1,2,3,4………} a=q x n +r n (positive) q a r (non-negative)

The Graph of the relation Consider 2 cases wherein a is positive and a is negative.

a = q x n (a is divisible by n or n divides a) Divisibility If ‘a’ is non zero and if we get r = 0, then we have the relation, a = q x n (a is divisible by n or n divides a) When we are not interested in the value of ‘q’, then we denote as a | n When a is not divisible by n then we indicate this using this notation a + n Properties If a | 1, then a= ± 1 If a | b and b | a, then a= ± b If a | b and b | c, then a | c If a | b and a | c, then a | (m x b + n x c), where m and c are arbitrary integers

All divisors A positive integer can have more than one divisor. Fact 1: The integer 1 has only one divisor, itself Fact 2: Any positive integer has at least two divisors, 1 and itself.

Greatest Common Divisor (GCD) GCD is the often required integer in Cryptography GCD – of two positive integers is the largest integer that can divide both the integers. For the above mentioned example: GCD (140,12) = 4

gcd(36,10)= gcd(10,6)= gcd(6,4)= gcd(4,2)= gcd(2,0)=2 Euclidean Algorithm Finding GCD of numbers by listing all the common divisors is not feasible especially when the numbers are large. 2000 years ago, Euclid developed an algorithm to find the GCD of two positive numbers. Fact 1: gcd (a,0) = a Fact 2: gcd (a,b) = gcd (b,r), where r is the remainder of dividing a by b. Example: gcd(36,10)= gcd(10,6)= gcd(6,4)= gcd(4,2)= gcd(2,0)=2 If gcd (a,b) = 1, then a and b are relatively prime

The Extended Euclidean Algorithm Given two integers a and b, we need to find other two integers s and t, such that s x a + t x b = gcd(a,b). Procedure is same as Euclidean algorithm, but we will consider two more set of operations for s and t. Initialization: s1=1, s2=0, t1=0 and t2=1 r = r1 – q x r2, s = s1 - q x s2, and t = t1 – q x t2 , where q = r1/r2

x = x0+k(b/d) and y = y0+k(a/d), where k is an integer Linear Diophantine Equations Equations of type ax+by=c are called as linear Diophantine equations We need to find x and y. These kind of equations either have no solutions or infinite solutions. Let d = gcd (a,b). If d + c, then equation has no solution. If d | c, then we have infinite number of solutions. (1 is particular and rest are general solutions) To find the particular solution: x0 = (c/d)s and y0 = (c/d)t To find the general solution: x = x0+k(b/d) and y = y0+k(a/d), where k is an integer Example: 21x + 14y = 35

Modular Arithmetic a = q x n + r mod In division relationship, we reviewed 2 values: q and r. In modular arithmetic, we will concentrate only on ‘r’. This implies we can view it as a binary relation (2 inputs and 1 output) Division Relation Modulo Operator Z= {………,-2,-1,0,1,2,………} a = q x n + r n r Z= {………,-2,-1,0,1,2,………} mod n r a a q

Set of residues: Zn The result of modulo operation with modulus n is always between 0 and n-1. Modulo operation creates a set known as set of least residues modulo n or Zn Zn= {0,1,2,3,4………(n-1)} Z2= {0,1} Z5= {0,1,2,3,4} Z11= {0,1,2,3,4,5,6,7,8,9,10}

Congruence Residual classes Mapping from Z to Zn is not one-to-one. Infinite numbers of Z can map to one member of Zn. Consider, 2 mod 10 = 2, 12 mod 10 = 2, 22 mod 10 = 2. Instead of equality operator we will use congruence operator (≡). Since, 3 ≡ 8 (mod 5), 8 ≡ 13 (mod 5), 34 ≡ 24 (mod 10) are true, we infer that congruence is many-to-one. Residual classes A residual class [a] or [an] is the set of integers congruent modulo n If n = 5, then its residual classes are [0],[1],[2],[3],[4] [0] = {….,-15,-10,-5,0,5,10,15,…..} [1] = {….,-14,-9,-4,1,6,11,16,…..}

Circular Notation All congruent modulo n occupy the same point on the circle.

Operations in Zn Operations are (a+b) mod n = c (a-b) mod n = c Binary operations (addition, subtraction, multiplication) that are applicable on set Z, are also applicable in set Zn Operations are (a+b) mod n = c (a-b) mod n = c (a*b) mod n = c Example: Add 7 to 14 in Z15 (14+7) mod 15  21 mod 15 = 6

Properties (a+b) mod n = [(a mod n) + (b mod n)] mod n (a-b) mod n = [(a mod n) - (b mod n)] mod n (axb) mod n = [(a mod n) x (b mod n)] mod n

Inverses When working on modular arithmetic, we often need to find the inverse of a number relative to an operation. Normally, additive and multiplicative inverses are used. Additive inverse In Zn, two numbers a and b are additive inverses of each other if a + b ≡ 0 (mod n) Sum of an integer and its inverse is congruent to 0 modulo b. Example 1: Additive inverse of 4 in Z10 is 10 – 4 = 6 Example 2: Find all the additive inverses pairs on Z10 (0,0) (1,9) (2,8) (3,7) (4,6) (5,5)

Multiplicative inverse An integer may nor may not have multiplicative inverse. When it does, the product of the integer and its multiplicative inverse is congruent to 1 modulo n. In Zn, two numbers a and b are multiplicative inverses of each other if a x b ≡ 1 (mod n) Example 1: If the modulus is 10 and a is 3 then the multiplicative inverse of 3 is 7, i.e. (3 x 7) mod 10 = 1. ‘a’ has a multiplicative inverse in Zn, if and only if gcd (n,a)=1 Example 2: Find the multiplicative inverse of 8 in z10 gcd (10,8) = 2, which is not equal to 1, hence there are no multiplicative inverse of 8 in z10. We cannot find any number between 0 and 9 such that when that when multiplied by 8, the result is congruent to 1

During encryption if sender is using an integer then at the receiving end, inverse of that integer will be used. If the operation is addition, Zn can be used but if the operation is multiplication then Zn cannot be used because not all integers have their multiplicative inverse in Zn Instead of Zn we have Zn* , which is set of integers with multiplicative inverses. Example: Z6 = {0,1,2,3,4,5} and Z6* = {1,5}

Matrices Definition, Addition, Subtraction, Multiplication Inverses Additive Inverse: of matrix A is another matrix B such that A + B = 0. Multiplicative Inverse: is defined only for square matrices. A and B, such that A x B = B x A = I Residue matrices: Matrices with all the elements on Zn.

Linear Congruence Cryptography usually involves system of equations of one or more variables with coefficients in Zn. Single-Variable Linear Equations Equations of the form : ax ≡ b (mod n) Result: No solutions or limited solutions. Assume, gcd (a,n) = d. If d + b, then no solutions, if d | b, then d solutions. Steps: Reduce the equation by dividing both sides by d. Multiply both sides by the multiplicative inverse of a to find x0 General Solutions are x =x0+ k (n/d) for k=0,1,….,(d-1)

Example 1: Solve: 10x ≡ 2 (mod 15) Gcd (10,15) = 5. Since 5 does not divide 2, so solution Example 2: Solve 14x ≡ 12 (mod 18) Gcd (14, 18) = 2. Since 2 divides 12, we have two solutions 14x ≡ 12 (mod 18) 7x ≡ 6 (mod 9) x ≡ 6 * 7-1 (mod 9) x0 = 6 * 4 (mod 9) = 6 x1 = x0 + 1 (18/2) = 15

Set of Linear Equations The matrix formed by the coefficients of the variables is invertible. n value should be same for all the equations. Example: 3x + 5y + 7z ≡ 3 (mod 16) x + 4y + 13z ≡ 5 (mod 16) 2x + 7y + 3z ≡ 4 (mod 16)

Can machines keep us safe from cyber-attack? EXTRA: 1 (Machine versus Hackers) Can machines keep us safe from cyber-attack? The Defence Advanced Research Projects Agency (DARPA) has more recently brought engineers together to tackle what it considers to be "grand challenges". Aims to develop software smart enough to spot and seal vulnerabilities in other programs before malicious hackers even know they exist. http://www.bbc.com/news/technology-36923794

EXTRA: 2 The flaws were found in software that handles graphics and in code that controls communication between different processes running inside a phone. Exploiting the bugs would allow an attacker to gradually be able to take more control over a device and gain access to its data. Checkpoint has created a free app called QuadRooter Scanner that can be used to check if a phone is vulnerable to any of the bugs. http://www.bbc.com/news/technology-37005226

EXTRA: 3 http://fossbytes EXTRA: 3 http://fossbytes.com/10-best-operating-systems-for-ethical- hacking-and-penetration-testing-2016/