Presentation is loading. Please wait.

Presentation is loading. Please wait.

Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on.

Similar presentations


Presentation on theme: "Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on."— Presentation transcript:

1 Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on chapters 1-2 (next slide) Computer quiz next week on breaking codes from chapter 2 Computer quiz next week on breaking codes from chapter 2Questions?Today: Finish Modular Exponents example Finish Modular Exponents example Fermat’s little theorem Fermat’s little theorem Euler’s theorem Euler’s theorem DTTF/NB479: DszquphsbqizDay 11

2 Tomorrow’s Quiz Rules: Written problems Written problems Closed book and computer Closed book and computer You may bring a note sheet: 1 handwritten sheet of 8.5 x 11 paper, one side only. You may bring a note sheet: 1 handwritten sheet of 8.5 x 11 paper, one side only.Content: Concepts of the algorithms we discussed, how they work, how you can break them using various attacks Concepts of the algorithms we discussed, how they work, how you can break them using various attacks Inverses of integers and matrices (mod n) Inverses of integers and matrices (mod n) Working out some examples by hand, like 5 -1 mod (7) Working out some examples by hand, like 5 -1 mod (7) Anything else from ch 1-2, but nothing that will require a computer. Anything else from ch 1-2, but nothing that will require a computer.

3 Modular Exponentiation Compute 3^2000 (mod 152) Technique: Repeatedly square 3, but take mod at each step. Repeatedly square 3, but take mod at each step. Then multiply the terms you need to get the desired power. Then multiply the terms you need to get the desired power. Matlab’s powermod() (All congruences are mod 152)

4 Is there an easier way to compute 3 2000 (mod 152)? Consider first a similar example, 3 2000 (mod 17) (chosen so p is prime). Today’s theorems will be really important when dealing with RSA encryption – pay careful attention!

5 Fermat’s Little Theorem if p is prime and doesn’t divide a. Examples: 2 2 (mod 3), 4 4 (mod ???) So what’s (3 2002 )(mod 17)?

6 Converse when a=2 If p is prime and doesn’t divide a, Converse: If, p is prime and doesn’t divide a. This is almost always true when a = 2. Rare counterexamples: n = 561 =3*11*17, but n = 561 =3*11*17, but n = 1729 = 7*13*19 n = 1729 = 7*13*19 Can do first one by hand if use Fermat and combine results with Chinese Remainder Theorem Can do first one by hand if use Fermat and combine results with Chinese Remainder Theorem

7 Using Fermat within a primality testing scheme Even? div by other small primes? Prime by Factoring/ advanced techn.? n no yes prime

8 Using Fermat within a primality testing scheme (ch 6) Use Fermat as a filter since it’s faster than factoring (if calculated using the powermod method). Odd? div by other small primes? Prime by Factoring/ advanced techn.? n no yes prime Fermat: p prime  2 p-1 = 1 (mod p) Contrapositive? Why can’t we just compute 2 n-1 (mod n) Using Fermat if it’s so much faster?

9 Euler’s Theorem Analog to Fermat for composite modulus What’s  (n)?  (n) = the number of integers a, s.t., 1<= a <= n where gcd(a,n) = 1. Ex:  (10) = 4. What’s  (p) for p prime? What about  (n), where n =pq (a product of 2 primes)

10 Euler’s  -function Notes: The p are taken from the set of distinct primes that divide n Eg, for n=60, use p = 2 (only once), 3, and 5. Answer:  Answer:  When we compute the ratios, what about mutual exclusion? Consider the intuition: Crossing out every number divisible by 3 leaves 2/3 of them. Crossing out every number divisible by 3 leaves 2/3 of them. If I crossed out the even numbers first, then crossing out every odd number divisible by 3 still leaves 2/3 of those left! If I crossed out the even numbers first, then crossing out every odd number divisible by 3 still leaves 2/3 of those left! *Thanks to Bill Waite for this good insight

11 Back to Euler’s Theorem As long as gcd(a,n,) = 1 Examples: Find last 3 digits of 7 803 Find last 3 digits of 7 803 Find 3 2007 (mod 12) Find 3 2007 (mod 12) Find 2 43210 (mod 101) Find 2 43210 (mod 101) Basic Principle: when working mod n, view the exponents mod  (n).


Download ppt "Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on."

Similar presentations


Ads by Google