Before the widespread use of computers and the Internet, cryptography

—from the Greek kryptos (hidden) and graphein (writing)—was largely the domain of the military or diplomats. Indeed, the earliest recorded instance of encryption

dates to about 400 bc, when the Spartans used a device called a scytale to send coded messages between military commanders. A strip of parchment or leather was wrapped spirally around a baton or staff of a certain diameter. The sender wrote the message down the length of the staff, and then unwrapped the parchment, effectively scrambling the order of the letters. To decode the message, the recipient had to wrap the parchment around a staff of the same diameter, whereupon the transposed letters returned to their original order.
In today’s information age, we make use of data scrambling whenever we use a password to check e-mail, withdraw money from an automated bank teller machine, make a cellular phone call, or charge a purchase over the Internet. We rely on encryption to ensure the validity of our financial transactions, prove our identity, and safeguard our privacy. Although some people hesitate to conduct business over the Internet, most of us engage in online transactions with confidence that encryption protects our activities.
This faith is generally well founded. Many of the new methods of encrypting and decrypting information involve public-key cryptography

, which was invented about 25 years ago. The security of many public-key systems (there are several kinds) is explicitly based on a long-standing challenge in the branch of mathematics known as number theory—the study of the properties and patterns of integers, whole numbers such as -2, -1, 0, 1, 2,…100,… Number theory has for centuries been widely regarded as the purest of the pure sciences, but in recent years it has found many applications.
Number theory

has played an essential role in the development of public-key cryptography. Without the basic inquiry carried out by early theorists, today’s computer transactions would be easy pickings for would-be thieves and swindlers. The number theorists’ challenge to potential intruders is this: Given a (very, very large) number obtained by multiplying two other numbers, find the two (very large) numbers that were multiplied to produce it. These numbers can be thought of as the keys

that lock and unlock the encryption code

. The task of finding these keys is so difficult that the snoops must either be bizarrely lucky (as lucky, say, as one person winning 20 state lotteries simultaneously) or they must solve a problem that has stumped the smartest people in the world for more than 2000 years. Every time we conduct an encrypted transaction, we’re betting that the snoops will lose.