9.4 Factoring

We now turn to factoring. The basic method of dividing an integer n by all primes pn is much too slow for most purposes. For many years, people have worked on developing more efficient algorithms. We present some of them here. In Chapter 21, we’ll also cover a method using elliptic curves, and in Chapter 25, we’ll show how a quantum computer, if built, could factor efficiently.

One method, which is also too slow, is usually called the Fermat factorization method. The idea is to express n as a difference of two squares: n=x2y2. Then n=(x+y)(xy) gives a factorization of n. For example, suppose we want to factor n=295927. Compute n+12, n+22, n+32, , until we find a square. In this case, 295927+32=295936=5442. Therefore,

295927 ...

Get Introduction to Cryptography with Coding Theory, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.