The interaction between cryptography and mathematics introduced
modern mathematicians to a new culture more akin to the experimental and practical sciences. It was a culture not experienced
since the nineteenth-century German school had snatched the baton from the mathematicians of Revolutionary France. The French
had regarded their subject as a practical tool, as a means to an end, whereas Wilhelm von Humboldt believed in the pursuit
of knowledge for its own sake. Those theoreticians still steeped in the German tradition were quick to condemn the study of
methods for factorising numbers as a ‘pig in the rose garden’, in Hendrik Lenstra’s words. In contrast to
the pursuit of watertight proofs, this truffling for primes was seen as minor work of little mathematical importance. But
as RSA grew commercially more important, it became impossible to ignore the practical implications of finding an efficient
technique for unveiling the prime building blocks behind large numbers. Gradually, more mathematicians were drawn into the
challenge of cracking RSA 129. The final breakthrough came about not so much from the development of faster computers as from
unexpected theoretical advances. The new problems that sprang out of these forays into code-breaking have led to the development
of some deep and difficult mathematics.
One of the mathematicians attracted to this emerging subject was
Carl Pomerance. Pomerance is happy to split his time between the academic corridors of the University of Georgia and the commercial
environment of Bell Laboratories in Murray Hill, New Jersey. As a mathematician he has never lost that childish love of playing
with numbers and looking for new connections between them. He came to Paul Erdos’s attention when the Hungarian read
an intriguing article by Pomerance on the numerology of baseball scores. Stimulated by a curious question raised in the article,
Erdos descended on Pomerance in Georgia to begin a collaboration that would product over twenty joint papers.
Factorising numbers had fascinated Pomerance ever since he had been asked to factorise the number 8,051 in a high-school
mathematics competition. There was a time limit of five minutes, in the 1960s pocket calculators didn’t exist. Although
Pomerance was excellent at mental arithmetic, he decided first to look for a quick route to the solution rather than just
testing one number after another. ‘I spent a couple of minutes looking for the clever way, but grew worried that I was
wasting too much time. I then belatedly started trial division, but I had wasted to much time, and I missed the problem.’
His failure to crack 8,051 fuelled Pomerance’s lifelong quest for a fast way
to factorise numbers. Eventually he learnt about the trick his schoolteacher had had in mind. Before 1977, the smartest way
to crack numbers still, amazingly, belonged to the man whose Little Theorem was the catalyst for the invention of RSA’s
prime number code. Fermat’s Factorisation Method is a fast way factorise special choices of numbers by exploiting some
simple algebra. Using Fermat’s method, Pomerance took just seconds to crack 8,051 into 83 x 97. Fermat, who loved the
idea of secret codes, would probably have been delighted to find his work at the heart of making and breaking codes some three
centuries later.
When Pomerance heard of Rivest, Shamir and Adleman’s challenge,
he knew immediately that cracking the 129-digit number was the way to exorcise the memories of his childhood failure. In the
early 1980s it dawned on him that there was a way to exploit Fermat’s Factorisation Method. By implementing the method
on a variety of different clock calculators, it could provide a powerful factorisation machine. Now it was no longer just
the outcome of a high-school mathematics competition that was at stake. This new discovery, called the quadratic sieve, had
very serious implications for the emerging world of Internet security.
Pomerance’s quadratic sieve works by using
Fermat’s Factorisation Method but continually changing the clock calculator being used to try to crack a number. The
method is similar to the Sieve of Eratosthenes, the technique invented by the Alexandrian librarian, which sifts out primes
by taking the primes in turn and then striking out all number which are multiples of that prime. Thus, by dropping numbers
through different-sized sieves, non-primes are eliminated without having to consider them individually. In Pomerance’s
attack the prime sieves are replaced by varying the number of hours on the clock calculators. The calculations performed on
each separate clock calculator provided Pomerance with more information about possible factors. The more clocks that could
be used, the closer he could get to cracking a number into its prime constituents.
The ultimate
test of this idea was to set it to work on the challenge of RSA 129. But in the 1980s this number still looked well out of
reach of Pomerance’s factorisation machine. In the early 1990s help arrived in the shape of the Internet. Two mathematicians,
Arjen Lenstra and Mark Manasse, realised that the Internet would be the perfect ally for the quadratic sieve in an attack
on the RSA 129. The beauty of Pomerance’s method was that the workload could be spread over many different computers.
The Internet had been employed to find Manasse and Lenstra realised that they could now use the Internet to co-ordinate an
attack on RSA 129. Each computer could be assigned different clocks to sieve with. Suddenly, the Internet – which was
meant to be protected by these codes – was being asked to help crack the RSA challenge.
Lenstra and Manasse put Pomerance’s quadratic sieve on the Internet and called for volunteers. In April 1994
came the announcement that RSA 129 had crumbled. By combining several hundred desktop computers across twenty-four countries,
RSA 129 was cracked after eight months of real time in a project led by Derek Atkins at MIT, Michael Graff at Iowa State University,
Paul Leyland of Oxford University and Arjen Lenstra. Even two fax machines had joined in the search – while they weren’t
handling messages, they were helping to look for the two prime numbers with 65 and 64 digits. The project used 524.339 different
prime clocks.
In the late 1990s Rivest, Shamir and Adleman issued a new set of
challenges. By the end of 2002 the smallest of their challenges to remain uncracked was a number with 160 digits. The trio’s
finances have improved since 1977, so you can now $10,000 for cracking an RSA challenge number. Rivest threw away the primes
he used to build these challenge numbers, so no one actually knows the answers until the numbers are cracked. RSA Security
regards $10,000 as a small price to pay to keep ahead of the current band of number-crackers. And each time a new record is
set, RSA simply advises businesses to increase the size of the primes.
Pomerance’s
quadratic sieve has been superseded by a new sieve called the number field sieve. This new sieve is responsible for the current
record, set by cracking RSA 155. This was achieved by a network of mathematicians operating under the messianic name of Kabalah.
RSA 155 was a significant psychological breakthrough. In the mid-1980s, when security agencies were still toying with the
idea of using RSA, computer security with this level of complexity had been considered sufficient. As Ansgar Heuser of the
BSI, the German security agency, admitted at a cryptography conference in Essen, had they gone ahead ‘we would be in
the middle of a disaster’. RSA Security is now recommending clocks for which N, the number of hours, has at least 230
digits. But the likes of BSI, who need long-term security to protect their agents, are currently recommending clocks with
over 600 digits.
Head in the sand
The number field sieve makes a brief appearance in the Hollywood
film Sneakers. Robert Redford sits listening to a young mathematician lecturing about cracking very big numbers: ‘The
number field sieve is the best method currently available. There exists an intriguing possibility for a far more elegant approach…
But maybe, just maybe, there is a shortcut…’ Sure enough this whizz-kid, played by Donal Logue, has discovered
such a method, ‘a breakthrough of Gaussian proportions’, and has wired it into a small box which unsurprisingly
falls into the evil hands of the film’s villain, played by Ben Kingsley. The plot is so outlandish that most viewers
must imagine that this could never happen in the real world. Yet, as the credits for the film roll, up pops ‘Mathematical
Advisor: Len Adleman’, the A in RSA. As Adleman admits, this is not a scenario that we can guarantee won’t happen.
Larry Lascar, who wrote Sneakers, Awakening and War Games, came to Adleman to make sure he got the maths right. ‘I liked
Larry and his desire for verisimilitude, so I agreed. Larry offered money, but I countered with Robert Redford – I would
do the scene if my wife Lori could meet Redford.’
How prepared are businesses for such an academic
breakthrough? Some more so than others, but on the whole most have their head in the sand. If you ask business and government
security agencies, their answers are a little worrying. These are all comments I’ve recorded on the cryptograph circuit:
‘We met the government standards, that’s all we’re worried about.’
‘If we go down then at least a lot of other
people will be going down with us.’
‘Hopefully I will have retired anyway by the time such a mathematical breakthrough will have happened, so it
won’t be my problem.’
‘We work on the principle of hope – for the time being nobody expects a dramatic breakthrough.’
‘Nobody is
able to give guarantees. We simply don’t expect it.’
When I give presentations to businesses about
Internet security I like to offer my own little RSA challenge: a bottle of champagne for the first person to uncover two prime
numbers whose product is 126,629. The difference in response to this challenge I gave in three banking seminars in different
corners of the globe revealed the interesting cultural differences in the financial world’s attitude to security. In
Venice the challenge and the mathematics behind these codes washed straight over the heads of European bankers, and I resorted
to a plant in the audience to offer the solution. In contrast to the bankers of Europe, trained in the humanities as most
of them are, the Far Eastern banking community has a far greater scientific pedigree. By the end of the presentation, in Bali,
one man rose to his feet with the two primes and claimed the champagne. They showed that they appreciated the mathematics
and its implementation in e-business much better than their European counterparts.
But the presentation
to the Americas gave me the most striking insight. Within fifteen minutes of returning to my room after the presentation I
received three phone calls with correct solutions. Two of the US bankers had logged on to the Internet, downloaded code-cracking
programs and run 126,619 through them. The third was very cagey about his method, and he strongly suspected of having eavesdropped
on the other two.
Business has put its trust in a piece of mathematics that few have taken the time
to examine for themselves. True, the immediate threat to the security of everyday Internet business is more likely to come
from sloppy management leaving vital information unencrypted on a website. Like any cryptographic system, RSA is susceptible
to human imperfection, During the Second World War the Allies benefited from a host of textbook errors made by German operators
which helped them to crack Enigma. RSA can equally be weakened by operators choosing numbers which are too easily crackable.
If you want to break codes, buying up second-hand computers is probably better investment than enlisting for a Ph.D. in a
pure mathematics department. The amount of sensitive information left on outmoded machines is frightening. Offering a simple
bribe to someone guarding secret keys could get you far more for your money than sponsoring a team of mathematicians to crack
numbers. As Bruce Schneier comments in his book Applied Cryptography, ‘It’s a whole lot easier to find flaws in
people than it is to find them in crypto-systems.’
However, such security breaches. Though serious
for the company involved, pose no threat to the whole fabric of Internet business. This is what gives a firm like Sneakers
an edge. Although the probability of a breakthrough cracking numbers is small, the risk is still there and the result would
be globally devastating. It could become the Y2K of e-business, bringing the whole house of emails crumbling to the ground.
We think that cracking numbers is inherently difficult, but we can’t prove it. It would be a weight off the lot of executives’
minds if we could assure them that it is impossible to find a fast programme that can factorise numbers. Obviously it is difficult
to prove that such a thing does not exist.
Cracking numbers is a complex task not because
the mathematics is particularly difficult, but because there is such a huge haystack from which to pluck the two needles.
There are many other problems related to this ‘haystack’ quality. For example, although every map can be coloured
with for colours, how can you tell, given a particular map, whether you can seem to be by laboriously working through all
possible combinations until, with luck, you hit upon a map that requires only three colours.
One of Landon T. Clay’s Millennium Problems, known as P versus NP, raises a rather interesting question about
such problems. In the complexity of a problem such as factorising numbers or colouring maps arises from the very large size
of the haystack one has to search through, might there always be an efficient method to find the needle? Our hunch is that
the answer to the P versus NP question is ‘no’. There are problems which have an inherent complexity that can’t
be got around even with the hacking skills of a modern-day Gauss. If, however, the answer turns out to be ‘yes’,
then as Rivest says, ‘it would be a catastrophe for the cryptographic community’. Most cryptographic systems,
RSA included, concern problems about large haystacks. A positive answer to this Millennium Problem would mean that there really
is a fast way to crack numbers – it’s just that we haven’t found it yet!
Not too surprisingly, business is not overly concerned with mathematicians’ obsession for building our mathematical
edifice on foundations which are 100 per cent secure. Cracking numbers has remained difficult for the last few millennia,
so the business world is happy to build the Internet shopping mall on a foundation which is 99.99 per cent secure. Most mathematicians
think that there is something inherently computationally different about cracking numbers. But no one can predict what advances
the next decades may bring. After all, RSA 129 looked secure some twenty years ago.
One of the main
reasons why factorising numbers is so difficult is the randomness of primes. Since the Riemann Hypothesis seeks to understand
the source of the wild behaviour of the primes, a proof could provide new insights. In 1900 Hilbert has stressed in his description
of the Riemann Hypothesis that its solution had the potential to unlock many other secrets about numbers. Given the central
role of the Riemann Hypothesis in understanding the primes, mathematicians began to speculate proof, if it is ever found,
might yield new ways to crack numbers. This is why businesses are now beginning to keep an eye on the abstruse world of prime
number research. There is another reason why business is particularly interested in the Riemann Hypothesis. Before they can
use the RSA code, Internet companies must be first able to find two prime numbers with sixty digits. If the Riemann Hypothesis
is true, then there is a fast way to discover the primes used to build the RSA codes on which the security of e-business currently
relies.
Hunting
for big primes
Given the increasing pace of the Internet and the consequent
demand for bigger and bigger prime numbers, Euclid’s proof that the primes will never run dry suddenly takes on an unexpected
commercial significance. If the primes are such an unruly bunch how are businesses going to find these big prime numbers?
There may be an infinite number of prime numbers, but as we count higher they get thinner on the ground. If there are fewer
primes the further we count, then are there enough primes with around 60 digits for everyone in the world to have two of them
in order to make their own private key? And even if there are enough, perhaps there are only just enough, in which case there
is a high chance that two people will get the same pair.
Fortunately, Nature has been kind to the world
of e-commerce. Gauss’s Prime Number Theorem implies that the number of primes with 60 digits is approximately 1060 divided by the logarithm of 1060. This means that there are enough primes with 60 digits for every atom in the Earth to
have its own two primes. Not only that, the chance of you winning the National Lottery is higher than the likelihood of two
different atoms being assigned the same pair of primes.
So, given that there are enough prime numbers
to go round, how can we be sure that a number is prime? As we have seen, it is difficult enough to find the prime constituents
of a non-prime number. If a candidate number is prime then isn’t it doubly difficult to discover this fact? After all,
it means showing that no smaller number divides the candidate.
It turns out
that to determine whether a number is prime isn’t as tall an order as you might expect. There is a fast test to discover
whether a number is not prime, even if you can’t find any of its prime constituents. That is why Cole knew, as had the
rest of the mathematical world for some twenty-seven years before he announced his calculation, that the number he was trying
to crack wasn’t prime. This test isn’t much help in predicting the distribution of primes, the heart of the Riemann
Hypothesis. But because it tells us whether any particular number is prime, it lets us hear individual notes in music, though
it doesn’t help us appreciate the overall melody encapsulated in the Riemann Hypothesis.
The origin of this test is Fermat’s Little Theorem, which Rivest had exploited that night after the Passover
wine when he had discovered RSA. Fermat found that if he took a number on a clock calculator with a prime number of hours,
p, and raised it to the power p, he always got the number he started with. Euler realised that Fermat’s Little Theorem
could be used to prove that a number isn’t prime. For example, on a clock with 6 hours, multiplying 2 together 6 times
lands us at 4 o’clock. If 6 were prime, we could have arrived back at 2 again. So Fermat’s Little Theorem tells
us that 6 can’t be a prime number – else it would be a counter-example to the theorem.
If we want to know whether a number p is prime, we take a clock calculator with p hours. We start testing different
times to see whether raising the hour of the power of p gets us to the time we started from. Whenever it doesn’t, we
can throw that number out, confident that it is not a prime number. Each time we find an hour that does satisfy Fermat’s
test, we won’t have proved that p is prime, but that the hour on the clock is, if you like, bearing witness to p’s
claim to be prime.
Why is testing times on the clock any better than testing whether
each number is less than p divides p? The point is that if p fails the Fermat test, it fails very badly. Over half the numbers
on the clock face will fail this test and testify to the non-primality of p. That there are so many ways to prove that this
number is not prime is therefore an important breakthrough. This method contrasts strongly with the step-by-step division
test, checking off every number to see whether it is a factor of p. if p is the product of, say, two primes, then with the
division test only those two primes can prove that p is not prime. None of the other numbers will be of any help. One has
to get an exact hit for the division test to work.
In one of his multitude of collaborations, Erdos
estimated (though did not rigorously prove) that to test whether a number less than 10150 is prime, finding just one time on the clock which passes Fermat’s test already
means that the odds of that number not being prime as 1 in 1043. The author of The Book of Prime Number Records, Paulo Ribenboim, points out that using this test, any business
selling prime numbers could realistically peddle their wares under the banner ‘satisfaction guaranteed or your money
back’, without too much fear of going bust.
Over the centuries mathematicians have refined
Fermat’s test. In the 1980s two mathematicians, Gary Miller and Michael Rabin, finally came up with a variation that
would guarantee after just a few tests that a number is prime. But the Miller-Rabin test comes with a bit of mathematical
small print: it works for really big numbers only if you can prove the Riemann Hypothesis (To be precise, you need a slight
generalisation of the Riemann Hypothesis.) This is probably one of the most important things we know hiding behind Mount Riemann.
If you can prove the Riemann Hypothesis and its generalisation, then, as well as earning a million dollars, you will have
guaranteed that the Miller-Rabin test really is a fast and efficient method for proving whether a number is prime or not.
In August 2002, three Indian mathematicians,
Manindra Agrawal, Neeraj Kayal and Nitin Saxena, at the Indian Institute of Technology in Kanpur devised an alternative to
the Miller-Rabin test. It was very slightly slower but avoided having to assume the Riemann Hypothesis. This came as a complete
surprise to the prime number community. Within twenty-four hours of the announcement from Kanpur, 30,000 people across the
world – Carl Pomerance among them – had downloaded the paper. The test was sufficiently straightforward for Pomerance
to present the details to his colleagues in a seminar that same afternoon. He described their method as ‘wonderfully
elegant’. The spirit of Ramanujan still burns strong in India, and these three mathematicians were not afraid to challenge
the received wisdom of how one should check whether a number is prime.