0% found this document useful (0 votes)
27 views29 pages

CNS Unit-1

The document outlines the principles of Cryptography and Network Security for B.Tech(CSE) students, covering topics such as symmetric and asymmetric encryption, data integrity, digital signatures, and key management. It details security goals, types of cryptographic attacks, and the mathematical foundations of cryptography including integer arithmetic and modular arithmetic. The document serves as a comprehensive guide for understanding the mechanisms and services that ensure secure communication and data protection in networks.

Uploaded by

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

CNS Unit-1

The document outlines the principles of Cryptography and Network Security for B.Tech(CSE) students, covering topics such as symmetric and asymmetric encryption, data integrity, digital signatures, and key management. It details security goals, types of cryptographic attacks, and the mathematical foundations of cryptography including integer arithmetic and modular arithmetic. The document serves as a comprehensive guide for understanding the mechanisms and services that ensure secure communication and data protection in networks.

Uploaded by

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

Cryptography and Network Security B.

Tech(CSE) III Year II Sem

Index

Unit I: Basic Principles Page 3

Unit II: Symmetric Encryption Page 30

Unit III: Asymmetric Encryption Page 77

Unit IV:Data Integrity, Digital Signature Schemes & Key Management Page 99

Unit V: Network Security-I Page 129

Network Security-II Page 145


Cryptography and Network Security B.Tech(CSE) III Year II Sem

UNIT -I
Security Goals, Cryptographic Attacks, Services and Mechanisms, Mathematics of
Cryptography

WHAT IS NETWORK SECURITY ?


Network Security consists of the provisions and policies adapted by network Administrator to prevent and
monitor unauthorized access, misuse, modification, or denial of a computer network and network-accessible
resources.
WHAT IS CRYPTOGRAPHY?
Cryptography is the study of secure communications techniques that allow only the sender and intended
recipient of a message to view its contents.
The term is derived from the Greek word kryptos, which means hidden.
MODEL FOR NETWORK SECURITY - TERMINOLOGY
Plaintext - the original message
Cipher text - the coded message
Cipher - algorithm for transforming plaintext to cipher text
Key - info used in cipher known only to sender/receiver
Encipher (Encrypt) - converting plaintext to cipher text
Decipher (Decrypt) - recovering cipher text from plaintext
Cryptography - study of encryption principles/methods
Cryptanalysis (code breaking) - the study of principles/ methods of deciphering cipher text
without knowing key
Cryptology - the field of both cryptography and cryptanalysis

3
Cryptography and Network Security B.Tech(CSE) III Year II Sem

SECURITY GOALS

Cryptographic Attacks
Accessing of data by unauthorized entity is called as attack
Passive Attacks
Active Attacks

Passive Attacks:
In a passive attack, the goal is just to obtain information. This means that the attack does not
modify data or harm the system.
Active Attacks:
An active attack may change the data or harm the system. Attacks that threaten the integrity and availability
are active attacks.

Passive Attacks
(a) Release of message content
Capture and read the content transmissions.
(b) Traffic Analysis
read the information, but observe the pattern
determine the location and identity of communicating parties
observe frequency and length of communication

4
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Active Attacks
(a) Masquerading: Masquerading or snooping happens when the attacker impersonates somebody else.

(b) Replay
The attacker obtains a copy of a message sent by a user and later tries to replay it.

5
Cryptography and Network Security B.Tech(CSE) III Year II Sem

(c) Modification: After intercepting or accessing information, the attacker modifies the information then
send to receiver.

(d) Denial of service: Denial of service (Dos) is a very common attack.it may slow down or totally interrupt
the service of a system.

Cryptographic Attacks Categories


Cryptographic attacks can be broadly categorized into two distinct types:
Cryptanalytic
Non-Cryptanalytic
Cryptanalytic Attacks:
These attacks are combinations of statistical and algebraic techniques aimed at discover the secret
key of a cipher.

6
Cryptography and Network Security B.Tech(CSE) III Year II Sem

The attacker thus guesses the key and looks for the distinguishing property. if the property is
detected, the guess is correct otherwise the next guess is tried.
Non-Cryptanalytic Attacks:
The other types of attacks are non-cryptanalytic attacks, which do not explain the mathematical
weakness of the cryptographic algorithm.

SERVICES AND MECHANISM


Security Services
ITU-T (X .800) is provided by protocol layer of transmission that defines security services ensures security
of the data transfer

Data Confidentiality: It is designed to protect data from disclosure attack.. That is, it is designed to
prevent snooping and traffic analysis attack.
Data Integrity: It is designed to protect data from modification, insertion, deletion and replaying by
an adversary
Authentication: It provides the authentication of the party at the other end of the line.
Non-repudiation: It protects against repudiation by either the sender or the receiver of the data.
Access Control: It provides protection against unauthorized access to data

Security Mechanism:

ITU-T recommends Security mechanisms to provide the security services

Encipherment:The use of mathematical algorithms to transform data into a form that is not readily
understandable

7
Cryptography and Network Security B.Tech(CSE) III Year II Sem
Data Integrity:A variety of mechanisms used to assure the integrity of a data unit or stream of data
units.
Digital Signature:A digital signature is a means by which the sender can electronically sign the data
and the receiver can electronically verify the signature.
Authentication Exchange: A mechanism intended to ensure the identity of an entity by means of
information exchange.
Routing Control:Enables selection of particular physically secure routes for certain data and allows
routing changes, especially when a breach of security is suspected.
Traffic Padding: Inserting bogus data to prevent traffic analysis.
Notarization:The use of a trusted third party to assure certain properties of a data exchange.
Access Control:A variety of mechanisms that enforce access rights to resources.
Relation Security Services and Mechanisms
Security Mechanism: A mechanism that is designed to detect, prevent, or recover from a security attack.
Security Service: A service that enhances the security of data processing systems and information
transfers. A security service makes use of one or more security mechanisms.

MATHEMATICS OF CRYPTOGRAPHY
Integer Arithmetic: In Integer arithmetic, we are use a set and a few operations.
Set of Integers: The set of Integers, denoted by z, contains all integral numbers (with no fraction)
from negative infinity to positive infinity.

Binary Operations: A Binary operation takes two inputs and creates one output. Three common
binary operations defined for integers are addition, subtraction and multiplication.

8
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Examples:
Add: 5+9=14 (-5)+9=4 5+(-9)=-4
Subtract: 5-9=-4 (-5)-9=14 5-(-9)=14
Multiply: 5x9=45 (-5)x9=-45 5x(-9)=45
Integer Division: if we divide a by n, we can get q and r. The relationship between these four integers can be
shown as
a=q x n + r
a is dividend, n is the divisor, q is quotient , r is remainder
Examples: Assume that a = 255 and n = 11. We can find q = 23 and r = 2 using the division
algorithm. We have shown in following

Two Restrictions:
First, we require that the divisor be a positive integer (n > 0).
Second, we require that the remainder be a non-negative integer ( r > 0 ).
Integer Division

Examples: Assume r and q are negative when is negative.


To make r positive, decrement q by 1 and add value of n tor
consider -255=(-23x 11) +(-2) -255=(-24x11)+9
We have decremented -23 to -24 and added 11 to -2 to make 9.
The relation is still valid
Divisibility:
If a is not zero and we let r = 0 in the division relation, we get
a=qxn
We then say that n divides a ( or n is a divisor of a ). We can also say that a is divisible by n. The above
is n | a .
If the remainder is not zero, then n does not divide a and
we can write the relationship as a + n.
Examples: The integer 4 divides the integer 32 because 32 = 8 x 4.
We show this is as 4 | 32
The number 8 does not divide the number 42 because 42 = 5 x 8 + 2. There is a remainder, the number
2, in the equation.
We show this as 8 + 42.

9
Cryptography and Network Security B.Tech(CSE) III Year II Sem
Examples: The integer 4 divides the integer 32 because 32 = 8 x 4.
We show this is as 4 | 32
The number 8 does not divide the number 42 because 42 = 5 x 8 + 2. There is a remainder, the number
2, in the equation.
We show this as 8 + 42.
Examples:
1) Since 3 | 15 and 15 | 45, according to third property, 3 | 45
2) Since 3 | 15 and 3 | 9, according to the fourth property, 3 |(15 x 2 + 9 x 4), which means 3 | 66.

Greatest Common Divisor(GCD)


The greatest common divisor of two positive integers is the largest integer that can divide both integers we
can write the relationship as a + n.
Examples: GCD of 15 and 20 is 2 because divisors of 15 are 3,5 and divisors of 20 are 2,4,5,10. The
GCD is 5
Euclidean Algorithm:
Euclidean algorithm is used to finding the greatest common divisor (gcd) of two positive integers.
The Euclidean algorithm is based on the following two facts
Fact 1: gcd ( a, 0 ) = a
Fact 2: gcd ( a, b ) = gcd ( b , r ), where r is the remainder of dividing a by b
When gcd ( a, b ) = 1, we say that a and b are relatively prime.

Example: gcd ( 36, 10 ) = ?

Example: gcd (2740,1760) = ?


Solution: we initialize r1 to 2740 and r2 to 1760
Answer:
gcd ( 2740, 1760 ) = 20
.

10
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Extended Euclidean Algorithm


Given two integers a and b, we often need to find other two integers, s and t, such that

The Extended Euclidean Algorithm can calculate the gcd ( a, b) and at the same time calculate the
value if s and t.

11
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Example: Given a = 161 and b = 28,


Find gcd (a,b) and the values of s and t.
Solution:
r = r1 q x r2 , t = t1 q x t2 , s = s1 q x s2 , We use a table to follow the algorithm.

We get gcd (161,28) = 7, s=-1 and t = 6


Linear Diophantine Equations
An equation of type ax + by = c with variables is called as Linear Diophantine Equation.
The Extended Euclidean algorithm is used to find solutions to the Linear Diophantine Equations
This type of equation has either no solution or an infinite number of solutions. Let d = gcd(a,b).
if d + c, then the equation has no solution.
If d | c, then we have an infinite number of solutions. (one is particular and rest are general solutions).
Particular Solution: if d | c, a particular solution to the above equation can be found using the following
steps:
Reduce the equation to a1x + b1 y = c1 by dividing both sides of the equation by d. This is possible
because d divides a, b, and c by the assumption.
Solve for s and t in the relation a1s + b1t = 1 using the extended Euclidean algorithm.
The particular solution: x0 = (c/d)s and y0 = (c/d)t
General Solutions: after finding the particular solution, the general solutions can be found:
x = x0 + k (b/d) and
y = y0 k (a/d) where k is an integer

12
Cryptography and Network Security B.Tech(CSE) III Year II Sem
Example: Find the particular and general solutions to the equation
21x + 14y = 35.
Given equation, 21x+14y = 35 that is written as ax+by = c
a=21, b=14, c=35
d = gcd(a,b) = gcd(21,14) [ Apply Euclidean Algorithm ]
= gcd (14,7) 1.gcd(a,0) = a
= gcd (7,0)=7 2.gcd( a,b) =gcd(b,r)
so, d=7 where remainder
Note: if d | c i.e 7|35 (7 divides 35), so one is Particular solution
and infinity General solutions.
Particula Solution :-
21x+14y = 35
Divide both sides by 7 in , then
3x + 2y = 5
using Extended Euclidean Algorithm , find and
such as 3s+2t = 1 Ref. (s x a + t x b = gcd (a,b))
Find gcd (3, 2) where r1 is 3 and r2 is 2 using Extended Euclidean Algorithm
r = r1 - r2 x q , s= s1 - s2 x q , t= t1 - t2 x q

as per particular solutions


x0 = (c/d)s and y0 = (c/d)t
substitute values a=21,b=14 , c=35, d=7 for x0 and y0
x0 = (35/7)x 1= 5
y0 = (35/7)(-1)= - 5
General Solution:
x = x0 + k (b/d) and y = y0 k (a/d) where k is an integer
x = 5+k(14/7) ; y = -5-k(21/7)
x = 5+2k y = -5-3k
here is an integer ; then substitute k in above:
(5,-5), (7,-8),(9,-11),...............are solutions to given equation

Modular Arithmetic
The division relationship ( a = q x n + r ) has two inputs ( a and n ) and two outputs ( q and r ). In modular
arithmetic, we are focused in only one of the outputs, the remainder r.
Modulo Operator:
Modulo operator is shown as mod.
The second input (n) is called the modulus.
The output r is called the residue.
The below figure shows the division relation compared to the modulo operator

13
Cryptography and Network Security B.Tech(CSE) III Year II Sem

The modulo operator (mod) takes an integer (a) from the set Z and a positive modulus (n). The operator
creates a non-negative residue (r).
a mod n = r

- Example

SET OF RESIDUES: Zn
The result of the modulo operation with modulus is always an integer between 0 and n-1.
In other words (a mod n) is always a non negative integer less than n
Modulus operation creates a set, that is called set of least residues modulo n or Z n
We have one set of Z(integers), but we have infinite instances of the set o residues Zn for each n.

CONGRUENCE
If two numbers A and B have the property that their difference A-B is integrally divisible by a number C
(i.e., (A-B)/C is an integer), then A and B are said to be "congruent modulo C." The number C is called the
modulus , and the statement "A is congruent to B (modulo C)" is written mathematically as

14
Cryptography and Network Security B.Tech(CSE) III Year II Sem

A B ( mod C)
This says that A is congruent to B modulo

Example 2:
Assume, - 10) 10) 10) 10)

RESUDUE CLASSES
A residue class [a] is the set of integers congruent modulo n.
In other words it is the set of all integers such that x=a (mod n).
For example, if n=5, we have five sets [0], [1], [2], [3], [4] as shown below
[0]= {....., -15 -10 ,-5, 0, 5, 10,15,...}
[1]= {....., -16 -11 ,-6, 1, 6, 11,16,...}
[2]= {....., -17 -12 ,-7, 2, 7, 12,17,...}
[3]= {....., -18 -13 ,-8, 3, 8, 13,18,...}
[4]= {....., -19 -14 ,-9, 4, 9, 14,19,...}
From each set there is one lease residue that
0 in [0], 1 in [1], 2 in [2], 3 in[3] and 4 in [4]..
The set of these residues are shown as
Z5 ={0,1,2,3,4}

Applications:
We use a clock to measure time. Our clock system uses modulo 12 arithmetic. How ever instead of a 0 we
the 12
.

15
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Operations in Zn
The three Binary operations (addition, subtraction and multiplication) are defined for the set Z n.

16
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Example 2
Perform the following operation:
a. Add 17 to 27 in Z14
(17+27) mod 14 = (44) mod 14 = 2
b. Subtract 34 from 12 in Z13
(12-34) mod 13 = (-22) mod 13 = - 9 = (-9+13) = 4
c. Multiply 123 by -10 in Z20
(123*(-10)) mod 20 = (-1230) mod 20 = -10 =(-10+20) = 10

Property 1:
(a+b) mod n= [ (a mod n ) + (b mod n) ] mod n
(4+5) mod 2 = [ (4 mod 2) + ( 5 mod 2) ] mod 2
9 mod 2 = [0 + 1] mod 2
1 = 1
Property 2:
(a-b) mod n= [ (a mod n ) - (b mod n) ] mod n
(4 - 5) mod 2 = [ (4 mod 2) - ( 5 mod 2) ] mod 2
-1 mod 2 = [0 - 1] mod 2
-1 mod 2 = -1 mod 2

17
Cryptography and Network Security B.Tech(CSE) III Year II Sem
Property 3:
(axb) mod n= [ (a mod n ) x (b mod n) ] mod n (4 x 5) mod 2 = [ (4 mod 2) x ( 5 mod 2) ] mod 2 20
mod 2 = [0 x 1] mod 2
0 = 0 mod 2
0 = 0
INVERSES
When we are working in modular arithmetic, we need to find inverse of a number relative to an operation.
There are two types of inverses are used modular arithmetic.
Additive inverse (relative to an addition operation).
Multiplicative inverse (relative to a multiplication operation).

Note:In modular arithmetic, each integer has an additive inverse.


The sum of an integer and its additive inverse is congruent to 0 modulo n

It can be proved that has a multiplicative inverse in Zn iff gcd(n,a)=1. (In this case and n are said to
relatively prime.
Example 1: Find multiplicative inverse of 8 in Z10.

Example 2: Find all multiplicative inverses in Z10.

Example 3: Find all multiplicative inverses 23 in Z100.

18
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Addition and Multiplication Tables:


In addition table, each integer has an additive inverse. The inverse pairs can be found when the result of
addition is zero. In Figure 2.16, we have (0,0), (1,9), (2,8), (3,7), (4,6), and (5,5).
In multiplication table, the pairs can be found whenever the result of multiplication is 1. In Figure, we have
(1,1), (3,7) and (9,9).

Fig: Addition and multiplication tables in Z10


Note: We need to use Zn when additive inverses are needed; we need to use Z*n when multiplicative
inverses are needed.

Two more Sets:


Cryptography often uses two more sets: Zp and Z*p.

19
Cryptography and Network Security B.Tech(CSE) III Year II Sem

MATRICES
A matrix is a rectangular array of l x m elements; in which
l is the number of rows and
m is the number of columns.
A matrix is normally denoted with an Uppercase Letter such as A.
The element aij is located in the ith row and jth column.

DIFFERENT TYPES OF MATRICES

OPERATIONS AND RELATIONS


Relation operation:
Equality:
If two matrices are equal sizde and content is same then they have equality
Four operations:
1. Addition
2. Subtraction
3. Multiplication
4. Scalar multiplication

Examples:
Addition : CIJ=AIJ+ BIJ

20
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Subtraction: : CIJ=AIJ - BIJ

Multiplication

Examples:

21
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Multiplication unit matrix with normal matrix gives the same matrix
AXI=IXA=A

DETERMINANT
If A is square matrix of mxm then determinant of A is det(A)

Where Aij is a matrix obtained from A by deleting the ith row and jth column.
Determinant is obtained for only square matrices
Det(2x2) matrix

Example : det(3x3) matrix

22
Cryptography and Network Security B.Tech(CSE) III Year II Sem

MATRICES-Inverses
Additive Inverse
The additive inverse of the matrix A is another matrix B such that A+B=0.
In other words bij=-aij
Generally additive inverse is of A=-A
Multiplicative Inverse:
The multiplicative Inverse of a square matrix A is a B such that A X B = I.
Normally Multiplicative inverse of A is defined by A-1
Multiplicative inverse is defined for only square matrices

Residue Matrices

23
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Example : Find A-1 modulo value -


Problem:

Solution:

24
Cryptography and Network Security B.Tech(CSE) III Year II Sem

Linear Congruence
Single variable Linear Equations:
Equations of the form ax b (mod n) might have no solution or a limited number of solutions
Assume that the gcd(a,n) = d.
If d + b (d not divides b), there is no solution.
If d | b (d divides b), there are d solutions.
If d | b, we use the following strategy to find the solutions:
Reduce the equation by dividing both sides of the equation (including the modulus) by d.
Multiply both sides of the reduced equation by the multiplicative inverse find the particular
solution x0.
The General solutions are x = x0 + k ( n / d ) for k = 0, 1, 2, , (d-1).
Congruence-Example
Example 1: Solve the equation
10 x = 2( mod 15).
Solution :-
15)
In basic form
a = 10 ; b = 2; n= 15
Now, find d = ?
d = gcd(a,n)= gcd (10,15)
= gcd (15,10) = gcd (10,5)
= gcd (5,0)
=5
check if d+b (d not divides b), then no solution

equation has No solution.


Example 2: Solve the equation
14 x= 12 (mod 18)
Solution :- Given Linear equation

a = 14 ; b = 12; n= 18
d = gcd(a,n)= gcd (14,18) = gcd (18,14)
= gcd (14,4) = gcd (4,2)=gcd(2,0)=2
check, d b or d+ b
d |b 2 | 12 means 2 divides so the given equation have

25
Cryptography and Network Security B.Tech(CSE) III Year II Sem
Given equation 14 x 12 (mod 18)
divides on both sides of equation
7x 6 (mod 9)
multiply 7 -1 on both sides of above to get particular solution 0
7 -1 x 7 * x0 6 * 7 -1 (mod 9)
x0 6x 7 -1 (mod 9) i.e 7-1 mod 9 4
x0 6 x 4 (mod 9)
x0 mod 9
x0 6
solutions are x = x0 + k (n/d) where k = 0,1
( d = 2)
if k = 0 x = x0 + 0 (n/ d)
x = 6+ 0 ( 18/2) = 6
x=6
if k = 1 x = x0 +1 ((n/ d) = 6+1 ( 18/2)
x = 15
and are solution to 14 x 12 (mod 18)

Set of Linear Equations:


Solve the set of linear equations with same modulus by forming three matrices using coefficients.
Matrix 1: square matrix made from coefficients
Matrix 2: Column matrix made from variables
Matrix 3: Column matrix made from values at right side of equations
Consider the matrix as

Example
Solve the following sets of Linear equations?
3x + 2y 5 ( mod 7 )
4x + 6y 4 ( mod 7 )

26
Cryptography and Network Security B.Tech(CSE) III Year II Sem

LINEAR DIOPHANTINE EQUATION


The equation of the form ax +by = c is called as Linear Diophantine Equation.
Example: 19x +13y = 20
We can solve the above equation using following steps:
Step1: check whether it has solution or not.
Perform gcd(a,b) and if gcd(a,b) divides c then it has solution
Step 2: Use Euclidian Algorithm and reverse Euclidian algorithms to find the Particular solution.. x 0, y0
Step3: Find general solution
x=x0+b.n where n is any integer
y=y0-a.n
Example 1:-
Find particular and General solutions to the following Linear Diophantine Equation:
25x+10y=15
Solution:
a=25, b=10 and c=15
Check whether we have solution or not by calculating GCD(25,10) using Euclidian Algorithm:
gcd(25,10)=gcd(10,5)=gcd(5,0)=5
since gcd(25,10)=5 that divides the 15, we have solutions.
Reverse Euclidian Algorithm is:
25 = 2 x 10 + 5 ----------Eq1
10 = 2 x 5 + 0
Since gcd is 5 , rewrite the Eq1 from write to left:
5= 25 2 x10
5= 1x25 2x10 (1x25 2x10 is similar to 25x + 10y)
Multiply both sides by 3 since in the given equation right hand side is 15
3x5=3(1x25)-3(2x10)
15 = 3 x 25 6 x 10 then it can be rewrite as
25x3 10x6 = 15
The above is similar to
25x + 10y = 15
So, the particular solution is
x0 = 3 and y0 = -6
Substitute the x0 and y0 in the above 25x0 + 10y0 = 25x3+10(-6)=75-60=15
Now, find General solution:

27
Cryptography and Network Security B.Tech(CSE) III Year II Sem
x=x0+b.n (where n is any integer and a=25, b=10)
y=y0-a.n
if n=1, then
x=3+10x1=13
y=-6-25x1=-31
Substitute the x and y in the given equation to check result:
25x + 10y = 25x13+10(-31)=325-310=15
if n= -1, then
x=3+10x(-1)=3-10= -7
y=-6-25x(-1)= -6 +25 = 19
Substitute the x and y in the given equation to check result:
25x + 10y = 25x(-7)+10(19)=-175+190=15
Finally, the x,y pairs are (-7,19), (3,-6), (13,-
Example 2:
Find particular and General solutions to the following Linear Diophantine Equation:
19x+13y=20
Solution:
A=19, b=13 and c=20
Check whether we have solution or not by calculating GCD(19,13) using Euclidian Algorithm:
gcd(19,13)=gcd(13,6)=gcd(6,1)=gcd(1,0)=1
since gcd(19,13)=1 that divides the 20, we have solutions.
Reverse of Euclidian Algorithm is :
19= 1 x13+ 6 -------------- (Eq 1)
13= 2 x 6 + 1 -------------- (Eq 2)
6 = 6x1 + 0
So, gcd(19,13) is 1.
Rewrite the Eq 2 from write to left:
1 = 13 2 x 6 ------------- (Eq 3)
Rewrite the Eq 1 from write to left:
6 = 19 1 x13-------------- (Eq 4)
Substitute the 6 equivalent in Eq 4 that is 19-1x13 in Eq 3
1= 13- 2 x (19-1x13)
1= 13-2x19 + 2 x13
1= 1x13-2x19 + 2 x13
1= 3x13-2x19
Multiply both sides by 20 since in the given equation right hand side is 20
20x1=60x13-40x19)
20 = 13x60 19 x 40 then it can be rewrite as
This can be rewrite as similar to the given equation 19x+13y=20
13x60-19x40 = 20
-19x40 + 13x 60 =20
19x(-40)+13x60=20
So, the particular solution is
x0 = -40 and y0 = 60
Substitute the x0 and y0 in the given equation to check the result
19x+13y = 19(-40) + 13x60 = -760+780 = 20
Now, find General solution:
x=x0+b.n (where n is any integer and a=19, b=13)
y=y0-a.n
if n=1, then

28
Cryptography and Network Security B.Tech(CSE) III Year II Sem
x=-40+13x1=-40+13= -27
y=60 19x1=41
Substitute the x and y in the given equation to check result:
19x + 13y = 19(-27)+13(41)=-513+533=20
if n= -1, then
x=-40+13x(-1)=-40-13= -53
y=60-19x(-1)= 60+19 = 79
Substitute the x and y in the given equation to check result:
19x + 13y = 19x(-53)+13(79)=-1007+1027=20
Finally, the x,y pairs are (-40,60), (-27,41), (-

29
Cryptography and Network Security B.Tech(CSE) III Year II Sem

UNIT -II
Symmetric Encryption
Mathematics of Symmetric Key Cryptography, Introduction to Modern Symmetric Key Ciphers,
Data Encryption Standard, Advanced Encryption Standard.

Mathematics of Symmetric Key Cryptography:

Cryptography ?
Cryptography is a technique of securing information and communications through use of codes. Thus

Cryptography Types
1) Symmetric Key Cryptography:
The sender and receiver of message use a single common key to encrypt and decrypt messages.
2) Asymmetric Key Cryptography:
A pair of keys is used to encrypt and decrypt information. A public key is used for encryption and a private
key is used for decryption. Even if the public key is known by everyone the intended receiver can only
decode it because he alone knows the private key.
3) Hash Functions:
There is no usage of any key in this algorithm. A hash value with fixed length is calculated as per the
plain text which makes it impossible for contents of plain text to be recovered..

Mathematics of Symmetric Key Cryptography


Algebraic Structures:
Cryptography requires set of integers and specific operations that are defined for those sets. The
combination of the set and the operations that are applied to the elements of the set is called an algebraic
structure.

1. Groups
A Group (G) is a set elements with a binary operation usually Addition or multiplication that satisfies
four properties(Axioms).
A Commutative Group, also called an abelian group, is a group in which the operator satisfies the four
properties for groups plus an extra property, commutativity.
Closure Property: if a and b are elements of G, then c = a b is also an element of G.
Associatively Property: if a, b, and c are elements of then ( a b ) c = a ( b c ).
Existence of Identity Property: For all a in G, there exists an element e, called the identity element,
such that e a=a e=a

30

You might also like