You are on page 1of 43

Information Security

Chapter -2

Mr.Rajasekhar Boddu
Outline
• Model of Network Security
• Internet standard and RFCs
• Mathematical tool for cryptography
• To introduce prime numbers and their applications in cryptography.
• To discuss some primality test algorithms and their efficiencies.
• To discuss factorization algorithms and their applications in
cryptography.
• To describe the Chinese remainder theorem and its application.
A Model for Network Security
• A message is to be transferred from one party to another across some
sort of internet.
• The two parties, who are the principals in this transaction, must
cooperate for the exchange to take place.
• A logical information channel is established by defining a route
through the internet from source to destination and by the cooperative
use of communication protocols (e.g., TCP/IP) by the two principals.
Cont’d…
• All the techniques for providing security have two components:
• A security-related transformation on the information to be sent.
• Eg. Encryption, addition of a code used to verify the identity of the sender
• Some secret information shared by the two principals
• Eg. Encryption key
• A trusted third party may be needed to achieve secure transmission
• Eg. Distribute the secret information and arbitrate disputes between them
Cont’d…
Cont’d…
• As shown in general model above, there are four basic tasks in
designing a particular security service
i. Design an algorithm for performing the security-related transformation
ii. Generate the secret information to be used with the algorithm
iii. Develop methods for the distribution and sharing of the secret information
iv. Specify a protocol to be used by the two principals
Internet Standards and RFCs
• Protocol, which is synonymous with “rule.”
• Standards, which are agreed-upon rules
• Many of the security techniques and applications described so far have
been specified as standards.
• Various organizations have been involved in the development or
promotion of these standards.
• Internet standard is a thoroughly tested specification that is useful to
and adhered to by those who work with the Internet.
• It is a formalized regulation that must be followed.
Cont’d…
• A specification begins as an Internet draft.

• An Internet draft is a working document with no official status and a six-month lifetime.

• Who standardize the developed technology and publish?

• Three organizations in the Internet society(ISOC)

• Internet Architecture Board (IAB)

• Defining overall Internet architecture

• Providing guidance to IETF


Cont’d…

• Internet Engineering Task Force (IETF)

• Actual development of protocols and standards

• Internet Engineering Steering Group (IESG)

• Technical management of IETF activities and Internet standards

process(approval)
IETF procedure:
• Make a draft version of the document available as an Internet Draft,
which is placed in the IETF's "Internet Drafts" online directory.
• The document may remain as an Internet Draft for up to 6 months,
and interested parties may review and comment on the draft.
• The working-group may subsequently publish a revised version of the
draft as RFC (Request for Comment) which are the working notes of
the Internet research and development community.
• The IETF is responsible for publishing the RFCs, with approval of the
IESG.
The Standardization Process
• The decision of which RFCs become Internet standards is made by the
IESG, on the recommendation of the IETF.
• To become a standard, a specification must meet the following
criteria:
1. Be stable and well understood
2. Be technically competent
3. Have multiple, independent, and interoperable implementations with
substantial operational experience.
4. Enjoy significant public support .
5. Be recognizably useful in some or all parts of the Internet
Mathematical Tools for Cryptography:
Number theory
• Integer
• In integer we use a set and few operations
• Set of integer denoted by Z and contains all integer numbers(no fraction) -∞ to ∞
• Z={…-2,-1,0,1,2,…}

• Binary operation
• Takes two input and produce one output
• In cryptography ,We apply 3 binary operation on a set of integer
• Addition, subtraction and multiplication
• Each of this operation takes two inputs(a and b) and produce one output(c)
• The 2 inputs comes from set of integer and the output goes to set of integer
• NB: division doesn’t fit to this category. Because, it produce two output
Cont’d…
• Example
• Each input can be either +ve or -ve. So, we can have 4 cases for each
operations

Addition 5 + 9 = +14 (-5) + 9 = +4 5 +(- 9) = -4 -5 + (- 9) = -14

Subtraction 5 - 9 = -4 (-5 )- 9 = -14 5 - (- 9) = +14 -5 -(- 9) = +4

Multiplication 5*9 =45 -5*9 = -45 5*(-9) = -45 (-5)*(-9)=45


Prime numbers
• Positive integers are grouped in to 3

A prime is divisible only by itself and 1.

• Cryptography uses prime numbers extensively


Cont’d…
• Prime number is divisible only by 1 and itself
• The smallest prime is 2
• 1 is not prime. Because, prime must be divisible by two different
integers.
• They cannot be written as a product of other numbers
• eg. 2,3,5,7 are prime, 4,6,8,9,10 are not
• Prime numbers are central to number theory
Primes Under 2000
Cont’d…

 Example
Checking for Primeness(primality test )
Cont’d…
Prime Factorization
• To factor a number n is to write it as a product of other numbers:
n=a x b x c
• NB: factoring a number is relatively hard compared to multiplying the factors together to generate
the number

• The prime factorization of a number n when its written as a product of primes

eg. 91=7x13
3600=24x32x52
• It can be generalized as a = p1 a1 x p2 a2 x ... x pt at

• where p1 < p2 < ... pt are prime numbers and where each ai is a positive integer
Relatively Prime Numbers & GCD

• Two numbers a, b are relatively prime if have no common divisors apart from 1
eg. 8 & 15 are relatively prime since factors of 8 are 1,2,4,8 and
of 15 are 1,3,5,15 and 1 is the only common factor
• Conversely, we can determine the greatest common divisor by comparing their
prime factorizations and using least powers

eg. 300 = 22x31x52 18 = 21x32 hence

GCD(18,300)=21x31x50=6
Modular Arithmetic
• When we see clock, the 12th hour is replaced with 0
• 1,2,3,4,5,6,7,8,10,11,0,1,2,3,4,5,6,…
• This is how we count in modulo 12
• When we add 1 to 11 we get back to 0
• This is how modular arithmetic system works
• It is also possible to count backward to arrive at similar answer that
fits the limitation
• -5 is the same as 2 in modulo 7
• 1,2,3,4,5,6,0,1,2,3,4,5,6
Cont’d…
• The division r/ship a = qm + r takes 2 input and produce two output
• It can also be expressed as a = r mod m
• This binary operator is called modulo operator,
• m is called modulus
• r is called remainder /residue
• The easies way to find r is dividing a by m and extract the remainder
• Eg. 17/4 is 4 with remainder 1(17=4x4+1)
• usually chose smallest positive remainder as residue , 0 <= r <= m-1
• process is known as modulo reduction
• eg. -12 mod 7 = -5 mod 7 = 2 mod 7 = 9 mod 7
• You can do the reduction when the numbers are bigger than m
Cont’d…
• In n mod m
• When n >= m,
• To calculate the value of n mod m,
• when n is +ve, we remove as many multiple of m as possible until we left with
a number/answer between 0 and m-1, inclusive

• If n is -ve, we add as many multiple of m as needed to get the number/answer


between 0 and m-1, inclusive
• When n < m, and n >= 0
• r = n mod m = n
Exercise
• Find the result of the following operation
1. 34 mod 4
2. 19 mod 7
3. -23 mod 5
4. -78 mod 9
5. 6 mod 9
Residue class
Properties of modular arithmetic
Fermat’s theorem
p is a prime number, then for any integer a, the
• Fermat's little theorem states that if
number ap − a is an integer multiple of p.

• For example, if a = 2 and p = 7, then 2 7 = 128, and 128 − 2 = 126 = 7 × 18 is an integer multiple of 7.

• If a is not divisible by p, Fermat's little theorem is equivalent to the statement that ap − 1 − 1 is an


integer multiple of p, or in symbols:
for all a € Zp* = {1,2,3,…, p-1} ap-1 = 1 (mod p)
• For example, if a = 2 and p = 7, then 2 = 64, and 64 − 1 = 63 = 7 × 9 is thus a multiple of 7.
6

Z7* = {1,2,3, 4,5,6}


Exercise
• Find the least residue of the following numbers using Fermat’s little
theorem.
1. 216 in mod 17
2. 250 in mod 17
3. 4532 in mod 11
Fermat’s theorem
• This theorems plays important role in public-key
cryptography
• Fermat’s theorem states the following:
• If p is prime and a is any positive integer not
divisible by p ,then
ap-1 = 1 (mod p)
Proof: Consider the set of positive integers
less than p: {1,2,3…,p-1}
Multiply each element by a and mod p to get
x:{a mod p, 2a mod p,…, (p-1)a mod p}
a  2a  … (p-1)a = ap-1 (p-1)!  (p-1)! (mod p)
Cont’d…
• So, suppose p is a prime, and a is any integer not divisible by p. Now
consider the set of multiples of a up to (p-1)a:
• {a , 2a ,3a, … ,(p-1)a} and their remainders when divided by p:
• Eg. If a= 3 and p=7, multiple of a are {3,6,9,12,15,18} mod 7 of each:
{3,6,2,5,1,4}
• The fact that 0 doesn’t show up is because, we specified that a is not divisible
by p, and in that case none of a, 2a,…, (p-1)a will be divisible by p either, so
none of them have a remainder of 0.
• Take all those multiples of a and multiply them all together, and then take the
remainder mod p:
= a  2a 3a … (p-1)a = 1.2.3….p-1(modp) //ab(mod p)=(a mod p)(b mod p)
= ap-1 (p-1)!  (p-1)! (mod p)
ap-1 = 1 (mod p)
Euler Totient Function: φ(n)
• φ (n) = how many numbers are there between 1 and n-1 that are
relatively prime to n.
• φ(4) = 2 (1, 3 are relatively prime to 4)
• φ(5) = 4 (1, 2, 3, 4 are relatively prime to 5)
• φ (6) = 2 (1, 5 are relatively prime to 6)
• φ (7) = 6 (1, 2, 3, 4, 5, 6 are relatively prime to 7)
Cont’d…
• As you can see from φ (5) and φ(7), φ (n) will be n-1 whenever n is a
prime number.
• This implies that φ(n) will be easy to calculate when n has exactly two
different prime factors:
• φ (P * Q) = (P-1)*(Q-1), if P and Q are prime.
Euler's theorem
• States that if n and a are co-prime positive integers, then
aφ(n) = 1 (mod p)
• where φ(n) is Euler's totient function.
• The theorem may be used to easily reduce large powers modulo n
• Eg. Find the ones place decimal digit of 7222 i.e. 7222 mod 10,
• We know 7 and 10 are co-prime and φ(10) = 4.
the theorem tells us , 74 = 1(mod 7)
7222= 74x55+2 = (74)55 x72= 1x72= 49 = 9 (mod 10)
Cont’d…
• This theorem generalizes Fermat’s theorem and is an important key to
the RSA algorithm.
• If GCD(a, p) = 1, and a < p, then a φ(p) = 1(mod p).
• In other words, If a and p are relatively prime, with a being the
smaller integer, then when we multiply a with itself (p) times and
divide the result by p, the remainder will be 1.
• It also follows that a φ(p)+1 = a(mod p) so that p does not necessarily
need to be relatively prime to a.
Exercise
Cont’d…
Cont’d…
• Let’s test the theorem:
• Case-1 : a φ(p) = 1(mod p).
• If a = 5 and p = 6
• Then φ(6) = (2-1) * (3-1) = 2
• So, 5 φ(6) = 25 and 25 = 24+1 = 6*4+1=> 25 = 1(mod 6) OR 25 % 6 = 1
• Case -2: a φ(p)+1 = a(mod p)
• For a φ(p)+1 = a(mod p) , if a is 5 and p = 10.
• 5 φ(10)+1 = 54+1= 3125 = 5(mod 10)
The Chinese Remainder Theorem:
• In ancient China generals counted soldiers remaining after a battle by lining them up in
rows of different lengths and calculating the total from these remainders using what we
now call the Chinese Remainder Theorem.

• If a general had 1200 soldiers at the start of a battle and if at the end there were 3 left
over when they lined up 5 at a time, 3 left over when they lined up 6 at a time, 1 left
over when they lined up 7 at a time, and none left over when they lined 11 at a time,
how many soldiers survived the battle?

• p1: x=3 (mod 5)


• p2: x=3 (mod 6) To compute the required value, 5,6,7 and 11 should be relatively prime
• p3: x=1 (mod 7)
• p3: x=0 (mod 11)
Cont’d…
• X= x1C1N1 + x2C2N3 + …+ xnCnNn where ci and Ni are remainder and N/Ni
respectively
• N = 2,310

• X= x1*3*(462) + x2* 3*(385)+ x3*1*(330)


x = 1386x1 + 1155x2 + 330x3
=> 1386x1 = 3(mod 5) // x1 = 3
=> 1155x2 = 3(mod 6) // x2 = 1
=> 330x3 = 1(mod 7) // x3 = 1
Therefore x = 11,088 + 3,465 + 2,640 => 17,193 mod 2,310 => 1,023
Cont’d…
Check
1023 = 3(mod 5)
1023 = 3(mod 6)
1023 = 1(mod 7)
1023 = 0(mod 11)
Exercise
• An old woman goes to market and a horse steps on her basket and
crashes the eggs. The rider offers to pay for the damages and asks her
how many eggs she had brought. She does not remember the exact
number, but when she had taken them out two at a time, there was
one egg left. The same happened when she picked them out three,
four, five, and six at a time, but when she took them seven at a time
they came out even.

You might also like