424 Shor’s factorization algorithm
20.7 Public-key cryptography
This concluding section is about public-key cryptography (PKC). Such a topic is not
completely out of place in this chapter on Shor’s factorization algorithm because, as
I shall describe, the secrecy involved in PKC heavily relies on the fact that factoriz-
ing large numbers is a task that is essentially intractable, which is true according to
the best computing means and algorithms currently available. Since PKC is widely
used for different applications in the Internet, and since its principle is relatively sim-
ple to understand, it is worthwhile to describe it briefly here in the context of this
chapter.
Public-key cryptography was invented and developed by R. Rivest, A. Shamir and L.
Adleman, a trio of people who gave the name to the RSA standard. The RSA principle
feeds on the current fact that it is extremely difficult, if not completely intractable, to
factorize large composite numbers, or decompose them into a product of primes. Given
N , factorization (or prime decomposition) consists of finding the unique set of prime
numbers p
1
, p
2
,..., p
m
and powers α
1
,α
2
,...,α
m
such that p
α
1
1
p
α
2
2
... p
α
m
m
= N .For
instance, N = 1000 accepts the unique factorization or decomposition 2
3
× 5
3
= 1000.
For the purpose of PKC, we may just use two sufficiently large (and assumedly dif-
ferent!) prime numbers p, q to generate a “big” composite number N = pq,rest-
ing on the confidence that if anyone in the public domain knows N, that a person
or entity would have a hard time or find it impossible to figure out the two primes
p, q.
For instance, consider the number N = 62 615 533. To find its factorization, we need
to divide it by prime numbers, trying them out one after another. In this example, the
answer is p = 7919 and q = 7907, which are the highest two primes to be found at the
top of a list of the first thousands.
15
This unfortunate choice made the factorization easy,
since anyone can figure it out from such a list as representing the biggest product. What
about n = 15 773 077? The answer ( p = 2383, q = 6619) is less immediate, since it
takes 200 division tests to find q starting from the top of this first-thousand-prime list.
Assume next that p, q are selected from a huge list of known primes, for instance up to
10
9
, yielding composites N = pq up to the order of 10
18
.Evenatarateof10
9
division
tests per second (a state-class computing power that only a few may afford), this would
leave about 10
9
seconds or 31.7 years to find the prime factors!
I shall now focus on the RSA standard and algorithm specifics, after recalling the basic
underlying principle of cryptography. The principle of cryptography is to encode (or
encrypt) a given “open-text” message, called plaintext, into a “secret” message, called
ciphertext. Such words come from cryptology, the science, and history of cryptography,
16
15
For various lists of prime numbers, see, for instance: http://primes.utm.edu/lists/small/1000.txt, http://
en.wikipedia.org/wiki/List_of_prime_numbers; http://primes.utm.edu/; www.prime-numbers.org/; www.
rsok.com/∼jrm/printprimes.html.
16
For riveting and historical accounts of cryptology, see S. Singh, The Code Book (New York: Anchor Books,
1999), S. Levy, Crypto (Harmondsworth: Penguin Books, 2001), and D. Kahn, The Codebreakers, the
Story of Secret Writing (New York: Scribner, 1967). For an easy but detailed overview of crypto-algorithms