MATH 470 Lecture 9

From Notes
Jump to navigation Jump to search

« previous | Tuesday, February 12, 2013 | next »


Review

  • method to apply fast square roots mod to factoring.
  • (much earlier) fast factoring implies fast computation of , which implies breaking RSA


Let be prime.

Proposition. A polynomial [1] of degree has at most roots in .

Corollary. A number in has at least th roots in for prime .

Proof. is a root of , which has degree .

We'll just focus on .


Can have 0 square roots mod 7? (yes, 6) Can have 1 square root mod 7? (yes, 0, and it's the only one. Any other would have ± that number)

Abelian Group

An Abelian Group is a set with a multiplication operation satisfying certain axioms:

  1. There is a multiplicative identity :
  2. Every has a multiplicative inverse:
  3. is associative
  4. is commutative

Examples:

  • with identity 0
  • with identity 1
  • with identity 0
  • with identity 1

Cyclic

An Abelian group is cyclic when it has a generator [2]

Example: is cyclic with generator 2 in that

Note: Finding generators is not trivial
Corollary

Theorem: is cyclic.

Corollary: Exactly half of the elements of (for odd prime )are squares. They are


Corollary Puzzle

How can we find a quadratic non-residue (not a square) mod 982741? (choose a prime less than )

Finding non-squares mod is easy with 50% success probability!

Working with Square Roots mod

Idea: work mod , then mod , then piece together with Chinese Remainder Theorem.

If and are the primes 107 and 127, and . What is/are ?

First, if you have , you must certainly have and .


For , :

, so it is a square, and since , it has two roots. They are:


For , :

, so it is a square and has two roots. They are:


Can we find an with the following?

Yes! There are four possible combinations of the above, and we can find all of them by the Chinese Remainder Theorem.

Wait, there are 4 square roots?

There are 4 roots (no more) because it has to simultaneously be a root of each of the prime factors. There are only four possibilities for

To find our square roots, it's helpful to know and with (Extended Euclidean Algorithm):

The Chinese Remainder Theorem says that

In summary, for ,

  • compute Legendre symbol
  • find


BUT for , you can compute square roots mod efficiently, but it looks like randomness is unavoidable.

Tonelli's Algorithm

Tonelli (1891)

Given any odd prime , you can find , should it exist, as follows:

  1. Find a non-square mod (call it ) (easy with 50% probability)
  2. Write in the form with odd (easy via binary search)
  3. let
  4. for from 2 to , do
  5. if , then
  6. end

Example

For , what is ?

  • , so square root exists
  • , so we have the nasty case
  1. Find a non-square: 42? non-square! (first guess!)
  2. 104729 - 1 = 104728 = 23 · 13091
  3. e = 0: , so try e = 2
  4. e = 2: ...
  5. ...

Binary Search


Final Note: A key to using RSA in practice is generating primes. How do we do this? (understand distribution of primes)


Footnotes

  1. Polynomials in one variable with coefficients in .
  2. a number whose powers produce every number in