10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

262 Chapter 6 SUBEXPONENTIAL FACTORING ALGORITHMS<br />

For example, take the case a =11andn = 15. We have a 2 ≡ 1(modn),<br />

and gcd(a − 1,n) = 5, a nontrivial factor of 15.<br />

Consider the following three simple tasks: Find a factor of an even number,<br />

factor nontrivial powers, compute gcd’s. The first task needs no comment! The<br />

second can be accomplished by extracting n 1/k and seeing whether its k-th<br />

power is n, the root extraction being done via Newton’s method and for k<br />

up to lg n. The third simple task is easily done via Algorithm 2.1.2. Thus, we<br />

can “reduce” the factorization problem to finding nontrivial square roots of<br />

1 for odd composites that are not powers. We write “reduce” in quotes since<br />

it is not much of a reduction—the two tasks are essentially computationally<br />

equivalent. Indeed, if we can factor n, an odd composite that is not a power,<br />

it is easy to play with this factorization and with gcd’s to get a factorization<br />

n = AB where A, B are greater than 1 and coprime; see the Exercises. Then<br />

let a be the solution to the Chinese remainder theorem problem posed thus:<br />

a ≡ 1(modA), , a ≡−1(modB).<br />

We have thus created a nontrivial square root of 1 modulo n.<br />

So we now set out on the task of finding a nontrivial square root of 1<br />

modulo n, wheren is an odd composite that is not a power. This task, in<br />

turn, is equivalent to finding a solution to x 2 ≡ y 2 (mod n), where xy is<br />

coprime to n and x ≡ ±y (mod n). For then, xy −1 (mod n) is a nontrivial<br />

square root of 1. However, as we have seen, any solution to x 2 ≡ y 2 (mod n)<br />

with x ≡ ±y (mod n) can be used to split n.<br />

The basic idea of the QS algorithm is to find congruences of the form<br />

x 2 i ≡ ai (mod n), where ai is a square, say y 2 .Ifx = xi, thenx 2 ≡ y 2<br />

(mod n). The extra requirement that x ≡ ±y (mod n) is basically ignored.<br />

If this condition works out, we are happy and can factor n. Ifitdoesnot<br />

work out, we try the method again. We shall see that we actually can<br />

obtain many pairs of congruent squares, and assuming some kind of statistical<br />

independence, half of them or more should lead to a nontrivial factorization of<br />

n. It should be noted, though, right from the start, that QS is not a random<br />

algorithm. When we talk of statistical independence we do so heuristically.<br />

The numbers we are trying to factor don’t seem to mind our lack of rigor,<br />

they get factored anyway.<br />

Let us try this out on n = 1649, which is composite and not a power.<br />

Beginning as with Fermat’s method, we take for the xi’s the numbers just<br />

above √ n (see Section 5.1.1):<br />

41 2 = 1681 ≡ 32 (mod 1649),<br />

42 2 = 1764 ≡ 115 (mod 1649),<br />

43 2 = 1849 ≡ 200 (mod 1649).<br />

With the Fermat method we would continue this computation until we reach<br />

57 2 , but with our new idea of combining congruences, we can stop with the<br />

above three calculations. Indeed, 32 · 200 = 6400 = 80 2 ,sowehave<br />

(41 · 43) 2 ≡ 80 2 (mod 1649).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!