MATH 470 Lecture 15

From Notes
Jump to navigation Jump to search

« previous | Tuesday, March 5, 2013 | next »


Midterm

Midterm Thursday after Spring Break

Material is anything up to today.

Practice midterm available on web page

Review

  • Powering mod n is easy but slow.
  • Computing square roots mod prime p is easy-ish
  • Computing square roots mod any integer n is hard: in fact, deciding whether a[1,b] is NP-Complete
  • Deciding existence of square roots mod p can be done by powering, but is faster via quadratic reciprocity of Jacobi symbols
  • Factoring appears hard, but is easy if computing square roots mod n is easy.

El Gamal

  • Large prime p, with p1 having at least one huge prime factor
  • Generator α for (/p)*
  • Number a[2,2]
  • β=αa(modp)

(p,α,β) are public, recipient holds a secret.

to transmit a message m(/p)*, the sender computes a random k[2,p2], αk, and βk; and then sends (αk,βkm)(modp)

To decode, the recipient computes βkm(αk)a=2nd1st(modp)

Questions:

  1. How does this hide m? (βk appears random, and multiplication by it scrambles m)
  2. why does decryption work? βkm(αk)a=βkm(αa)k=βkmβk=m(modp)


Crypytanalysis

Most obvious: find a.

Finding a involves solving αaβ(modp) for a. This involves solving the discrete log problem, which is appears to be hard

Example

  • p=1009
  • α=101 (i.e. {α1,,α1008}={1,,1008})
  • m=559
  • pick k=291 at random and transmit (αk,βkm)=(421,661)

Pohlig-Hellman

Recall:

  • If β is a square mod p, then (βp)βp121(modp).
  • If β is a non-square mod p, then (βp)βp121(modp).

So if β=αa, we see that

  • when a is even, then βp121(modp)
  • when a is odd, then βp121(modp)

That is, you can tell the parity of a (the last base-2 digit).

Example

p=211, α=2, a=?, and β=5

Notice that p1=210=2357. This would be a bad choice.

Note: Fermat primes are of the form 2n+1


We want to find a with 2a5(mod211). Is a odd or even? (check Legendre symbol)

5p1251051(mod211)

So a is even and a0(mod2).


Now we want to find a(mod3)

5p135702(p12)a0

Where a0[0,2] is the last digit mod 3.

We find 5701(270)a0(15)a0, so a0 must be 0.

So a0(mod3)


Now we want to find a(mod5)

5p15(αa)p15(αp15)0a2(p15)a0

a0[0,4], and by brute force, a0=2.

So a2(mod5)


Yada yada, a6(mod7)


The Chinese Remainder Theorem states that we have a unique a such that it is equivalent to (0,0,2,6) mod (2,3,5,7), respectively.

  • Combine a0(mod2) and a0(mod3) to get a0(mod6)
  • Combine that with a6(mod7) to get a6(mod42)
  • Combine that with a2(mod5) to get a132(mod211).

And indeed, a=132, and 21325(mod211)

Note: Pohlig Hellman also handles base qk