CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.

Slides:



Advertisements
Similar presentations
Matrices: Inverse Matrix
Advertisements

Prime An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. Examples: The first six primes are.
Maths for Computer Graphics
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
“No one can be told what the matrix is…
Matrices MSU CSE 260.
Section 2.9 The Hill Cipher; Matrices
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
Matrix Equations Step 1: Write the system as a matrix equation. A three-equation system is shown below.
259 Lecture 14 Elementary Matrix Theory. 2 Matrix Definition  A matrix is a rectangular array of elements (usually numbers) written in rows and columns.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
CSE 504 Discrete Mathematics & Foundations of Computer Science
Chapter 2 Solving Linear Systems Matrix Definitions –Matrix--- Rectangular array/ block of numbers. –The size/order/dimension of a matrix: (The numbers.
Mathematics of Cryptography Part I: Modular Arithmetic
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Mathematics of Cryptography Modular Arithmetic, Congruence,
Section 4.1 Using Matrices to Represent Data. Matrix Terminology A matrix is a rectangular array of numbers enclosed in a single set of brackets. The.
Equation --- An equation is a mathematical statement that asserts the equality of twomathematicalstatement expressions. An equation involves an unknown,
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Review for Chapter 4 Important Terms, Symbols, Concepts 4.1. Systems of Linear Equations in Two Variables.
THU, JAN 8, 2015 Create a “Big Book of Matrices” flip book using 4 pages. Do not make your tabs big! BIG BOOK OF MATRICES What is a Matrix? Adding & Subtracting.
Matrix Algebra. Quick Review Quick Review Solutions.
4.6 Matrix Equations and Systems of Linear Equations In this section, you will study matrix equations and how to use them to solve systems of linear equations.
Chapter 8 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Matrix Operations and Their Applications.
Matrices. A matrix, A, is a rectangular collection of numbers. A matrix with “m” rows and “n” columns is said to have order m x n. Each entry, or element,
8.1 Matrices & Systems of Equations
Matrices Addition & Subtraction Scalar Multiplication & Multiplication Determinants Inverses Solving Systems – 2x2 & 3x3 Cramer’s Rule.
Ch X 2 Matrices, Determinants, and Inverses.
1 C ollege A lgebra Systems and Matrices (Chapter5) 1.
Unit 6 : Matrices.
1. Inverse of A 2. Inverse of a 2x2 Matrix 3. Matrix With No Inverse 4. Solving a Matrix Equation 1.
10.4 Matrix Algebra 1.Matrix Notation 2.Sum/Difference of 2 matrices 3.Scalar multiple 4.Product of 2 matrices 5.Identity Matrix 6.Inverse of a matrix.
Unit 3: Matrices.
Matrix Multiplication The inner dimensions must be the same (or the number of columns in the first matrix is equal to the number of rows in the second.
Algebra 3: Section 5.5 Objectives of this Section Find the Sum and Difference of Two Matrices Find Scalar Multiples of a Matrix Find the Product of Two.
Chapter 6 Systems of Linear Equations and Matrices Sections 6.3 – 6.5.
Chapter 6 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Matrix Operations and Their Applications.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
4.5 Matrices, Determinants, Inverseres -Identity matrices -Inverse matrix (intro) -An application -Finding inverse matrices (by hand) -Finding inverse.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Algebra Matrix Operations. Definition Matrix-A rectangular arrangement of numbers in rows and columns Dimensions- number of rows then columns Entries-
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Chapter 5 More Work with Matrices
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
LEARNING OUTCOMES At the end of this topic, student should be able to :  D efination of matrix  Identify the different types of matrices such as rectangular,
Unit 3: Matrices. Matrix: A rectangular arrangement of data into rows and columns, identified by capital letters. Matrix Dimensions: Number of rows, m,
CS480 Cryptography and Information Security
Designed by Victor Help you improve MATRICES Let Maths take you Further… Know how to write a Matrix, Know what is Order of Matrices,
Matrix Algebra Definitions Operations Matrix algebra is a means of making calculations upon arrays of numbers (or data). Most data sets are matrix-type.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
10.4 Matrix Algebra. 1. Matrix Notation A matrix is an array of numbers. Definition Definition: The Dimension of a matrix is m x n “m by n” where m =
College Algebra Chapter 6 Matrices and Determinants and Applications
MTH108 Business Math I Lecture 20.
Use Inverse Matrices to Solve Linear Systems
CS480 Cryptography and Information Security
Mathematics of Cryptography
Cryptography and Information Security
CS480 Cryptography and Information Security
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Matrix Operations SpringSemester 2017.
Chapter 4 Systems of Linear Equations; Matrices
Unit 3: Matrices
3.8 Use Inverse Matrices to Solve Linear Systems
[MATRICES ].
Chapter 4 Systems of Linear Equations; Matrices
Matrix Operations SpringSemester 2017.
[MATRICES ].
Presentation transcript:

CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography (2)

3-2 Review r Z and Zn r Modular operation r Gcd and Euclidean Algorithm r Additive inerveses 3. Math_2 CS480_W16

3-3 Exercise 1: r Prove the following property: if n|a and a|b, then n|b 3. Math_2 CS480_W16

3-4 Exercise 2: r Find the greatest common divisor of 4740 and Math_2 CS480_W16

3-5 Exercise 3: a) Subtract 14 from 8 in Z15 b) Multiply 12 by -3 in Z Math_2 CS480_W16

3-6 Exercise 4: r Find the additive inverses of the following integers: a) 5 in Z12 b) 5 in Z15 c) 4 in Z8 d) 4 in Z10 3. Math_2 CS480_W16

Math_2 CS480_W16 Outline r Multiplicative inverse r Extended Euclidean algorithm r Matrices r Linear congruence

Math_2 CS480_W16 Multiplicative inverse r a ≡ b -1 mod n or a -1 ≡ b mod n r In modular arithmetic, an integer may or may not have a multiplicative inverse. r When it does, the product of the integer and its multiplicative inverse is congruent to 1 modulo n. In Z n, two numbers a and b are the multiplicative inverse of each other if

Math_2 CS480_W16 Multiplicative inverse (cont.) Find the multiplicative inverse of 7 in Z 10. r Example: 3 * 7 mod 10 = 21 mod 10 = 1 So 7 -1 ≡ 3 mod 10

Math_2 CS480_W16 Multiplicative inverse (cont.) Find the multiplicative inverse of 8 in Z 10. r Example: r There is no multiplicative inverse r we cannot find any number between 0 and 9 such that when multiplied by 8, the result is congruent to 1

Math_2 CS480_W16 Multiplicative inverse (cont.) r There are only three pairs: r (1, 1), (3, 7) and (9, 9) r The numbers 0, 2, 4, 5, 6, and 8 do not have a multiplicative inverse. Find all multiplicative inverses in Z 10.

Math_2 CS480_W16 Multiplicative inverse (cont.) Find all multiplicative inverse pairs in Z 11.

Math_2 CS480_W16 Multiplicative inverse (cont.) r How to know whether an integer b has a multiplicative inverse in Z n ? m If gcd(n,b) = 1, b has a multiplicative inverse m If gcd(n,b)≠ 1, b doesn’t have a multiplicative inverse r If b has a multiplicative inverse, how to find it? m Use extended Euclidean algorithm

Math_2 CS480_W16 Extended Euclidean algorithm r The extended Euclidean algorithm finds the multiplicative inverses of b in Zn m when n and b are given m and gcd (n, b) = 1.

Math_2 CS480_W16 Extended Euclidean algorithm (cont.)

Math_2 CS480_W16 Extended Euclidean algorithm (cont.) Find the multiplicative inverse of 11 in Z 26. The gcd (26, 11) is 1; the inverse of 11 is  7 or 19.

Math_2 CS480_W16 Extended Euclidean algorithm (cont.) Find the multiplicative inverse of 23 in Z 100. The gcd (100, 23) is 1; the inverse of 23 is  13 or 87.

Math_2 CS480_W16 Extended Euclidean algorithm (cont.) Find the inverse of 12 in Z 26. The gcd (26, 12) is 2; the inverse does not exist.

Math_2 CS480_W16 Addition and Multiplication Tables

Math_2 CS480_W16 Different sets for addition and multiplication r In cryptography, we often work with inverses m If the sender uses an integer as the encryption key, the receiver uses the inverse of that integer as the decryption key. m If the operation (encryption/decryption) is addition, Z n can be used as the set of possible keys Each integer in Zn has an additive inverse m If the operation (encryption/decryption) is multiplication, Z n can NOT be used as the set of possible keys ONLY SOME integer in Z n has an multiplicative inverse r We need a new set Z n* m a subset of Z n m All members in Z n* have a multiplicative inverse

Math_2 CS480_W16 Different sets for addition and multiplication r We need to use Zn when additive inverses are needed r we need to use Zn* when multiplicative inverses are needed

Math_2 CS480_W16 Two more sets r Cryptography often uses two more sets: Zp and Zp*, p is a prime r The modulus in these two sets is a prime number

Math_2 CS480_W16 Matrices r In cryptography we need to handle matrices. r A brief review of matrices is necessary preparation for the study of cryptography m Definitions m Operations and Relations m Determinants m Residue Matrices

Math_2 CS480_W16 Definition r A matrix is a rectangular array of l x m elements r A matrix is normally denoted with boldface uppercase letters r The element a ij is located in the ith row and jth column

Math_2 CS480_W16 Definition r Row matrix m A matrix that has only one row r Column matrix m A matrix that has only one column r Square matrix m A matrix with the same number of rows and columns r Identity matrix I m A square matrix with 1s on the main diagonal and 0s elsewhere r Additive identity matrix 0 m A matrix with all rows and columns set to 0’s

Math_2 CS480_W16 Example Figure 2.19 Examples of matrices

Math_2 CS480_W16 Operations and Relations r Equality m Two matrices are equal if they have the same number of rows and columns and the corresponding elements are equal m A = B if we have a ij = b ij for all i’s and j’s r Addition m Two matrices can be added if they have the same number of columns and rows m C = A+B, c ij = a ij +b ij r Subtraction m Subtraction is the same except that each element of B is subtracted from the corresponding element of A m D = A-B, d ij = a ij - b ij

Math_2 CS480_W16 Operations and Relations Figure 2.20 Addition and subtraction of matrices

Math_2 CS480_W16 Operations and Relations r Multiplication (C = A x B) m Two matrices can be multiplied if the number of columns of the first matrix is the same as the number of rows of the second matrix m If A is an l x m matrix and B is an m x p matrix, C is of size l x p C ij = a i1 x b 1j + a i2 x b 2j + … +a im x b mj

Math_2 CS480_W16 Operations and Relations Figure 2.21 Multiplication of a row matrix by a column matrix

Math_2 CS480_W16 Operations and Relations Figure 2.22 Multiplication of a 2 × 3 matrix by a 3 × 4 matrix

Math_2 CS480_W16 Operations and Relations Figure 2.23 Scalar multiplication r Scalar multiplication

Math_2 CS480_W16 Determinant r The determinant of a square matrix A of size m × m denoted as det (A) is a scalar calculated recursively as shown below:

Math_2 CS480_W16 Determinant r An example of how we can calculate the determinant of a 2 × 2 matrix based on the determinant of a 1 × 1 matrix

Math_2 CS480_W16 Determinant r An example of how we can calculate the determinant of a 3 × 3 matrix 26 29

Math_2 CS480_W16 Inverses r Additive inverse m The additive inverse of A is another matrix B such that A+B=0. m B = -A r Multiplicative inverse m The multiplicative inverse is only defined for square matrices m The multiplicative inverse of a square matrix A is a square matrix B such that A x B = B x A = I m B = A -1 m No multiplicative inverse of a matrix in Z

Math_2 CS480_W16 Residue Matrices r Cryptography uses residue matrices: matrices where all elements are in Zn. r A residue matrix has a multiplicative inverse if gcd (det(A), n) = 1. Figure 2.26 A residue matrix and its multiplicative inverse in Z 26

Math_2 CS480_W16 Linear congruence r Congruence m Two matrices are congruent modulo n, written as A ≡ B(mod n) if They have the same number of rows and columns All corresponding elements are congruent modulo n ≡ m A ≡ B (mod n) if a ij ≡ b ij (mod n) for all i’s and j’s r Cryptography often involves solving an equation or a set of equations of one or more variables with coefficient in Zn r How to solve equations when the power of each variable is 1 (linear equation) m Single-Variable Linear Equations m Set of Linear Equations

Math_2 CS480_W16 Single-Variable Linear Equations r Equations of the form ax ≡ b (mod n ) might have no solution or a limited number of solutions 1. Reduce the equation by dividing both sides of the equation (including the modulus) by d 2. Multiply both sides of the reduced equation by the multiplicative inverse of a to find the particular solution x 0 3. The general solutions are x=x 0 + k(n/d), for k=0,1,…, d-1

Math_2 CS480_W16 Single-Variable Linear Equations r Example 1: Solve the equation 10 x ≡ 2(mod 15) m Solution: First we find the gcd (10 and 15) = 5. Since 5 does not divide 2, we have no solution. r Example 2: Solve the equation 14 x ≡ 12 (mod 18)

Math_2 CS480_W16 Single-Variable Linear Equations r Example 3: Solve the equation 3x + 4 ≡ 6 (mod 13)