Factoring Lab

Receipts for factoring ideas: which work, which don’t, and how fast they stop working.

B7 · Methods that workWorks, and here’s how it scales

A toy quadratic sieve

Collect smooth values of x² − N, combine them into x² ≡ y² (mod N), and take a . The first sub-exponential method.

The idea

If X² ≡ Y² (mod N) but X ≢ ±Y, then N divides (X − Y)(X + Y) without dividing either, so (X − Y, N) is a factor. To build such a pair, look at Q(x) = x² − N for x just above √N, keep the ones that split completely over a small , and pick a set whose product has every exponent even: then the product is a square.

Watch it

Smooth relations: x² − N split over the base

Exponents mod 2 (the matrix); gold rows multiply to a square

The square

The test

Seeded balanced from 20 to 60 bits, five per size. We count candidates x and relations found, and compare with rho on the same N.

Fig. B7.2Work against N: quadratic sieve candidates and rho steps on the same toy numbers

Measuring…