Professional Documents
Culture Documents
Cryptography and Network Security
Cryptography and Network Security
0Cryptography & Network Security
Q
Relatively prime numbers
‘Two integers a and b are relatively prime if gedl (a, 5) = 1
The integers a). 4) + @, are pair-wise rel
(a,a)=1
whenever 1 $i 0 and q is odd, then.x? mod p = 1 or x? = 1 (mod p).
(Que 8.14] Write the pseudocode for Miller-Rabin primality testing,
‘Test whether 61 is prime or not using the same Miller-Rabin tes
me algorithm with a run-time complexity of
nae
Pseudocode for Miller-Rabin primality testing:
Miller-Rabin(Biglateger n,int s) //return “true” or “false”
H/test whether nis prime }
Wf tt returns “false”, then n is not prime ;
fit returns “true”, then n is prime ;
with probability atleast 1-2 ** (-s).
11s is number of tests we want to perform on'n.
BigInteger a;
for (int i = 1 i <=; +44)
a= Random (2, n— 1);
if Witness (a, n) return false ;
)
return true:
)
Numerical ; We know that ifn is a prime,
a’-1=1modn
We use base (b) 2,
61-1= 15x 2?-4n=15,8=2,a=2
Initialization : b = 2 mod 6: 1 mod 61
sel, b= 11? mod 61 = - 1 mod 61 (prime)
Hence, 61 is a prime number.2-12D (1T-8em-7) Advanced Encryption Standard
imultaneous
i
Chinese remainder theorem : :
1. The Chinese Remainder Theorem (CRT) is used to solve a set of
congruent equations with one variable but different moduli, which are
relatively prime.
2. x =a, (mod m,)
x =a, (mod m,)
x=a, (mod m,)
‘The Chinese Remainder Theorem states that the above equations
have a unique solution if the moduli are relatively prime.
3. The solution to the set of equations follow these steps =
a. Find M=m, x my x..... x my. This is the common modulus.
vb. FindM,=M/m,M,=Mimy,. M,=Mim,.
c. Find the multiplicative inverse of M,, M, . . . My. Using the
corresponding moduli (m,, mg, .-» ™m,). Call these inverses as M,7,
Mz)... Mp.
The solution to the simultaneous equations is :
x= (a,xM,xM,1 +a, xM,xMz*+.. +a, xM, x M1) mod M
Numerical : Solving simultaneous congruence for X = 2 mod P for all P
< (3,5, 7)
X= 2mod P for all P ¢ (3,5, 7)
X=2mod3
X=2mod5
X=2mod7
Step 1: M=3x5x7=105
Step2: M, = 105/83 = 35
Mg = 108/
Mg= 105/7=15
Step3: My1= (85 xx) mod 2=1My
(21 xx) mod 2=1
uy ans nls al
= (2x35 x1
of x for the following sets 0
remainder theorem.
X=2mod7andX= 3
Chinese remainder theorem : Refer
‘Numerical:
X=2mod7
X=3mod9
= (10 + 42.+ 30) mod 105 = (142) mod 195.
mod 9.
4+2x21x1+2% 15 x 1) mg
ct
“| pefine the Chinese remainder theorem. Find the
¢ Congruence using the an
Nea
Q. 2.15, Page 2-12D, Unit.2
=H ‘mod 7
= 9?-? mod
7=9mod7=2
77} mod 9
a
= 700)-1 mod 9
=P! mod 9
= 7mod9
= 49 mod 9
=4
X= (ay xMyxMy* +0, x M, x My") mod 63
Xa (2x9x2
43x 7x 4)mod 63
X= 120mod 63
X=67
What do you understand by C
hinese Remainder
Theorem ? Solve the following congruent equations by Chinese
Remainder Theorem :
i Xz2mod3
ii, X=3mod52-14D (IT-Sem-7) Advanced Encryption Standard
Anewer |
Chinese remainder theorem : Refer Q. 2.15, Page 2-12D, Unit-2.
Numerical:
Step 1: Given
‘Thus, common modulus M = m, x my = 3x5=15
Step 2: Compute M,,M,
M,= 15 25
m= 18 =3
Step 3: Compute the multiplicative inverse of M, and M, in modulo ™m,
nd m, respectively
M,-1= (6 x x) mod
‘i
F M,-1= (8 xx) mod
Step 4: The solution to the simultaneous equation is as follows :
= (ay XM, x My} 43% My xM,~1)mod 15
= (2x 5x 243x3x 3) mod 15-47 mod 15=2
the Chinese Remainder Theorem with example.
Explain
How Chinese remainder theorem provide the security to online
information sharing transactions. _ [/AKTU(2018-19, Marks 10
oR
Explain Chinese remainder theorem with example.
(AR TUBOIETT, Man
Chinese remainder theorem : Refer Q. 2.15, Page 2-12D, Unit-2.
Security to online information sharing transaction :
1. Chinese remainder theorem enables end-to-end transport layer security
between WAP clients and servers located across the wired internet.
2. Ituses secret sharing, which consist of distributing a set of shares in the
form of congruence, among the group of people who all together can
recover that secret share.
Find the values of x for the following sets of Congruence
using the Chinese remainder theorem.
X= 2(mod 3)Cryptography & Network Socurity
X=1(mod4)
X= 3(mod5)
X= 2(mod 3)
15>? mod 4
= 154)-T mod 4
= 15'-!mod 4
12-* mod 5
= 1245-1 mod 5
12% mod 5
= 1728 mod 5
=3
X= (ay x My