CNS Unit 3
CNS Unit 3
CNS Unit 3
Number of Round
keys = Nr+1
Temporary word t
ti = subword(Rotword(wi-1 )) ⊕Rcon i/4
= AC20177D ⊕ 01 00 00 00 AD20177D
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 47
Key Expansion –AES 192 and AES 256
Public
key
77
Knapsack Cryptosystem
Assume that a=[3, 7, 12, 30, 60,115] and s = 82 .
Find tuple x using inv_knapsack sum.
X = [1,1,1,0,1,0]
78
Knapsack Cryptosystem
Secret Communication Process with Knapsack Cryptosystem
i.Key Generation at Receiver End
ii.Encryption at Sender End
iii.Decryption at Receiver End
• Private key is d
Let e = 7
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 100
Introduction
Key Generation
Let e = 7
• Choose two large prime numbers (p and q)
• Calculate n = p*q and d e mod Φ(n) = 1
(1 * 7 ) mod 20 = 7
Φ(n) = (p-1)(q-1) (2 * 7 ) mod 20 = 14
• Choose a number e , where 1 < e < Φ(n) (3 * 7 ) mod 20 = 1
e is coprime to Φ(n), gcd(e, Φ(n)) =1
d=3
• Calculate d = e-1mod n, or de mod Φ(n) =1
• Public key pair as (e,n) Public key is (e, n) => (7, 33)
d 4 16384 16
o 15 170859375 27
g 7 823543 28
16 4096 4 D
27 19863 15 O
28 21952 7 G
(A) 11
(B) 13
(C) 16
(D) 17
Eve Intercept C
Choose X random integer
Receiver
Construct New Cipher Y = C X e mod n
Z = Y d mod N Z = Y d mod n
= (C X e )d mod n
= Cd X e d mod n
= Cd X mod n
Z = P X mod n
P = Z X-1 mod n
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 125
Attacks on RSA
Encryption exponent
Common attack occur when e is low, so use e= 216 +1 = 65537.
• Coppersmith attack
• Broadcast attack
• Related Message attack
• Short pad attack
C1 M r1(padding)
C2 M r2(padding)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 130
Attacks on RSA
Attacks on Decryption key:
Revealed decryption exponent attack:
If attacker somehow guess decryption key d, cipher text generated by
encryption key is in danger, and even future messages are also in danger.
So, it is advised to take fresh values of two prime numbers (i.e; P and Q), N
and E.
Low decryption exponent attack:
If we take smaller value of d in RSA this may occur, so to avoid take value of
d = 216+1(atleast).
6. Bob takes four possible answers, (a1, b1), (a1, b2), (a2, b1), and (a2, b2), and
uses the Chinese remainder theorem to find four possible plaintexts:
116, 24, 137, and 45.
Note that only the second answer is Alice’s plaintext.
10.160
RABIN CRYPTOSYSTEM
6. Bob takes four possible answers, (a1, b1) uses the Chinese remainder
theorem
a1 = 1 mod 23
b1 = 4 mod 7
X = [1 * 7 ( 7 -1 mod 23 ) + 4 * 23 ( 23 -1 mod 7 ) ] mod 161
= [1 *7 ( 10 ) + 4 *23 ( 4) ]
= [70 + 368 ] mod 161
= 116
10.161
RABIN CRYPTOSYSTEM
6. Bob takes four possible answers, (a1, b2) uses the Chinese remainder
theorem
a1 = 1 mod 23
b1 = 3 mod 7
X = [1 * 7 ( 7 -1 mod 23 ) + 3 * 23 ( 23 -1 mod 7 ) ] mod 161
= [1 *7 ( 10 ) + 3 *23 ( 4) ]
= [70 + 276 ] mod 161
= 24
10.162
RABIN CRYPTOSYSTEM
6. Bob takes four possible answers, (a1, b1), (a1, b2), (a2, b1), and (a2, b2), and
uses the Chinese remainder theorem to find four possible plaintexts:
116, 24, 137, and 45.
10.163
Security of the RABIN
CRYPTOSYSTEM
• The Rabin system is secure as long as p and q are large
numbers.
• The complexity of the Rabin system is at the same level as
factoring a large number n into its two prime factors p and q.
(Rabin system is as secure as RSA)
= 6 * (125) -1 mod 11
=
6 * 3 mod 11
=
18 mod 11
=
7