14
Rachana Y. Patil 1 Modula Arithmetic

Rachana Y. Patil

  • Upload
    alexia

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

Modula Arithmetic. Rachana Y. Patil. Cryptographic Theory. Primality: Two nos are relatively prime if they have no factors common in them other than 1. i.e gcd(a,n) = 1 gcd (7, 78) = 1. Euclid’s Alorithm. What is gcd of 21 and 45??? gcd(a,b) = gcd(b, a mod b). Modular Arithmetic. - PowerPoint PPT Presentation

Citation preview

Page 1: Rachana Y. Patil

Rachana Y. Patil

1

Modula Arithmetic

Page 2: Rachana Y. Patil

Cryptographic Theory

• Primality:

• Two nos are relatively prime if they have no factors common in them other than 1.

i.e gcd(a,n) = 1 gcd (7, 78) = 1

Page 3: Rachana Y. Patil

Euclid’s Alorithm

• What is gcd of 21 and 45???

gcd(a,b) = gcd(b, a mod b)

Page 4: Rachana Y. Patil

Modular Arithmetic

• Says that 23 and 11 are equivalent ??????

• 23 mod 11 = 12• Or 23≡ 11 mod 12 …..

Page 5: Rachana Y. Patil

Cont…

• a ≡ b mod n if a = b + kn for some integer k.

• If a > 0 and 0 < b < n then b is the remainder of the division a/n.

Page 6: Rachana Y. Patil

Properties of Modulo operator

• a ≡ b mod n if n/a-b• a ≡ b mod n ═> b ≡ a mod n • a ≡ b mod n and b ≡ c mod n implies a ≡ c mod n

Page 7: Rachana Y. Patil

Modular Arithmetic

• (a mod n) + (b mod n) = ( a + b ) mod n• (a mod n) x (b mod n) = (a x b) mod n• (a + b) ≡ (a + c) mod n then b ≡ c mod n

Page 8: Rachana Y. Patil

Euler’s theorem

• Euler’s Toient function Ø(n)• Ø(n) is the set of +ve integers less than n and

relatively prime to n• n = 6 What is Ø(n) ????

• n = 7 Ø(n) = ????•

Page 9: Rachana Y. Patil

Euler’s theorem….cont

• For any prime no Ø(n) = n-1.• Suppose p and q are two prime nos.• For n=pq we have• Ø(n) = Ø(pq) = Ø(p) x Ø(q) = (p-1) x (q-1)• n=21 p=3 and q = 7 • Ø(21) = Ø(3) x Ø(7) = 2 x 6 = 12.

Page 10: Rachana Y. Patil

Fermat’s Theorem

• If p is prime and a is a +ve integer not divisible by p then

• a p-1 ≡ 1 (mod p) Let a = 3 and p = 5 a 5-1 = a 4 = 34 = 81 ≡ 1 (mod 5) proved…..

Page 11: Rachana Y. Patil

The Theorem

• For every a and n which are relatively prime • a Ø(n) ≡ 1 (mod n)• a = 3 n = 10• Ø(n) = Ø(10) = 1,3,7,9 = 4• a Ø(n) = 3 4 = 81 ≡ 1 (mod 10) hence proved

Page 12: Rachana Y. Patil

Modular Exponentiation

• xy mod n = xy mod ø(n) mod n

• if y = 1 mod ø(n) then xy mod n = x mod n

Page 13: Rachana Y. Patil

Modular exponentiation

• One way function used in cryptography• ax mod n

• Can u find x where ax = b mod n???

• That is the discrete logarithm problem• If 3x = 15 mod (17) find x…….

Page 14: Rachana Y. Patil

Discrete Logarithm problem

• Solution….easy enough• Solve 3x mod 15 = 17• x = 6• For large nos solving this is difficult!!!