ENGG2013 Unit 10 n  n determinant and an application to cryptography Feb, 2011.

Slides:



Advertisements
Similar presentations
Elementary Linear Algebra Anton & Rorres, 9th Edition
Advertisements

Applied Informatics Štefan BEREŽNÝ
Chapter 4 Systems of Linear Equations; Matrices
Chapter 4 Systems of Linear Equations; Matrices
Computer Science 101 Data Encryption And Computer Networks.
22C:19 Discrete Structures Integers and Modular Arithmetic
Matrix Algebra Matrix algebra is a means of expressing large numbers of calculations made upon ordered sets of numbers. Often referred to as Linear Algebra.
Matrix Algebra Matrix algebra is a means of expressing large numbers of calculations made upon ordered sets of numbers. Often referred to as Linear Algebra.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Matrices & Systems of Linear Equations
ENGG2013 Unit 11 Row-Rank Feb,
Classical Cryptography 1. Introduction: Some Simple Cryptosystems.
Economics 2301 Matrices Lecture 13.
ENGG2013 Unit 9 3x3 Determinant
ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination Jan, 2011.
Matrices and Determinants
Section 2.9 The Hill Cipher; Matrices
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
1 Introduction to Codes, Ciphers, and Cryptography Michael A. Karls Ball State University.
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
3.1 SERVICES AND MECHANISMS SERVICES AND MECHANISMS The International Telecommunication Union- Telecommunication Standardization Section (ITU-T) provides.
 Row and Reduced Row Echelon  Elementary Matrices.
1 Chapter 6 – Determinant Outline 6.1 Introduction to Determinants 6.2 Properties of the Determinant 6.3 Geometrical Interpretations of the Determinant;
Chapter 3: The Fundamentals: Algorithms, the Integers, and Matrices
Computer System Security CSE 5339/7339
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.
Systems of Equations as Matrices and Hill Cipher.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
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 C ollege A lgebra Systems and Matrices (Chapter5) 1.
Symmetric-Key Cryptography
Some Number Theory Modulo Operation: Question: What is 12 mod 9?
Traditional Symmetric-Key Ciphers
Operations with Matrices
CSCI 391: Practical Cryptology Substitution Monoalphabetic Ciphers.
Elementary Linear Algebra Anton & Rorres, 9 th Edition Lecture Set – 02 Chapter 2: Determinants.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
MAT 1000 Mathematics in Today's World Winter 2015.
Copyright © Cengage Learning. All rights reserved. 7 Linear Systems and Matrices.
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.
Learning Objectives for Section 4.5 Inverse of a Square Matrix
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Sec 3.6 Determinants 2x2 matrix Evaluate the determinant of.
Greatest Common Divisors & Least Common Multiples  Definition 4 Let a and b be integers, not both zero. The largest integer d such that d|a and d|b is.
Chapter 2 Determinants. With each square matrix it is possible to associate a real number called the determinant of the matrix. The value of this number.
Unit 2 Modular Arithmetic and Cryptography IT Disicipline ITD1111 Discrete Mathematics & Statistics STDTLP 1 Unit 2 Modular Arithmetic and Cryptography.
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
Dr. Saatchi, Seyed Mohsen 1 Arab Open University - AOU T209 Information and Communication Technologies: People and Interactions Sixth Session.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.
Slide INTRODUCTION TO DETERMINANTS Determinants 3.1.
CHAPTER 7 Determinant s. Outline - Permutation - Definition of the Determinant - Properties of Determinants - Evaluation of Determinants by Elementary.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Chapter 4 Systems of Linear Equations; Matrices
Sec 3.6 Determinants 2x2 matrix Evaluate the determinant of.
Substitution Ciphers.
nhaa/imk/sem /eqt101/rk12/32
CHAPTER 2 MATRICES Determinant Inverse.
Computer and Data Security 4th Class
Chapter 2 Determinants by Cofactor Expansion
Chapter 2 Determinants Basil Hamed
Learning Objectives for Section 4.5 Inverse of a Square Matrix
Chapter 4 Systems of Linear Equations; Matrices
Chapter 2 Determinants.
DETERMINANT MATH 80 - Linear Algebra.
Chapter 4 Systems of Linear Equations; Matrices
Presentation transcript:

ENGG2013 Unit 10 n  n determinant and an application to cryptography Feb, 2011.

Yesterday – A formula for matrix inverse using cofactors kshumENGG20132 Suppose that det A is nonzero. Three steps in computing above formula 1. for i,j = 1,2,3, replace each a ij by cofactor C ij 2. Take the transpose of the resulting matrix. 3. divide by the determinant of A. Usually called the adjoint of A cofactors

Outline nxn determinant Caesar Cipher Modulo arithmetic Hill Cipher kshumENGG20133

DETERMINANT IN GENERAL kshumENGG20134

A pattern Arrange the products so that the first subscripts are in ascending order. All possible orderings of the second subscripts appear once and only once. kshumENGG20135

Transposition A transposition is an exchange of two objects in a list of objects. kshumENGG20136 A B C D A C B D Examples: “Transposition” is another mathematical term, and is not the same as matrix tranpose.

Another pattern The sign of each term is closely related to the number of transpositions required to obtain the second subscripts, starting from (1,2) for the 2x2 case or (1,2,3) for the 3x3 case. kshumENGG20137

The sign Let p(1), p(2), …, p(n) be an order of 1,2,…,n. – For example p(1)=3, p(2) = 2, p(3)=1 is an ordering of 1, 2, 3. Starting from (1,2,…,n), if we need an odd no. of transpositions to get ( p(1), p(2), …, p(n) ), we define the sign of (p(1), p(2),…,p(n)) be –1. Otherwise, if we need an even no. of transpositions to get ( p(1), p(2), …, p(n) ), we define the sign of (p(1), p(2),…,p(n)) be +1. kshumENGG20138

Definition of n  n determinant The summation is over all n! possible orderings p = ( p(1), p(2), …, p(n) ) of 1,2,…,n. – There are n! terms. sgn(p) is either +1 or –1, usually called the signature or signum of p. kshumENGG 11

Properties of determinant Determinant of n  n identity matrix equals 1. Exchange two rows (or columns)  multiply determinant by –1. Multiply a row (or a column) by a constant k  multiply the determinant by k. Add a constant multiple of a row (column) to another row (column)  no change Additive property as in the 3  3 and 2  2 case. kshumENGG201310

Cofactor and the adjoint formula for matrix inverse Cofactors are defined in a similar way as in the 3x3 case. – The cofactor of the (i,j)-entry of a matrix A, denoted by C ij, is defined as (–1) i+j A ij, where A is the determinant of the sub- matrix obtained by removing the i-th row and the j-th column. We have similar expansion along a row or a column (also called the Laplace expansion) as in the 3x3 case. The adjoint formula: kshumENGG nxn identity Aadjoint of A The formula in this form holds when det A = 0 also transpose

CAESAR CIPHER kshumENGG201312

Caesar and his army kshumENGG ATTACK Soldier carrying the message “ATTACK” Message may be intercepted by enemy

Caesar cipher kshumENGG ATTACK Soldier carrying the encrypted message “DWWDFN” The encrypted message looks random and meaningless

Private key encryption kshumENGG Plain text Encryption function Ciphertext Plain text Decryption function Ciphertext Key key The value of “key” is kept secret

Mathematical description kshumENGG ATTACK Shift to the right by 3 DWWDFN ATTACK Shift to the left by 3 DWWDFN Key =3 Caesar cipher is not secure enough, because the number of keys is too small.

MODULO ARITHMETIC kshumENGG201317

Mod 12 Clock arithmetic kshumENGG = 2 mod = 5 mod 12

Mod 7 Week arithmetic kshumENGG = 3 mod = 5 mod 7 SunMonTueWedThrFriSat

Mod 60 天干地支 arithmetic kshumENGG 甲子甲子 乙丑乙丑 丙寅丙寅 丁卯丁卯 戊辰戊辰 己巳己巳 庚午庚午 辛未辛未 壬申壬申 癸酉癸酉 甲戌甲戌 乙亥乙亥 丙子丙子 丁丑丁丑 戊寅戊寅 己卯己卯 庚辰庚辰 辛巳辛巳 壬午壬午 癸未癸未 甲申甲申 乙酉乙酉 丙戌丙戌 丁亥丁亥 戊子戊子 己丑己丑 庚寅庚寅 辛卯辛卯 壬辰壬辰 癸巳癸巳 甲午甲午 乙未乙未 丙申丙申 丁酉丁酉 戊戌戊戌 己亥己亥 庚子庚子 辛丑辛丑 壬寅壬寅 癸卯癸卯 甲辰甲辰 乙巳乙巳 丙午丙午 丁未丁未 戊申戊申 己酉己酉 庚戌庚戌 辛亥辛亥 壬子壬子 癸丑癸丑 甲寅甲寅 乙卯乙卯 丙辰丙辰 丁巳丁巳 戊午戊午 己未己未 庚申庚申 辛酉辛酉 壬戌壬戌 癸亥癸亥 Year of rabbit

Mod n – formal definition n is a fixed positive integer Definition: a mod n is the remainder of a after division by n. – Example: 25 = 1 mod 12. Addition and multiplication: If the sum or product of two integers is larger than or equal to n, divide by n and take the remainder. – Example: 2+10 = 0 mod 12. – Example: 2  5 = 3 mod 12. kshumENGG201321

More examples 10 mod 7 = mod 7 = mod 7 = 6 2  7 mod 7 = 0 kshumENGG201322

Mod 26 ABCDEFGHIJKLM kshumENGG NOPQRSTUVWXYZ Fix a one-to-one correspondence between the English alphabets and the integers mod 26. Caesar’s cipher: shifting a letter to the right by 3 is the same as adding 3 in mod 26 arithmetic.

Examples of mod 26 calculations 3+19 = ? mod = ? mod 26 3  4 = ? Mod  4 = ? Mod 26 kshumENGG ABCDEFGHIJKLM NOPQRSTUVWXYZ

Peculiar phenomena in modulo arithmetic Non-zero times non-zero may be zero – 4  9 = 0 mod 12 – 2  2 = 0 mod 4 Multiplicative inverse may not exist – Cannot find an integer x such that 4x = 1 mod does not exist mod 12. kshumENGG201325

No fraction in modulo arithmetic In mod 12, don’t write 1/3 or 3 -1 because it does not exist. But 5 -1 is well-defined mod 12, because we can solve 5x=1 mod 12. Indeed, we have 5  5 = 1 mod 12. Therefore 5 -1 = 5 mod 12. kshumENGG Fraction Fact from number theory: multiplicative inverse of x mod n exists if and only the gcd of x and n is 1.

HILL CIPHER kshumENGG201327

Hill cipher Invented by L. S. Hill in Inputs : String of English letters, A,B,…,Z. An n  n matrix K, with entries drawn from 0,1,…,25. (The matrix K serves as the secret key. ) Divide the input string into blocks of size n. Identify A=0, B=1, C=2, …, Z=25. Encryption: Multiply each block by K and then reduce mod 26. Decryption: multiply each block by the inverse of K, and reduce mod 26. kshumENGG

Note The decryption must be the inverse function of the encryption function. – It is required that K -1 K = I n mod 26. Provided that det(K) has a multiplicative inverse mod 26, i.e., if det(K) and n has no common factor, the inverse of K can be computed by the adjoint formula for matrix inverse. Inverse of an integer mod 26 can be obtained by trial and error. kshumENGG201329

Example Plain text: “LOVE”, Secret Key: “LO”  “VE”  2, 3, 16, 5 are transformed to cipher text “CDQF” kshumENGG ABCDEFGHIJKLM NOPQRSTUVWXYZ

How to decode? Given “CDQF”, and the encryption matrix How do we decrypt? – We need to compute the inverse of Remind that all arithmetic are mod 26. There is no fraction and care should be taken in computing multiplicative inverse mod 26. kshumENGG201331

Determinant The determinant of equals 20(7)-3(15), which is 17 mod 26. Find the multiplicative inverse of 17 mod 26, i.e., find integer x such that 17x = 1 mod 26. Just try all 26 possibilities for x: kshumENGG  1 = 17 mod  2= 8 mod  3 = 25 mod  4 = 16 mod  5 = 7 mod  6 = 24 mod  7 = 15 mod  8 = 6 mod  9= 23 mod  10 = 14 mod  11 = 5 mod  12 = 22 mod  13 = 13 mod  14 = 4 mod  15 = 21 mod  16= 12 mod  17 = 3 mod  18 = 20 mod  19 = 11 mod  20 = 2 mod  21 = 19 mod  22 = 10 mod  23= 1 mod  24 = 18 mod  25 = 9 mod  0 = 0 mod 26

Computing the inverse mod 26 From 17  23= 1 mod 26, we know that the multiplicative inverse of 17 mod 26 is 23. Using the formula for 2  2 matrix inverse we get kshumENGG Replace (17) -1 mod 26 by 23

Decryption Given the ciphertext “CDQF”, we decrypt by multiplying by From the table in p.23, 11, 14, 21, 4 is “LOVE”. kshumENGG201334