SlideServe
Menu
Préférences
© SlideServe · v2026

DTTF/NB479: Dszquphsbqiz Day 9

Faraday avatar
16 diapositives · 405 Views · May 10, 2013

DTTF/NB479: Dszquphsbqiz Day 9. Announcements: Homework 2 due now Computer quiz Thursday on chapter 2 Questions? Today: Finish congruences Fermat’s little theorem Euler’s theorem Important for RSA public key crypto – pay careful attention!.

DTTF/NB479: Dszquphsbqiz 		 Day 9 - slide 1
01 / 16DTTF/NB479: Dszquphsbqiz Day 9
1 / 17

Télécharger la présentation

DTTF/NB479: Dszquphsbqiz Day 9
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. DTTF/NB479: Dszquphsbqiz Day 9 • Announcements: • Homework 2 due now • Computer quiz Thursday on chapter 2 • Questions? • Today: • Finish congruences • Fermat’s little theorem • Euler’s theorem • Important for RSA public key crypto – pay careful attention!

  2. The Chinese Remainder Theorem establishes an equivalence • A single congruence mod a composite number is equivalent to a system of congruences mod its factors • Two-factor form • Given gcd(m,n)=1. For integers a and b, there exists exactly 1 solution (mod mn) to the system:

  3. CRT Equivalences let us use systems of congruences to solve problems • Solve the system: • How many solutions? • Find them.

  4. The Chinese Remainder Theorem also applies generally to n factors • Let m1, m2,… mk be integers such that gcd(mi, mj)=1 when i ≠ j. For integers a1, … ak, there exists exactly 1 solution (mod m1m2…mk) to the system:

  5. Q Modular Exponentiation is extremely efficient since the partial results are always small • Compute the last digit of 32000 • Compute 32000 (mod 19) Idea: • Get the powers of 3 by repeatedly squaring 3, BUT taking mod at each step.

  6. Modular Exponentiation Technique and Example (All congruences are mod 19) • Compute 32000(mod 19) • Technique: • Repeatedly square 3, but take mod at each step. • Then multiply the terms you need to get the desired power. • Book’s powermod()

  7. Modular Exponentiation Example • Compute 32000(mod 152)

  8. 1-2 Fermat’s Little Theorem:If p is prime and gcd(a,p)=1, then a(p-1)≡1(mod p)

  9. 1-2 Fermat’s Little Theorem:If p is prime and gcd(a,p)=1, then a(p-1)≡1(mod p) Examples: 22=1(mod 3) 64 =1(mod ???) (32000)(mod 19) 1 2 3 4 5 6 S= Example: a=2, p=7 f(1)=2 f(2)=4 f(3)=6 f(4)=1 f(5)=3f(6)=5

  10. The converse when a=2 usually holds • Fermat: If p is prime and doesn’t divide a, • Converse: • If , then 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 = 1729 = 7*13*19 • Can do first one by hand if use Fermat and combine results with Chinese Remainder Theorem

  11. Primality testing schemes typically use the contrapositive of Fermat n Even? no div by other small primes? no Prime by Factoring/advanced techn.? yes prime

  12. 3 Primality testing schemes typically use the contrapositive of Fermat n Use Fermat as a filter since it’s faster than factoring (if calculated using the powermod method). Even? no div by other small primes? no yes Fermat: p prime 2p-1 ≡ 1 (mod p) Contrapositive? Prime by Factoring/advanced techn.? Why can’t we just compute 2n-1(mod n) using Fermat if it’s so much faster? yes prime

  13. 4 If gcd(a,n)=1, then So what’s f(n)? Euler’s Theorem is like Fermat’s, but for composite moduli

  14. 5 f(n) is the number of integers a, such that 1 ≤ a ≤ n and gcd(a,n) = 1. Examples: f(10) = 4. When p is prime, f(p) = ____ When n =pq(product of 2 primes), f(n) = ____ 14

  15. 6 The general formula for f(n) Example: f(12)=4 p are distinct primes [Intuition from Bill Waite, RHIT 2007]

  16. 7-10 Euler’s Theorem can also lead to computations that are more efficient than modular exponentiation as long as gcd(a,n) = 1 Examples: • Find last 3 digits of 7803 • Find 32007 (mod 12) • Find 26004 (mod 99) • Find 26004 (mod 101) BasicPrinciple: when working mod n, view the exponents mod f(n).