cns19 Lec2 3 4
cns19 Lec2 3 4
cns19 Lec2 3 4
Network Security
Fall 2019
Lec#1
Dr Muhammad Imran
Course Information
Text/Ref:
Cryptography and Network Security by B A Forouzan
Cryptography and network Security by William Stalling
Grading Policy
Assignments/Quiz/project/participation : 20 %
Midterm Exam : 30 %
Final Exam : 50 %
Instructor: Dr M Imran
Email: mimran_047@yahoo.com
WhatsApp Groups: contact to CR and GR
Background
Information Security requirements have
changed in recent times
traditionally provided by physical and
administrative mechanisms
computer use requires automated tools to
protect files and other stored information
use of networks and communications links
requires measures to protect data during
transmission
Aim of Course
our focus is on Cryptography as well as
on Network Security
which consists of measures to deter,
prevent, detect, and correct security
violations that involve the transmission &
storage of information
Course Contents
Information security overview :
Goals, attacks, services,
mechanisms & techniques
Maths for Symmetric Key Cryptography:
Modular Arithmetic, Congruence,
Groups, Rings & Finite Fields.
Traditional Symmetric Key Ciphers:
Substitution, Transposition, One time pad,
Steganography
Modern Symmetric Key Ciphers:
Block cipher; DES, triple-DES, AES
Stream cipher; RC4
& modes of cipher ops,
Course Contents…cont’d
Maths for asymmetric key cryptography:
Number Theory: Prime numbers,
Euler’s theorem, Primality testing,
Factorization, Chinese remainder
theorem, Discrete logarithm
Asymmetric key cryptography:
RSA, Elgamal & Elliptic curve
cryptosystem
Cryptographic Hash functions:
SHA-512 & Whirlpool
Message Integrity & Authentication:
MDC, MAC, HMAC, Digital Signature
& Entity authentication
Course Contents…cont’d
Key Management:
KDC, KERBEROS, Diffie-Hellman,
CA, X.509 & PKI
Security at Internet model layers:
Application layer; PGP & S/MIME
Transport layer; SSL & TLS
Network layer; IPsec
E-Commerce Security:
Dual Signature & SET protocol
Lecture Objectives
1.8
security goals
1.9
OSI Security Architecture
ITU-T X.800 “Security Architecture for OSI”
a systematic way of defining and providing
security requirements
for us it provides a useful, if abstract,
overview of concepts we will study
considers 3 aspects of information security:
security attacks
security services
security mechanisms
ATTACKS
The three goals of securityconfidentiality, integrity, and
availabilitycan be threatened by security attacks.
1.13
Security Services
enhance security of data processing systems
and information transfers of an organization
intended to counter security attacks
using one or more security mechanisms
often replicates functions normally associated
with physical documents
• e.g signatures, dates; protection from disclosure, tampering,
or destruction; be notarized or witnessed; be recorded or
licensed
1.17
Relation between Services and Mechanisms
1.18
TECHNIQUES
Cryptography
Steganography
1.19
Cryptography vs Steganography
1.20
Model for Network Security
Requirements for Network
Security model
using this model requires us to:
1. design a suitable algorithm for the security
transformation
2. generate the secret information (keys)
used by the algorithm
3. develop methods to distribute and share
the secret information
4. specify a protocol enabling the principals
to use the transformation and secret
information for a security service
Cryptography
128 2128 = 3.4 1038 2127 µs = 5.4 1024 5.4 1018 years
years
168 2168 = 3.7 1050 2167 µs = 5.9 1036 5.9 1030 years
years
2.38
1. Set of Integers
2.39
2 Binary Operations
In cryptography, we are interested in three binary
operations ( + , - , X ) applied to the set of integers. A
binary operation takes two inputs and creates one output.
Examples:
2.40
3 Integer Division
In integer arithmetic, if we divide a (divident) by n
(divisor), we can get q (quotient) & r (remainder) . The
relationship between these four integers can be shown as
a=q×n+r
Example
2.41
Integer Division Relation
(not operation as more than one output)
2.42
4. Divisbility
If a is not zero & we get r = 0 in the division relation:-
a=q×n
If the remainder is zero,
If the remainder is not zero,
2.43
Greatest Common Divisor of two integers
The greatest common divisor of two
positive integers is the largest integer
that can divide both integers.
2.44
GCD (140,12) = largest(1 , 2 , 4) = 4
Euclidean Algorithm
Fact 1: gcd (a, 0) = a
Fact 2: gcd (a, b) = gcd (b, r); r is remainder of dividing a by b
2.47
Extended Euclidean algorithm : Process
2.48
Extended Euclidean algorithm: Algorithm
2.49
Examples: Extended Euclidean Agorithm
Ex1: Given a = 161 and b = 28, find gcd (a, b) & values of s and t.
We
2.50
get gcd (0, 45) = 45, s = 0, and t = 1.
MODULAR ARITHMETIC
2.52
Examples: mod operation
Solution
a. Dividing 27 by 5 results in r = 2
b. Dividing 36 by 12 results in r = 0.
c. Dividing −18 by 14 results in r = −4. After adding the
modulus r = 10
d. Dividing −7 by 10 results in r = −7. After adding the
modulus to −7, r = 3.
2.53
2. Set of Residues
2.54
3 Congruence
Two integers are congruent, if they have same residue for
a given modulus. we use the congruence operator ( ≡ ).
For example, we write:
2.55
Residue Classes
A residue class [a] or [a]n is the set of integers
congruent modulo n. (in following example n=5)
2.56
Comparison of Z and Zn using graphs
2.57
4. Binary Operation in Zn
The three binary operations that we discussed for the set
Z can also be defined for the set Zn. The result may need
to be mapped to Zn using the mod operator.
Binary operations in Zn
2.58
Examples: Binary Operations in Zn
Ex1: Perform following operations (inputs come from Zn):
a. Add 7 to 14 in Z15.
b. Subtract 11 from 7 in Z13.
c. Multiply 11 by 7 in Z20.
Solution
2.60
Properties of mode operator
2.61
Examples: Properties of mode operator
117 mod 13 ?
2.62
Examples: Properties of mode operator
2.63
5. Inverses in modular arithmetic
2.64
Additive Inverse
In modular arithmetic, each integer has an
additive inverse. The sum of an integer & its
additive inverse is congruent to 0 modulo n.
In Zn, two numbers a and b are additive inverses of each other if
In zn,
an integer may or may not have a multiplicative
inverse.
An integr a will only have an multiplicative inverse iff
gcd(n,a)=1. In this case a and n are called relative prime
or coprime.
2.66
Multiplicative Inverse
2.67
Finding Multiplicative Inverse using
Extended Euclidean algorithm
2.68
Finding Multiplicative
Inverse using Extended
Euclidean algorithm…cont’d
2.69
Examples: Finding Multiplicative Inverse using EEA
Ex1: Find the multiplicative inverse of 11 in Z26.
Ex2: Find
mult inv
of 12 in
Z26.
2.70 The gcd (26, 12) is 2; the inverse does not exist.
6. Addition and Multiplication Tables for Z10
2.71
Examples: Zn , Zn* , Zp , Zp* sets
We need to use Zn when additive inverses
are needed; we need to use Zn* when
multiplicative inverses are needed.
2.72
MATRICES
2.73
1 Definition
A matrix of size l m
Examples of matrices
2.74
2 Operations and Relations
Ex1: Addition and subtraction of matrices
2.75
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.76
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.78
4 Multiplicative Inverse of a Matrix
2.79
5 Residue Matrices
Adj(A)= 3 -17
-8 5
3 -17 3 9
A-1= i/det(A) * adj(A) = 1/9 x -8 5 mod 26 18 5
= 9-1 x
2.81
LINEAR CONGRUENCE
2.82
1. Single-Variable Linear Equations
Equations of the form ax ≡ b (mod n ) might have no
solution or a limited number of solutions.
2.85
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.86