CNS - Unit-2
CNS - Unit-2
Dr.T.Venket Babu,
Assistant Professor, Slot : S10 & S2
Department of CSE.
Course Outcomes
Level of learning
CO
Course Outcomes domain (Based on
Nos.
revised Bloom’s)
Understand the encryption and decryption techniques using
CO1 K2
block ciphers.
PO PO PO PO PO PO PO PO
COs PO9 PO10 PO11 PO12 PSO 1 PSO 2 PSO 3
1 2 3 4 5 6 7 8
CO1 3 3 2
CO2 3 2 3 2 3
CO3 3 2 3 2 2
CO4 2 1 2 3
CO5 2 3 2 2
If P is the set of all prime numbers, then any positive integer a can
be written uniquely in the following form.
The right-hand side is the product over all possible prime numbers
p; for any particular value of a, most of the exponents ap will be 0.
10/4/2024 Dr.T.Venket Babu, AP/CSE, Vel Tech 10
Prime Factors
Multiplication of two numbers is equivalent to adding the
corresponding exponents.
Q A B R T1 T2 T
1 5 3 2 0 1 -1
1 3 2 1 1 -1 2
2 2 1 0 -1 2 -5
X 1 0 X 2 -5 X
Q A B R T1 T2 T
1 13 11 2 0 1 -1
5 11 2 1 1 -1 6
2 2 1 0 -1 6 -13
X 1 0 X 6 -13 X
2 26 11 4 0 1 -2
2 11 4 3 1 -2 5
1 4 3 1 -2 5 -7
3 3 1 0 5 -7 26
X 1 0 X -7 -26 X
10/4/2024 Dr.T.Venket Babu, AP/CSE, Vel Tech 19
2.Fermat’s Theorem
If p is a prime and a is a positive integer with p ∤ a , then
ap−1≡1(mod p).
if a = 2 and p = 7, then 27 = 128, and 128 − 2 = 126 = 7 × 18 is
an integer multiple of 7.
Consider the set of positive integers less than p:{1,2,..., p-1} and
multiply each element by a modulo p, to get the set X = {a mod p,
2a mod p, . . . (p-1)a mod p}.
None of the elements of X is equal to zero because p does not divide
a.
No two of the integers in X are equal.
Assume that ja ≡ ka(mod p) where 1 <= j < k <= p-1. Because a is
relatively prime to p, we can eliminate a from both sides of the
equation resulting in: j ≡ k(mod p).
This last equality is impossible because j and k are both positive
integers less than p.
We know that the (p-1) elements of X are all positive integers, with
no two elements equal.Dr.T.Venket Babu, AP/CSE, Vel Tech
10/4/2024 20
Example for Fermat’s Theorem
Consider that the set of positive integers less that n is the set {1,...,
(pq-1)}.
The integers in this set that are not relatively prime to n are the set
{p,2 p,..., (q-1)p} and the set {q,2q,..., (p-1)q}
(n) = (pq-1)[(q-1)+(p-1)]
= pq(p+q)+1
= (p-1)(q-1)
X ≡ ±1 mod n
6 ≡ ±1 mod 7
Now, check for the obtained result, the given congruence equations:
23 ≡ 2 mod 3
23 ≡ 3 mod 5
23 ≡ 2 mod 7
2 3 5
1 2 3 (When differences are unique)
x = 15x1 + 10 x2 + 6 x3
1 / 2 2 / 3 3 / 5 must get these remainders
= 15 + 20 + 18
= 53 – 30 (Since LCM of prime modulli is 30)
x = 23.
7 9 11 99 = 7*14 + 1
1 2 3 (When differences are unique)
77 = 9*8 + 5
x = 99x1 + 77x2 + 63x3 5 = 5*4 = 20
1 / 7 2 / 9 3 / 11 must get these remainders
63 = 11*5 + 8
= 99 + 308 + 630
8 = 8*10 = 80
= 1037 – 693 (Since LCM of prime modulli is 693)
x = 344.
21 mod 5 2 mod 5 2
22 mod 5 4 mod 5 4
23 mod 5 8 mod 5 3
24 mod 5 16 mod 5 1