Docsity

ADVANCED CRYPTOGRAPHY, Lecture notes of Cryptography and System Security

Partial preview of the text

Download ADVANCED CRYPTOGRAPHY and more Lecture notes Cryptography and System Security in PDF only on Docsity!

CRYPTOGRAPHY AND NETWORK

SECURITY

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

Unit VI: Network Security-II Page 145

SECURITY GOALS Accessing of data by unauthorized entity is called as attack Passive Attacks Active Attacks Passive Attacks: In a passive attack, the attacker’s 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–  can’t read the information, but observe the pattern  determine the location and identity of communicating parties  observe frequency and length of communication Cryptographic Attacks

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.

 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
  • Data Integrity: A variety of mechanisms used to assure the integrity of a data unit or stream of dataunits.
  • Digital Signature: A digital signature is a means by which the sender can electronically sign the dataand 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.

 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 relativelyprime. Example: gcd ( 36, 10 ) =? Example: gcd (2740,1760) =? Solution: we initialize r 1 to 2740 and r 2 to 1760 Answer: gcd ( 2740, 1760 ) = 20 .

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.

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= 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 ’r’ 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 “s” and “t” 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= s 1 - s2 x q , t= t1 - t2 x q as per particular solutions x 0 = (c/d)s and y 0 = (c/d)t substitute values a=21,b=14 , c=35, d=7 for x 0 and y 0 x 0 = (35/7)x 1= 5 y 0 = (35/7)(-1)= - 5 General Solution: x = x 0 + k (b/d) and y = y 0 – 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 “k” is an integer ; k=0,1,2,3,4… 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

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 ‘n’ 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 Zn 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

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

Example 2 Perform the following operation: a. Add 17 to 27 in Z 14 (17+27) mod 14 = (44) mod 14 = 2 b. Subtract 34 from 12 in Z 13 (12-34) mod 13 = (-22) mod 13 = - 9 = (-9+13) = 4 c. Multiply 123 by - 10 in Z 20 (123*(- 1 0)) 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

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 Z 10 Note: We need to use Zn when additive inverses are needed; we need to use Zn when multiplicative inverses are needed. Two more Sets: Cryptography often uses two more sets: Zp and Zp. Addition and Multiplication Tables:

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