Lecture 4 and 5.ppt
Lecture 4 and 5.ppt
&
Network Security
Lecture#4
2.2
MATRICES
Examples of matrices
2.4
2 Operations and Relations
Ex1: Addition and subtraction of matrices
2.5
2 Operations and Relations….cont’d
Ex3:Multiplication of a row matrix (1 × 3) by a column matrix (3 × 1)
The result is a matrix of size 1 × 1.
2.6
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:
2.8
4 Multiplicative Inverse of a Matrix
2.9
5 Residue Matrices
2.11
LINEAR CONGRUENCE
this equation.
Examples: Single-Variable Linear Equations
Ex2: Solve the equation 14 x ≡ 12 (mod 18).
2.15
Example: Set of Linear Equations (Single-Variable)
Ex: Solve the set of following three equations:
Solution
The result is x ≡ 15 (mod 16),
y ≡ 4 (mod 16), &
z ≡ 14 (mod 16).
We can check the answer by inserting these
values into the equations. 2.16
Assignment 01
Quiz 01
Semester Project
2.17
Classical Symmetric Key Ciphers
Classical Symmetric Key Ciphers
enables us to understand
The basic approaches to symmetric
encryption
Their benefits and weakness
2.19
General idea: symmetric-key cipher
3.21
Kerckhoff’s principle
The adversary, Eve, knows the
encryption/decryption algorithm.
The resistance of the cipher to attack must be
based only on the secrecy of the key:
Guessing the key should be so difficult that
there is no need to hide
encryption/decryption algorithms
Categories of Classical Symmetric Key
Ciphers
Substitution Ciphers
A substitution cipher replaces one symbol with
another.
e.g. we can replace letters A,I,M,N,R in the
plaintext with D,P,Q,L,S ,respectively to create
the cipher text
Transposition Ciphers
A Transposition Cipher does not replaces one
symbol with another, instead changes the location
of symbols.
Substitution Ciphers
Substitution
Ciphers can be
categories as either
monoalphabetic Ciphers
Polyalphabetic Ciphers
Monoalphabetic Ciphers
In these Ciphers, a character or symbol is always
replaced to the same character in the cipher text
regardless of its position.
E.g. if an algorithm says that the letter A in the plain Text is replaced with letter D
then every letter A is changed to Letter D.
3.29
Additive Cipher: Cryptanalysis
Solution
Eve tries keys from 1 to 7. With a key of 7, the plaintext
is “not very secure”, which makes sense.
Additive Cipher:
Cryptanalysis
Ciphertext-only attack using statistical
attack. Frequency of characters in English
3.32
Example: Eve has intercepted the following ciphertext.
Using a statistical attack, find the plaintext.
Solution
When Eve tabulates the frequency of letters in this
ciphertext, she gets: I =14, V =13, S =12, and so on.
The most common character is I with 14 occurrences.
This means key = 4.
3.33
Multiplicative Ciphers
integer in Z26*.
3.2.1 Continued
Example 3.7
What is the key domain for any multiplicative cipher?
Solution
The key needs to be in Z26*. This set has only 12
members: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25.
Example 3.8
We use a multiplicative cipher to encrypt the message
“hello” with a key of 7. The ciphertext is “XCZZU”.
3.35
Affine Ciphers
26 × 12 = 312.
Example: Affine cipher
Use an affine cipher to encrypt the message “hello”
with the key pair (7, 2).