0% found this document useful (0 votes)
43 views

Cryptography

This document discusses matrices and linear congruence in cryptography. It covers definitions of matrices, operations on matrices like addition and multiplication, determinants, residue matrices, and solving single-variable and sets of linear equations modulo n. Examples are provided to illustrate matrix operations, calculating determinants, solving linear equations, and solving sets of linear equations. The goal is to review concepts from linear algebra that are necessary for understanding cryptography techniques.

Uploaded by

Bhaviteja Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Cryptography

This document discusses matrices and linear congruence in cryptography. It covers definitions of matrices, operations on matrices like addition and multiplication, determinants, residue matrices, and solving single-variable and sets of linear equations modulo n. Examples are provided to illustrate matrix operations, calculating determinants, solving linear equations, and solving sets of linear equations. The goal is to review concepts from linear algebra that are necessary for understanding cryptography techniques.

Uploaded by

Bhaviteja Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Cryptography

Lecture 12
2-3 MATRICES

In cryptography we need to handle matrices. Although


this topic belongs to a special branch of algebra called
linear algebra, the following brief review of matrices is
necessary preparation for the study of cryptography.

Topics discussed in this section:


2.3.1 Definitions
2.3.2 Operations and Relations
2.3.3 Determinants
2.3.4 Residue Matrices

2
2.3.1 Definition

A matrix of size l ´ m
3
2.3.1 Continued

Examples of matrices

4
2.3.2 Operations and Relations
Example

Example of addition and subtraction.

Addition and subtraction of matrices


5
2.3.2 Continued
Example

The product of a row matrix (1×3) by a column matrix


(3×1). The result is a matrix of size 1×1.

Multiplication of a row matrix by a column matrix


6
2.3.2 Continued
Example

The product of a 2×3 matrix by a


3×4 matrix. The result is a 2×4 matrix.

Multiplication of a 2 × 3 matrix by a 3 × 4 matrix

7
2.3.2 Continued
Example

Example of scalar multiplication.

Scalar multiplication

8
2.3.3 Determinant

The determinant of a square matrix A of size m × m


denoted as det (A) is a scalar calculated recursively as
shown below:

Note

The determinant is defined only for a


square matrix.
9
2.3.3 Continued
Example

How to calculate the determinant of a 2 × 2 matrix


based on the determinant of a 1 × 1 matrix?

Calculating the determinant of a 2 ´ 2 matrix

10
2.3.3 Continued
Example

Calculation of the determinant of a 3 × 3 matrix.

Calculating the determinant of a 3 ´ 3 matrix

11
2.3.4 Inverses

Note

Multiplicative inverses are only defined


for square matrices.

12
2.3.5 Residue Matrices

Cryptography uses residue matrices: matrices where


all elements are in Zn. A residue matrix has a
multiplicative inverse if gcd (det(A), n) = 1.

Example
A residue matrix and its multiplicative inverse

13
2-4 LINEAR CONGRUENCE

Cryptography often involves solving an equation or a


set of equations of one or more variables with
coefficient in Zn. This section shows how to solve
equations when the power of each variable is 1 (linear
equation).

Topics discussed in this section:


2.4.1 Single-Variable Linear Equations
2.4.2 Set of Linear Equations

14
2.4.1 Single-Variable Linear Equations

Equations of the form ax ≡ b (mod n ) might have no


solution or a limited number of solutions.

15
2.4.1 Continued

Example
Solve the equation 10 x ≡ 2(mod 15).
Solution
First we find the gcd (10 and 15) = 5. Since 5 does not divide
2, we have no solution.

Example
Solve the equation 14 x ≡ 12 (mod 18).
Solution

16
2.4.1 Continued
Example

Solve the equation 3x + 4 ≡ 6 (mod 13).

Solution
First we change the equation to the form ax ≡ b (mod n). We
add −4 (the additive inverse of 4) to both sides, which give
3x ≡ 2 (mod 13). Because gcd (3, 13) = 1, the equation has only
one solution, which is x0 = (2 × 3−1) mod 13 = 18 mod 13 = 5.
We can see that the answer satisfies the original equation:
3 × 5 + 4 ≡ 6 (mod 13).

17
2.4.2 Single-Variable Linear Equations

We can also solve a set of linear equations with the


same modulus if the matrix formed from the
coefficients of the variables is invertible.

Set of linear equations


18
2.4.2 Continued

Example
Solve the set of following three equations:

Solution
The result is x ≡ 15 (mod 16), y ≡ 4 (mod 16), and z ≡ 14 (mod
16). We can check the answer by inserting these values into
the equations.

19
References

 Chapter 2 & 4 - Behrouz A Forouzan, Debdeep


Mukhopadhyay, Cryptography and Network Security,
Mc Graw Hill, 3rd Edition, 2015.
 Chapter 4 - William Stallings, Cryptography and
Network Security Principles and Practices, 7th Edition,
Pearson Education, 2017.

You might also like