17.5 17.4 Cryptography

Thus far, we have discussed ways in which data can be encoded to detect errors or correct errors in transmission. In many situations, there is also a desire for security against unauthorized interpretation of coded data (that is, a desire for secrecy). The process of disguising data is called encryption.

Cryptography DEFINITION

Cryptography is the study of methods to make and break secret codes. The process of coding information to prevent unauthorized use is called encryption. The process of making intelligible information from a deliberately distorted transmission is called decryption.

Historically, encryption was used primarily for military and diplomatic transmissions (see Spotlights 17.6 through 17.8, starting on page 724). Today, encryption is essential for securing electronic transactions of all kinds. Cryptography is what allows you to have a website safely receive your credit card number. Cryptographic schemes prevent hackers from charging calls to your cell phone. Cryptography is also used for authenticating electronic transactions. In 1998, history was made when President Bill Clinton and Ireland’s Prime Minister Bertie Ahern used digital signatures to sign an intergovernmental document. Each leader had a unique signing code and a digital certificate that served as a “digital ID,” thereby ensuring that the document truly was approved by them. Although modern encryption schemes are extremely complex, we will illustrate the fundamental concepts involved with a few simple examples.

image

Among the first known cryptosystems is the Caesar cipher, used by Julius Caesar to send messages to his troops. To encrypt a message with the method employed by Caesar, we use the following table to replace each letter in the top row with the letter below it:

For example, the message ATTACK AT DAWN is encrypted as DWWDFN DW GDZQ.

715

To decrypt the message, replace each letter with the letter above it in the table. Obviously, it would not require much effort for someone to “crack” this code, but it might be good enough to use on your friends who are not mathematically inclined.

Self Check 6

Use the Caesar cipher to encrypt the message SEND MONEY.

  • VHQG PRQHB

To describe more sophisticated schemes for transmitting messages secretly, it is convenient to introduce a special kind of arithmetic used in cryptography. Recall that if we divide a positive integer by a positive integer , there are unique integers and such that , where is nonnegative and less than . The number is called the quotient and is called the remainder. For any positive integers and , we define (read “ modulo ” or just “") to be the remainder when is divided by . For negative integers , we can find by adding exactly enough multiples of to so that the sum is nonnegative (this works because modulo , ). Thus, because .

EXAMPLE 12

To find the quotient and remainder for small integers, simply use long division. For larger numbers such as , use a calculator to divide 2751 by 13 to obtain 21 1.615385. Then the integer part 211 is the quotient . To find the remainder when is divided by , note that . So we have . An easy way to find and is to enter “” and “” into a Google search box.

Arithmetic involving is called modular arithmetic. Although this arithmetic may appear unfamiliar, you often unconsciously use it. For example, if it is now September, what month will it be 25 months from now? Of course, you answer “October,” but the interesting fact is that you didn’t arrive at the answer by starting with September and counting off 25 months. Instead, without even thinking about it, you simply observed that so that , and you added one month to September.

716

Modeling the Genetic Code Spotlight 17.5

The way that genetic material is composed can be conveniently modeled using modulo 4 arithmetic. A DNA molecule is made up of two long strands in the form of a double helix. Each strand is made up of strings of the four nitrogen bases adenine (A), thymine (T), guanine (G), and cytosine (C). Each base on one strand binds to a complementary base on the other strand. Adenine always binds to thymine, and guanine always binds to cytosine. To model this situation, we identify A with 0, T with 2, G with 1, and C with 3. Thus, the DNA segment ACGTAACAGGA and its complementary segment TGCATTGTCCT are identified by 03120030110 and 21302212332.

Using modulo 4 arithmetic, , and , we see that adding 2 to any of the integers 0, 1, 2, or 3 interchanges 0 and 2 and 1 and 3. So, for any DNA segment represented by strings of 0s, 1s, 2s, and 3s, we see that its complementary segment is represented by , where we add the integers in each component using modulo 4. In particular, .

image

Source: Information from Discrete Mathematics by S. Washburn, T. Marlow, and C. Ryan, Addison-Wesley, 1999.

Similarly, if it is now Wednesday, you know that in 23 days, it will be Friday. This time, you arrived at your answer by noting that (that is, ), so you added 2 days to Wednesday instead of counting off 23 days. Because , if it is now 1 P.M., in 51 hours, it will be 4 P.M. (). If you travel east 390 degrees, you end up 30 degrees east of where you began (). Applications of modular arithmetic include the check-digit schemes described in Chapter 16, where arithmetic mod 7, 9, 10, and 11 were used. The parity-check sums (discussed in Section 17.2) use addition . An application of modular arithmetic to genetics is described in Spotlight 17.5.

With modular arithmetic, we can describe the Caesar cipher easily as follows. Begin by saying that the letter is in position 0, is in position 1, is in position 2, and so on. Then the Caesar cipher replaces the letter in position with the letter in position . This formula expresses the fact that the Caesar cipher shifts each letter from through three positions to the right, while , , and are replaced with , , and , respectively. (Think of , , and as “wrapping” around to the beginning of the alphabet.) It is customary to use the term Caesar cipher for any encryption scheme that shifts each letter a fixed number of positions. When the shift is anything other than three positions, we will specify the amount of the shift.

Decimation Cipher

Rather than encrypting a message by adding a fixed number to the position of every letter and using modular arithmetic, as is done in the Caesar cipher, another simple way to encrypt a message is to multiply each position by a fixed number and use modular arithmetic. This method of encryption is called the decimation cipher.

717

To begin, we assign the 26 letters the numbers 0 through 25, in order, and select any odd integer between 3 and 25 except 13. (For the method to work, and 26 must have no prime divisors in common.) Then, in the message, a letter with numerical value is replaced with the letter with numerical value modulo 26. For example, if is 5, then is replaced with because has value 3 and , which is assigned to . When exceeds 26, we use modulo 26 arithmetic to determine the replacement for the letter. Thus, is replaced by because has the value 9 and and and has value 19. The value of is called the key.

Algebra Review Appendix

Prime and Composite Numbers

To decode an encrypted message, we use the same method except that we multiply the numerical value for each encrypted letter by 21. The number 21 is used to decrypt the message because it has the property that and . As a consequence, for any integer , we have equals . Thus, multiplying an integer by 5 and then the result by 21 gets us back to when we use modulo 26. In general, if a number is used to encrypt a message modulo 26, the value used to decrypt the message has to be chosen so that . Given a particular value for , we can find the corresponding by trial and error. Table 17.4 shows the values corresponding to each choice of .

Table 17.7: TABLE 17.4 Decimation Cipher Decryption Values
Encryption Value Decryption Value
3 9
5 21
7 15
9 3
11 19
15 7
17 23
19 11
21 5
23 17
25 25

EXAMPLE 13 Decimation Cipher

To illustrate the decimation cipher, let’s encrypt the message ATTACK AT DAWN using the key 3.

Message A T T A C K A T D A W N
Position 0 19 19 0 2 10 0 19 3 0 22 13
Position × 3 0 57 57 0 6 30 0 57 9 0 66 39
New position 0 5 5 0 6 4 0 5 9 0 14 13
Encrypted message A F F A G E A F J A O N

718

Linear Cipher

We can combine the methods used in the Caesar cipher and the decimation cipher easily by replacing the letter represented by the integer with the letter corresponding to the integer , where is any allowable decimation key and is the shift we want. For example, choosing and , the letter , which corresponds to 3, is replaced by , which corresponds to 13, because . This method is called a linear cipher.

To decrypt a message that has been created using the linear cipher formula , we must undo shifting by by shifting by , as well as undo the step of multiplying by the encryption value by multiplying by the decryption value corresponding to given in Table 17.4. In our example of encoding the letter with the numerical value with the formula , we can determine the starting value of that results in 13 by solving the equation : We subtract 6 from both sides to get , which reverses the shift of 6; then we multiply by 19, which we see from Table 17.4 reverses multiplying by 11, to get . Because and , this simplifies to , which corresponds to the letter . In cases where working backward results in a negative value after the reverse shift such as , Google still gives the correct answer.

Undoing a message letter encrypted by multiplying by and shifting by is tantamount to using the formula , where is the decryption value for given in Table 17.4 (notice that we undo the two steps in reverse order).

EXAMPLE 14 Linear Cipher

To illustrate a linear cipher, we encrypt the message ADVANCE using the formula and decrypt the message ANQANHQ that was encrypted using the formula .

Message A D V A N C E
Position 0 3 21 0 13 2 4
7 70 448 7 280 49 91
New position 7 18 6 7 20 23 13
Encrypted message H S G H N X E

To decrypt ANQANHQ, we see from Table 17.4 that the decryption value for 21 is 5, so our decryption formula is . To make calculations easier, it is better to replace by a positive integer by observing that when using modulo 26, we may add 26 to any integer without changing the value. Thus, , and our formula becomes . (Or use Google to obtain —.)

Message A N Q A N H Q
Position 0 13 16 0 13 7 16
17 82 97 17 82 52 97
New position 17 4 19 17 4 0 19
Decrypted message R E T R E A T

Self Check 7

Use the decimation cipher with the key 5 to encrypt the message ATTACK.

  • ARRAKY

719

Self Check 8

What is the decryption formula for messages encrypted using the linear cipher

In most cases, the encryption algorithm requires that a message be changed to a particular format that is still readable. Such messages are called plaintext. An encrypted version of a message is called ciphertext. Our next cipher provides an example of a plaintext format.

Permutation Cipher

Another easy-to-use cipher is the permutation cipher. For an integer greater than 1, a permutation of the integers is a reordering of those integers. To specify a reordering, we list the integers in the top row of a 2-by- array and the reordered integers in the bottom row. For , one possible permutation is

To use the permutation to encrypt the message ATTACK AT DAWN, we first break up the message into blocks of three letters each, ignoring the spaces between the words to obtain the plaintext ATT ACK ATD AWN. (This has the added advantage of disguising the lengths of each word, which makes breaking the code more difficult.) We then use the permutation to reorder the three letters in each block in the same way we reordered the integers 1, 2, and 3. That is, the first letter is put in the third position, the second letter is put in the first position, and the third letter is put in the second position. Doing this for each block we have TTA CKA TDA WNA. Messages encrypted with permutations are popularly called anagrams.

To decrypt a message encrypted by any permutation of the integers , we use the permutation (called inverse) that reverses the effect of by reading from bottom to top. That is, we create the 2-by- permutation array as follows. The top row of is . The first entry in the bottom row of is the integer in the top row of that is above 1; the second entry in the bottom row of is the integer in the top row of above 2; and continuing in this way, the nth entry of the bottom row of is the integer in the top row of above . For , We have . Applying to the ciphertext

yields the plaintext

Notice that when moves a letter in a block to a new position, moves that letter back to its original position. In effect, “undoes” . Of course, the recipient of the encrypted message must disentangle the blocks to figure out the words involved by seeing which possibilities make sense.

720

EXAMPLE 15 Encryption Using a Permutation

We use the permutation to encrypt ATTACK AT DAWN. Since involves four integers, our blocks are ATTA CKAT DAWN. Applying to the plaintext, we obtain the ciphertext ATAT TACK NWDA.

In cases of messages encrypted with a permutation of where there are not enough letters to fill the last block, we add extra nonsense letters like , , and as filler. Thus, when the message is ATTACK AT DAWN and is 5, the last block could be WNXQZ or WNQXX. The recipient of the message will recognize the nonsense letters as padding needed to complete the last block.

EXAMPLE 16 Decryption Using a Permutation

We decrypt the ciphertext

that was encrypted with the permutation . Applying to the ciphertext, we obtain the plaintext

Regrouping the letters to make sense and recognizing that the X at the end was filler, this converts to

Although linear ciphers and permutation ciphers are simple to use, they have the serious flaw of preserving the frequency of the encrypted letters. That is, the frequency of each letter in the plaintext is the same as the frequency of its replacement in the ciphertext. When letter frequency is preserved, it is easy to deduce the method of encryption for long messages.

The next two ciphers we discuss are the type that encode the same letter in more than one way. For these ciphers, letters that occur frequently in the message may not correspond to letters that occur frequently in the ciphertext and vice versa.

Playfair Cipher

The Playfair cipher was invented in 1854 by the British scientist Charles Wheatstone; it was then popularized by Baron Lyon Playfair. The cipher was used in the Boer War during 1899–1902 and World War II (1939–1945). The Playfair cipher uses a 5-by-5 matrix and three rules for converting plaintext to ciphertext. Since the matrix accommodates only 25 letters, the letter Q is omitted in all plaintext and keywords (some authors retain Qs but replace all occurrences of the letter J in a plaintext or keyword with I). To encode a message, the sender groups successive letters into pairs. Because the method requires that each pair of letters be distinct letters, in situations where the same letter would occur twice, the letter X is inserted between them [if the duplicate pair is XX, a Z is inserted between them—the X (or Z) is ignored after the ciphertext has been decoded]. If this process results in a plaintext with an odd number of letters, an X is added at the end (or a Z if the last letter is X). Thus, the message CALL IT QUITS yields the plaintext pairs CA LX LI TU IT SX. To create the cipher, the sender selects a keyword and inserts it in the matrix starting in the first row and continuing as necessary with no letter used more than once. The keyword MATHEMATICS would yield the matrix entries

721

The remaining slots of the matrix are filled with the unused letters in the alphabet in their usual order. In our case, the cipher matrix is

The rules for transforming each pair of plaintext letters to ciphertext letters are as follows.

Playfair Encryption Rules

  1. If both letters are in the same row, each of the two letters is replaced by the letter to the immediate right of it: AH becomes TE. If a letter is at the end of a row, it is replaced by the letter at the beginning: KL becomes LF.
  2. If both letters are in the same column, each of the two letters is replaced by the letter immediately below it: EU becomes DZ. If a letter is at the bottom of a column, it is replaced by the letter at the top: XS becomes TJ.
  3. If the two letters in a pair are not in the same row or the same column, the two letters are at opposite corners of a rectangle. In this case, each letter is replaced by the letter in the corner of the rectangle in the same row (the letters on the left and right corners of the rectangle are swapped): DA becomes CE.

EXAMPLE 17 Encrypting with a Playfair Cipher

We encode the plaintext CALL IT QUITS using the key word MATHEMATICS.

Plaintext CA LX LI TU IT SX
Ciphertext GC JZ FD EP SM JT

Note that with the Playfair cipher, the same letter in plaintext can be encoded more than one way in ciphertext (in Example 17, the first L becomes J and the second L becomes F). This means that letters appearing with high frequency in English may not encode to letters with high frequency—which makes breaking the cipher more difficult. Of course, to decrypt a ciphertext we must reverse the encryption steps as demonstrated in the next example.

Self Check 9

Use the Playfair cipher with the keyword MATHEMATICS to encode the message GO FOR IT.

  • OW GN NB ST

722

EXAMPLE 18 Decrypting a Playfair Ciphertext

To decode the ciphertext TB TZ PN OB AC HC EU WB that was encoded using the keyword BEATLES and the matrix

we use the same matrix but reverse the encryption rules 1 and 2.

Playfair Decryption Rules

  • . If both letters are in the same row, each of the two letters is replaced by the letter to the immediate left of it: ET becomes BA. If a letter is at the beginning of a row, it is replaced by the letter at the end: HM becomes MK.
  • . If both letters are in the same column, each of the two letters is replaced by the letter immediately above it: WO becomes OI. If a letter is at the top of a column, it is replaced by the letter at the bottom: LU becomes ZM.

Applying these rules gives us

Plaintext TB TZ PN OB AC HC EU WB
Ciphertext AL LY OU NE ED IS LO VE

Regrouping the letters to make sense, we get the message ALL YOU NEED IS LOVE.

Vigenère Cipher

Modular arithmetic also provides the basis for a more sophisticated cryptosystem called the Vigenère cipher. For this method, we first select a keyword, which can be any word. The letters of the keyword are then used to determine the amount of shifting for each letter of our message. As before, we say A is in position 0, B is in position 1, and so on.

EXAMPLE 19 Vigenère Cipher

We use the Vigenère cipher to encrypt the message ATTACK AT DAWN. Choosing the keyword MATH, we shift the first letter of the message by 12 because is in position 12; the second letter of the message is shifted by 0 (unchanged) because is in position 0; the third letter of the message is shifted by 19 because is in position 19, and so on. A shift of means that the letter in position is replaced by the letter in position . When we have used all the letters of the keyword, we start over at the beginning. To encrypt ATTACK AT DAWN using the keyword MATH, we first note that the letters in the keyword MATH are in positions 12, 0, 19, and 7, respectively. So the in ATTACK is converted to , the first in ATTACK is converted to , the second in ATTACK is converted to , and so on. The first two lines of Table 17.5 show the position numbers for the letters of the message and the keyword. The third line of the table is obtained from the first two by adding the values in the columns using and converting the results back to letters.

723

Table 17.13: TABLE 17.5 Encryption Using a Vigenère Cipher
ATTACK AT DAWN 0 19 19 0 2 10 0 19 3 0 22 13
MATHMA TH MATH 12 0 19 7 12 0 19 7 12 0 19 7
MTMHOK TA PAPU 12 19 12 7 14 10 19 0 15 0 15 20

The Vigenère square in Table 17.6 provides a quick way to use the Vigenère cipher to encrypt messages with any keyword. Use the left column for each letter of the keyword and the top row for the corresponding letter of the message to be encrypted. The letter at the intersection of that row and column is the shifted letter. For example, if the message letter is and the corresponding letter from the keyword is , then the letter at the intersection of the row that begins with and the column that begins with is the encrypted letter for .

Table 17.14: TABLE 17.6 Vigenère Square
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
A A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z Z A B C D E F G H I J K L M N O P Q R S T U V W X Y

724

Enigma Machines Spotlight 17.6

Enigma machines were cipher devices used by the Germans in World War II (1939-1945). An Enigma machine had three to five wheels that would scramble the letters of a message in a way similar to the Vigenère method. The machines were easy to use and offered a high degree of security when used properly. Although messages encoded with Enigma machines were difficult to decipher, operator negligence and the capture by the Allied forces of a number of Enigma machines and the tables of wheel settings allowed Polish and British cryptologists to break the code.

image

Jefferson Wheel Cipher

In 1795 Thomas Jefferson, who became the third president of the United States in 1801, invented an encryption device known as the Jefferson wheel cipher. Employing the idea underlying the Vigenère square, the Jefferson cipher consists of a set of 26 disks with a hole in the center, each with the 26 letters of the alphabet arranged around the edge (see the figure below), scrambled in a random way from the approximately 40,329,146,000,000,000,000,000,000 choices. The disks numbered from 1 to 26 are mounted on the axle in any order desired. Rather than using a keyword, the order in which the disks are arranged on the axle is the cipher key. Both sender and receiver must arrange the disks in the same order. The sender rotates each disk up and down to spell out the desired message on one row and then selects any row to determine the approprite substitutions. To decrypt the coded message, the receiver rotates the disks so that they spell out the encrypted message on one row and then looks for another row that make sense. In the very unlikely case of two sensible messages, the receiver can request the message to be re-encrypted.

image

The same system was independently invented in 1891 by Etienne Bazeries, who used 20 disks. It was used by the United States Army from 1923 until 1942.

725

EXAMPLE 20 Jefferson Wheel Cipher

To illustrate the Jefferson cipher, we use a system with only six disks labeled as follows:

  • 1: XWAZJGDLUBVIQHKYPNTCROSFEM
  • 2: EBPLNKACZDTRXMJQOYHGSVUFIW
  • 3: EQGYXPLOCKBDMAIZVRNSJUWFHT
  • 4: UKTEBSXRPLNDVHGFCQYIZMJWAO
  • 5: GJVDKCPMNZQWXYABEUOTSIHFRL
  • 6: KGAMIHWPNYCJBFZDRUXLQOTVES

To send the message ATTACK, we select a key such as 4, 2, 5, 1, 6, 3 and arrange the disks in that order. We then rotate the six disks so that the word ATTACK appears as a row as shown below (only the first eight rows are provided).

4 2 5 1 6 3
A T T A C K
O R S Z J B
U X I J B D
K M H G F M
T J F D Z A
E Q R L D I
B O L U R Z
S Y G B U V

If we select as our substitution row the one immediately below the row with the word ATTACK, the encrypted message is ORSZJB. Had we selected as our substitution row the one that is three below our message, we would have obtained the encrypted message KMHGFM. Each of the 25 rows is equally effective for encryption purposes.

Conversely, had we received the ciphertext KMHGFM, we would have rotated disk 2 so that M appeared in the same row as K on disk 4, then rotated disk 5 so that H appeared in the same row as KM, then continued in the same way until the row became KMHGFM. Then we would have looked for another row that is a sensible word, such as ATTACK.

Mavis Batey Spotlight 17.7

Mavis Batey was born Mavis Lever in south London on May 5, 1921. As a linguistics student at a London college during the early days of World War II, she was recruited by the British government to do intelligence work. One of her first assignments was to read the personal ads in the Times of London in search of secret German messages. Following that, she joined a team of code breakers at Bletchley Park, a Victorian estate north of London. Her team’s efforts helped the Allies defeat the Italian navy in 1941. Their cracking of the Enigma codes employed by the German military intelligence service assisted the Allied forces’ 1944 invasion of France to drive out the Germans. Britain’s wartime prime minister, Winston Churchill, called the Bletchley Park code breakers “the geese that laid the golden eggs but never cackled.”

Batey was the model for the code breaker played by Kate Winslet in the 2001 film Enigma. She died in 2013 at age 92. Newspapers in the United States and the United Kingdom carried lengthy obituaries about her.

image

726

Alan Turing Spotlight 17.8

On Time magazine’s list of the 100 most influential people of the 20th century was Alan Turing, a British mathematician born in London in 1912. While a student at Cambridge, Turing imagined a machine that could execute logical processes. The device in his mind-experiment quickly acquired the name “Turing machine.” At the time, no one knew that Turing’s idea would provide a blueprint for what would eventually become the electronic digital computer. Now we know that everyone who opens a spreadsheet or a word-processing program is using an incarnation of a Turing machine.

After graduating from Cambridge, Turing became a crucial member of a team of cryptologists working for the British government who successfully broke the Enigma codes (see Spotlight 17.6 on page 724).

Turing’s life took a tragic turn in 1952 when he admitted that he had engaged in homosexual acts in his home, a felony in Britain at that time. As punishment, he was chemically castrated and subjected to estrogen treatments. Made despondent by this treatment, he committed suicide two years later at the age of 41 by eating an apple laced with cyanide.

Today, Turing is widely honored for his fundamental contributions to computer science and his role in the defeat of Germany in World War II. Many rooms, lecture halls, and buildings at universities around the world have been named in honor of Turing. The annual award for contributions to the computing community, which is widely considered to be equivalent to a Nobel Prize, is called the “Turing Award.” In December 2013, Queen Elizabeth II granted Turing a pardon and issued a statement saying that Turing’s treatment was unjust: “Turing was an exceptional man with a brilliant mind who deserves to be remembered and recognized for his fantastic contribution to the war effort and his legacy to science.”

The 2014 film Imitation Game, loosely based on Turing’s life, starred Benedict Cumberbatch as Turing and Keira Knightley as a member of the code-breaking team; it was nominated for eight Academy Awards.

image

Information from Time, Vol. 153, Issue 12 (March 29, 1999), p. 147.

Encrypting Credit Card Data on the Web

Suppose that you want to purchase a compact disc from Amazon.com. Should you be concerned that a hacker will intercept your credit card number during the transaction? As you might expect, your credit card number is sent to Amazon in encrypted form to protect the data.

To describe one way that this encryption can be done, we need to perform addition of binary strings. We add two binary strings and as follows:

where if and if . Equivalently, . (Add and in the ordinary way, but replace 2 by 0.)

EXAMPLE 21 Sum of Binary Strings

727

Self Check 10

Find the sums

  • 01011110; 101011

We can now explain one way to send credit card numbers over the Web securely. When you place an order with Amazon, the company sends your computer a randomly generated string of 0s and 1s called a key. This key has the same length as the binary string corresponding to your credit card number, and the two strings are added (think of this process as “locking” the data). The resulting sum is then transmitted to Amazon. Amazon in turn adds the same key to the received string, which then produces the original string corresponding to your credit card number. (Adding the key a second time “unlocks” the data.)

To illustrate the idea, say you want to send an eight-digit binary string such as to Amazon (actual credit card numbers have very long strings), and Amazon sends your computer the key . Your computer returns the string to Amazon, and Amazon adds to this string to get , which is the string representing your credit card number. If someone intercepts the number during transmission, it is of no value without knowing . This method works because of the property of binary addition that if and only if the two strings are identical. Thus, . The method is secure because the key sent by Amazon is randomly generated and used only one time.

You can tell when you are using an encryption scheme on a web transaction by looking to see if the web address begins with “https” rather than the customary “http.” You will also see a small padlock in the status bar at the bottom of the browser window.

Even with sophisticated encryption schemes and security precautions, however, computer system breaches are still common. See Spotlight 17.9 for a highly publicized instance.

Smart Cards Spotlight 17.9

In December of 2013, hackers breached the computer system of Target, America’s second leading general merchandise company, and stole the credit and debit card numbers of 70 million customers. Within days, the stolen credit and debit card numbers were selling on the black market for as little as $20 to a high of $100 per card. Such an incident was possible because most credit cards issued in the United States before 2014 employ a magnetic stripe and can easily be dupicated by criminals. In contrast, Europe, Mexico, Canada, and 80 other countries embed a microchip in their cards to encrypt the data. Unlike magnetic stripes, which always contain the same data, chip cards encrypt different data for each transaction and communicate with a card reader. This enables them to detect and react to tampering attempts, thereby helping to counter possible attacks.