The Cracking Code Book. Simon Singh

Читать онлайн.
Название The Cracking Code Book
Автор произведения Simon Singh
Жанр Книги для детей: прочее
Серия
Издательство Книги для детей: прочее
Год выпуска 0
isbn 9780007484997



Скачать книгу

strategy for secret communication relied on simply hiding the message. Herodotus also recounted another incident in which concealment was sufficient to secure the safe passage of a message. He chronicled the story of Histaiaeus, who wanted to encourage Aristagoras of Miletus to revolt against the Persian king. To convey his instructions securely, Histaiaeus shaved the head of his messenger, wrote the message on his scalp, and then waited for the hair to regrow. This was clearly not an urgent message. The messenger, apparently carrying nothing contentious, could travel without being harassed. Upon arriving at his destination, he then shaved his head and pointed it at the intended recipient.

      Secret communication achieved by hiding the existence of a message is known as steganography, derived from the Greek words steganos, meaning “covered”, and graphein, meaning “to write”. In the two thousand years since Herodotus, various forms of steganography have been used throughout the world. For example, the ancient Chinese wrote messages on fine silk, which was scrunched into a tiny ball and covered in wax. The messenger would then swallow the ball of wax. Steganography also includes the practice of writing in invisible ink. As far back as the first century AD, Pliny the Elder explained how the “milk” of the tithymalus plant could be used as an invisible ink. Although the ink is transparent after drying, gentle heating chars it and turns it brown. Many organic fluids behave in a similar way, because they are rich in carbon and therefore char easily. Indeed, it is not unknown for modern spies who have run out of standard-issue invisible ink to improvise by using their own urine.

      The longevity of steganography illustrates that it certainly offers some degree of security, but it suffers from a fundamental weakness: if the messenger is searched and the message is discovered, then the contents of the secret communication are revealed at once. Interception of the message immediately compromises all security. A thorough guard might routinely search any person crossing a border, scraping any wax tablets, heating blank sheets of paper, shaving people’s heads, and so on, and inevitably there will be occasions when a message is uncovered.

      Hence, along with the development of steganography, there was the evolution of cryptography (the word is derived from the Greek kryptos, meaning “hidden”). The aim of cryptography is not to hide the existence of a message, but rather to hide its meaning, a process known as encryption. To render a message unintelligible, it is scrambled according to a particular protocol, which is agreed beforehand between the sender and the intended recipient. Thus the recipient can reverse the scrambling protocol and make the message comprehensible. The advantage of cryptography is that if the enemy intercepts an encrypted message, the message is unreadable. Without knowing the scrambling protocol, the enemy should find it difficult, if not impossible, to re-create the original message from the encrypted text.

      Cryptography itself can be divided into two branches, known as transposition and substitution. In transposition, the letters of the message are simply rearranged, effectively generating an anagram. For very short messages, such as a single word, this method is relatively insecure because there are only a limited number of ways of rearranging a handful of letters. For example, three letters can be arranged in only six different ways, e.g. cow, cwo, ocw, owc, wco, woc. However, as the number of letters gradually increases, the number of possible arrangements rapidly explodes, making it impossible to get back to the original message unless the exact scrambling process is known. For example, consider this short sentence. It contains just thirty-five letters, and yet there are more than 50,000,000,000,000,000,000,000,000,000,000 distinct arrangements of them. If one person could check one arrangement per second, and if all the people in the world worked night and day, it would still take more than a thousand times the lifetime of the universe to check all the arrangements.

      A random transposition of letters seems to offer a very high level of security, because it would be impractical for an enemy interceptor to unscramble even a short sentence. But there is a drawback. Transposition effectively generates an incredibly difficult anagram, and if the letters are randomly jumbled, with neither rhyme nor reason, then unscrambling the anagram is impossible for the intended recipient, as well as for an enemy interceptor. In order for transposition to be effective, the rearrangement of letters needs to follow a straightforward system, one that has been previously agreed by sender and receiver but kept secret from the enemy. For example, it is possible to send messages using the “rail fence” transposition, in which the message is written with alternating letters on separate upper and lower lines. The sequence of letters on the lower line is then tagged on at the end of the sequence on the upper line to create the final encrypted message. For example:

      

       THY SECRET IS THY PRISONER; IF THOU LET IT GO, THOU ART A PRISONER TO IT

      

      

       TYERTSHPIOEITOLTTOHURARSNROTHSCEITYRSNRFHUEIGTOATPIOETI

      Another form of transposition is embodied in the first-ever military cryptographic device, the Spartan scytale, dating back to the fifth century BC. The scytale is a wooden staff around which a strip of leather or parchment is wound, as shown in Figure 2. The sender writes the message along the length of the scytale and then unwinds the strip, which now appears to carry a list of meaningless letters. The message has been scrambled. The messenger would take the leather strip, and, as a steganographic twist, he would sometimes disguise it as a belt with the letters hidden on the inside. To recover the message, the receiver simply wraps the leather strip around a scytale of the same diameter as the one used by the sender.

      Figure 2 When it is unwound from the sender’s scytale (wooden staff), the leather strip appears to carry a list of random letters: S, T, S, F … Only by rewinding the strip around another scytale of the correct diameter will the message reappear.

      In 404 BC Lysander of Sparta was confronted by a messenger, bloody and battered, the only one of five to have survived the difficult journey from Persia. The messenger handed his belt to Lysander, who wound it around his scytale to learn that Pharnabazus of Persia was planning to attack him. Thanks to the scytale, Lysander was prepared for the attack and successfully resisted it.

      The alternative to transposition is substitution. One of the earliest descriptions of encryption by substitution appears in the Kāma-Sūtra, a text written in the fourth century AD by the Brahmin scholar Vātsyāyana, but based on manuscripts dating back to the fourth century BC. The Kāma-Sūtra recommends that women should study sixty-four arts, such as cooking, dressing, massage and the preparation of perfumes. The list also includes some less obvious arts, including conjuring, chess, bookbinding and carpentry. Number forty-five on the list is mlecchita-vikalpā the art of secret writing, recommended in order to help women conceal the details of their liaisons. One of the recommended techniques is to pair letters of the alphabet at random, and then substitute each letter in the original message with its partner. If we apply the principle to the English alphabet, we could pair letters as follows:

      Then, instead of meet at midnight, the sender would write CUUZ VZ CGXSGIBZ. This form of secret writing is called a substitution cipher because each letter in the plaintext (the message before encryption) is substituted for a different letter to produce the ciphertext (the message after encryption), thus acting in a complementary way to the transposition cipher. In transposition each letter retains its identity but changes its position, whereas in substitution each letter changes its identity but retains its position.

      The first documented use of a substitution cipher for military purposes appears in Julius Caesars Gallic Wars. Caesar describes how he sent a message to Cicero, who was besieged and on the verge of surrendering.