A Brief History of Cryptography
Cryptography is an ancient science, but, with the rise of the information age, computers have brought it to a whole new level. Online privacy and security both depend on encryption, and maintaining a strong standard is more important than ever.
Cryptography is one of the oldest fields of technical study we can find records of, going back at least 4 000 years. Ciphering has always been considered vital for diplomatic and military secrecy.
Cryptography probably began in or around 2000 B.C. in Egypt, where hieroglyphics were used to decorate the tombs of deceased rulers and kings. These hieroglyphics told the story of the life of the king and proclaimed the great acts of his life. They were purposefully cryptic, but not apparently intended to hide the text. Rather, they seem to have been intended to make the text seem more regal and important. As time went by, these writings became more and more complicated, and eventually the people lost interest in deciphering them. The practice soon died out.
The ancient Chinese used the ideographic nature of their language to hide the meaning of words. Messages were often transformed into ideographs for privacy, but no substantial use in early Chinese military conquests is apparent. Genghis Khan, for example, seems never to have used cryptography.
In India, secret writing was apparently more advanced, and the government used secret codes to communicate with a network of spies spread throughout the country. Early Indian ciphers consisted mostly of simple alphabetic substitutions often based on phonetics. Some of these were spoken or used as sign language.
The cryptographic history of Mesopotamia was similar to that of Egypt, in that cuneiforms were used to encipher text. This technique was also used in Babylon and Assyria. In the Bible, a Hebrew ciphering method is used at times. In this method, the last letter of the alphabet is replaced by the first, and vice versa. This is called 'atbash'.
The Greek writer Polybius invented the 5 x 5 Polybius Square, widely used in various cryptographic systems. Julius Caesar used a system of advancing each letter four places, commonly called a Caesar shift.
During the Middle Ages, cryptography started to progress. All of the Western European governments used cryptography in one form or another, and codes started to become more popular. The earliest ciphers involved only vowel substitution (leaving consonants unchanged).
By 1860 large codes were in common use for diplomatic communications, and cipher systems had become a rarity for this application. Cipher systems prevailed, however, for military communications except for high-command communications because of the difficulty of protecting codebooks from capture or compromise in the field.
The invention of telegraph and radio pushed forward the development of cryptographic protection of telecommunications: the speed and the volumes of data traffic became considerable and more vulnerable to interception and decryption. The radio espionage was closely following the development of new telecommunications technologies, but paradoxically, the telegraphic and radio exchange of information was mainly in clear or done in plain ciphers.
It was not until the 20th century mathematical theory and computer science have both been applied to cryptanalysis. As the science of cryptology becomes increasingly sophisticated, most nations have found it necessary to develop special governmental bureaus to handle diplomatic and military security (the National Security Agency in the United States). The widespread use of computers and data transmission in commerce and finance is making cryptography very important in these fields as well. Recent successes in applying certain aspects of computer science to cryptography seem to be leading to more versatile and more secure systems in which encryption is implemented with sophisticated digital electronics. Industry, however, have argued over who will have ultimate control over data encryption and, as a result, over government access to encrypted private transmissions.
Great minds in Cryptography
There are many notable personalities who participated in the evolution of Cryptography.
The Greek philosopher and writer Polybius arranged the alphabet into a squared grid or matrix. By numbering the rows and columns, letters could be transformed into other paired characters. The Polybius square's features of splitting a character into two parts, reducing the number of characters needed and ability to convert letters into numbers is still used in modern algorithms.
Julius Caesar used his famous substitution cipher (the 'Caesar Cipher'), which shifted each letter four places further through the alphabet.
The first European manual on cryptography (c. 1379) was a compilation of ciphers by Gabriele de Lavinde of Parma, who served Pope Clement VII. This manual, now in the Vatican archives, contains a set of keys for 24 correspondents and embraces symbols for letters, nulls, and several two-character code equivalents for words and names.
The Italian architect and writer Leon Battista Alberti is known as "The Father of Western Cryptology" in part because of his development of polyalphabetic substitution. Polyalphabetic substitution is any technique which allows different ciphertext symbols to represent the same plaintext symbol. This makes it more difficult to interpret ciphertext using frequency analysis. He did this by designing a cipher disk to simplify the process (c. 1466-7). This class of cipher was apparently not broken until the 1800's.
The next major step was taken in 1518, by Trithemius, a German monk. He wrote Polygraphia, the first printed work on cryptology. He devised a table that repeated the alphabet with each row a duplicate of the one above it, shifted over one letter.
The resulting series of words would be a legitimate prayer. He also described polyalphabetic ciphers in the now-standard form of rectangular substitution tables. He introduced the notion of changing alphabets with each letter.
In 1553, Giovan Batista Belaso came up with the idea of the password. He chose a keyword that is written above the plaintext, in a letter-to-letter correspondence. The keyword is restarted at the beginning of each new plaintext word. The letter of the keyword above the letter of the plaintext is the first letter of the cipher line to be used. In other words, if the plaintext letter is 'c', and it's keyword letter is 's', then the line of the Trithemius cipher beginning with 's' is used to encipher the letter 'c'.
Giovanni Battista Porta wrote in 1563 a text on ciphers, introducing the digraphic cipher. He said that the three types of ciphers were transposition, substitution, and symbol-substitution (use of a strange alphabet).
The most famous cryptographer of the 16th century was Blaise de Vigènere (1523-1596). In 1585, he wrote Tracte des Chiffres in which he used a Trithemius table, but changed the way the key system worked. One of his techniques used the plaintext, as it's own key. Another used the ciphertext.
Sir Francis Bacon celebrated bilateral cipher (1623) was an arrangement of the letters "a" and "b" in five-letter combinations, each representing a letter of the alphabet. This code illustrates the important principle that a code employing only two different signs can be used to transmit information.
The 'wheel cipher' was invented by Thomas Jefferson around 1795, and although he never did very much with it, a very similar system was re-invented for use in World War II by the US Navy, which then called it the Strip Cipher. Jefferson's wheel cipher consisted of twenty-six cylindrical wooden pieces, each threaded onto an iron spindle. The letters of the alphabet were inscribed on the edge of each wheel in a random order. Turning these wheels, words could be scrambled and unscrambled.
In 1859, Pliny Earle Chase, developed what is known as the fractionating or tomographic cipher. A two-digit number was assigned to each character of plaintext by means of a table. These numbers were written so that the first numbers formed a row on top of the second numbers. The bottom row was multiplied by nine, and the corresponding pairs are put back in the table to form the ciphertext.
The British scientist Sir Charles Wheatstone (1802-1875) developed the Playfair Code, a table system that was easy to use. Although not difficult to analyze, it did muddle character frequency techniques by the use of digraphs (coding two letters at a time).
Friedrich W. Kasiski developed a cryptanalysis method in 1863 which broke almost every existing cipher of that time. The method was to find repetitions of strings of characters in the ciphertext. The distance between these repetitions is then used to find the length of the key. This technique makes cryptanalysis of polyalphabetic substitution ciphers quite straightforward.
In 1883, the French teacher and writer Auguste Kerckhoffs wrote 'La Cryptographie Militaire' in which he set forth six basic requirements of cryptography. He formulated procedures for long-term diplomatic codes as well as inventing the superpositioning technique for code breaking.
In 1917, the Americans formed the cryptographic organization MI-8, with Herbert Osborne Yardley as the director. They analyzed all types of secret messages, including codes, secret inks and encryptions. They continued with much success during and after WW1. Yardley wrote a best seller, The American Black Chamber, describing the workings of MI-8. Another American, William Frederick Friedman, worked with his wife, Elizebeth Smith, and they became an important husband-and-wife team in the history of cryptology.
In 1929, Lester S. Hill published an article Cryptography in an Algebraic Alphabet in which a block of plaintext is enciphered by a matrix operation. Hill's major contribution was the use of mathematics to design and analyze cryptosystems.
Arthur Scherbius, inventor of the Enigma Machine, tried to sell it commercially, but he had no success with that. It was eventually taken over and improved by the German government who used it to encrypt military communications in World War II. It was broken by the Polish mathematician, Marian Rejewski, based only on captured ciphertext and one list of three months worth of daily keys obtained through a spy. Continued breaks were based on developments during the war by Alan Turing, Gordon Welchman and others at Bletchley Park in England (1933 - 1945). The British engineer Tommy Flowers built Colossus (the world's first programmable electronic computer) to also help Bletchley Park crack German codes.
The Japanese Purple machine was invented in response to revelations by Herbert O. Yardley and broken by a team headed by William Frederick Friedman. The Purple machine used telephone stepping relays instead of rotors and thus had a totally different permutation at each step rather than the related permutations of one rotor in different positions.
In 1948, Shannon published A Communications Theory of Secrecy Systems. Shannon was one of the first modern cryptographers to attribute advanced mathematical techniques to the science of ciphers. Although the use of frequency analysis for solving substitution ciphers was begun many years earlier, Shannon's analysis demonstrates several important features of the statistical nature of language that make the solution to nearly all previous ciphers very straight forward.
Dr. Horst Feistel led a research project at the IBM Watson Research Lab in the 1960's which developed the Lucifer cipher.
In 1976, Whitfield Diffie and Martin Hellman published "New Directions in Cryptography", introducing the idea of public key cryptography. They also put forth the idea of authentication by powers of a one-way function.
Inspired by the Diffie-Hellman paper and acting as complete novices in cryptography, Ronald L. Rivest, Adi Shamir and Leonard M. Adleman had been discussing how to make a practical public key system. They invented the RSA computer-encryption algorithm. RSA is a public key algorithm based on the difficulty of factoring large numbers. The algorithm was published in the September 1977 issue of Scientific American. Even today, it is used to keep text secret.
Pretty Good Privacy (PGP) was released in 1991 by American Phil Zimmerman. To this day, it is considered a very secure way of communication across the Internet. PGP employs a public key system so that the sender cannot determine the key used to decrypt the message, even if he knows the key for encrypting the message. PGP is designed so that it can be integrated into email packages, thus allowing it to be used by the average citizen.
The Politics of Cryptography
Ciphering has always been considered vital for military and diplomatic secrecy. Empires and nations have frequently owed their existence to the security of their communications, as information that falls into the wrong hands can give an enemy a crucial advantage. Historians believe that the deciphering of the German Enigma codes by British intelligence at Bletchley Park in World War II played a key role in the allied victory. Indeed, the Allies went to great lengths to prevent the Germans from discovering that the Enigma had been broken. For instance, when the British discovered the locations of five German tankers refueling submarines in the Atlantic, they sank only three. If the British had taken out all five tankers, the Germans might have become suspicious.
Is cryptography a weapon? Its relation to military operations seems to be rather that of a support function. An army needs jeeps, radios, food and clothes, just as it needs a way to report observations, and receive orders, that cannot be overheard by its rivals.
Here are a few historical events where cryptography had played an important role.
The Spartans of Greece created the first military form of cryptography. They used a system which consisted of a thin sheet of papyrus wrapped around a staff (known as a skytale). This was used in the 5th century B.C. to send secret messages between Greek warriors. The secret key of the text is the circumference of the wood. With the wrong circumference, the message is unusable. If the wood matches, you are able to read the message.
In the latter part of the Middle Ages the use of secret writing increased. European cryptology dates from the Middle Ages, during which it was developed by the Papal States and the Italian city-states. The first brief code vocabularies, called nomenclatures, were gradually expanded and became the mainstay for several centuries for diplomatic communications of nearly all European governments. In 1628, a Frenchman named Antoine Rossignol helped his army defeat the Huguenots by decoding a captured message. After this victory, he was called upon many times to solve ciphers for the French government. When Rossignol died in 1682, his son, and later his grandson, continued his work. By this time, there were many cryptographers employed by the French government. Together, they formed the "Cabinet Noir" (the "Black Chamber"). By the 1700's, "Black Chambers" were common in Europe, one of the most renown being that in Vienna. It was called 'The Geheime Kabinets-Kanzlei' and was directed by Baron Ignaz de Koch between 1749 and 1763. This organization read through all the mail coming to foreign embassies, copied the letters, resealed them, and returned them to the post-office the same morning. The same office also handled all other political or military interceptions, and would sometimes read as many as 100 letters a day.
The English Black Chamber was formed by John Wallis in 1701. Until that time, he had been solving ciphers for the government in a variety of unofficial positions. After his death in 1703, his grandson, William Blencowe, who was taught by his grandfather, took over his position and was granted the title of Decypherer. The English Black Chamber had a long history of victories in the cryptographic world.
In the early history of the United States, codes were widely used, as were book ciphers. During the American Civil War (1861-1865) ciphers were not very complex. Many techniques consisted merely of writing words in a different order and substituting code words for proper names and locations. The Confederate Army primarily used the Vigenère cipher and on occasion monoalphabetic substitution.
In the beginning of the 20th century, war was becoming likely in Europe. During World War One, England spent a substantial effort improving its cryptanalytic capabilities so that when the war started, they were able to solve most enemy ciphers. The cryptanalysis group was called 'Room 40' because of its initial location in a building in London. Their greatest achievements were in solving German naval ciphers. These solutions were greatly simplified because the Germans often used political or nationalistic words as keys, changed keys at regular intervals and gave away intelligence indicators when keys were changed. The United States had initially chosen to remain neutral during World War One (1914-1918). However, when Germany broke its pledge not to engage in submarine warfare, the United States decided to break all diplomatic relations with Germany. British cryptographers broke the Zimmerman Telegram (1917), a secret German communication to Mexico in which the Germans offered Mexico United States territory in return for joining the German cause. When the American public realized this, their opinion changed in favour of joining the war with the allies. It is believed that no other single cryptanalysis has had such enormous consequences as the deciphering of the Zimmerman Telegram.
The ADFGVX system was put into service by the Germans near the end of World War One. This was a cipher which performed a substitution (through a keyed array), fractionation and then transposition of the letter fractions. It was broken by the French cryptanalyst, Lieutenant Georges Painvin.
In 1939, Japan had started using their PURPLE code, one of the most complex codes of World War II. However the Americans (under the direction of Chief Cryptanalyst William Friedman) had great success at breaking Japanese codes. (The US Navy, having broken Japans' ORANGE and RED codes in the 1920's, had experience in the formal language used by the Japanese in their communications.) While the Japanese, unable to break US codes, assumed that their codes were also unbreakable.
The cracking of the Enigma machine used by the Germans during World War II is believed to be one of the greatest achievements in the field of cryptanalysis. The Enigma was an electrical enciphering machine (and looked like a typing machine), which provided better encryption of messages than other machines at the time because of the concept of rotating rotors. Originally built for commercial use, it was soon put to use by the Germans for securing their radio communications during the War. They believed the machine to be invincible as the likelihood of breaking a message enciphered by the Enigma was too remote a possibility to consider.
The initial work on cryptanalysing Enigma began during peacetime by the Polish Cipher Bureau. They had managed to acquire a commercial Enigma, and three young mathematicians led by Marian Rejewski began to work on it. By early 1933, they had figured out the complex ciphers using a combination of math, statistics, computational ability and guesswork.
When the Second World War began, the Poles, realizing that a German invasion was imminent, handed over all the information to the British. The British cipher department later came to be known as the famous Bletchley Park. It was here that the young English mathematician, Alan Turing, started work on the Enigma. Turing, collaborating with another British mathematician Gordon Welchman, further enhanced this machine which came to be known as the Turing Bombe. This Bombe was in effect a collection of Enigma machines and this played a key role in the cracking of the Enigma cipher. This was the first recorded instance of an electro-mechanical device being used in cryptanalysis.
Fish was used by the German army in WWII to encipher high-command communications. It was produced by a stream cipher called the Lorentz machine. Fish was the name given to it by British cryptanalysts. It was important because it caused difficulties for British analysts, who finally developed a machine called Colossus, which was arguably the first, or one of the first, digital computers. The Colossus machine may have been an important factor in the planning and success of the Allied attack on Normandy. Given the intelligence produced by cryptanalysis of Fish, Allied forces knew the positions of pretty much every German division.
Did you know: CryptoBytes
Egyptians used alternate hieroglyphs while inscribing tablets, the first documented use of written cryptography. The place was Menet Khufu, which borders the Nile River. The writer of these tablets did not use a completely different set of hieroglyphs, though. Instead, his was a system of partial substitution, with some unusual hieroglyphs here and there.
To hide messages, generals in ancient Greece used the shaved head of a servant, tattooed the message on his bald scalp, waited a week, and then sent the servant on his way. The secret message was concealed under a fresh growth of hair.
The Arabs were the first to make significant advances in cryptanalysis (the practice of changing ciphertext into plaintext without complete knowledge of the cipher).
Abu Yahmadi, creator of the first Arab dictionary, wrote a book in 725 on how he solved a Byzantine cryptographic puzzle written in Greek. His method of attack started on an assumption that the puzzle began with "In the name of god," and so he worked out the rest from that assumption. This method of attack is the same one that was employed in World War II to break German communications.
Subhalasha, an Arabic Encyclopedia (1412), contained a section on Cryptography. Ciphers cited are substitution and transposition. Also, it mentioned running a text through multiple substitution ciphers.
In the famous Greek drama the Iliad, cryptography was used when Bellerophon was sent to the king with a secret tablet which told the king to have him put to death. The king tried to kill him by having him fight several mythical creatures, but he won every battle.
The first major advances in cryptography were made in Italy. Venice created an elaborate organization in 1452 with the sole purpose of dealing with cryptography. They had three cipher secretaries who solved and created ciphers that were used by the government.
But during the Spanish Inquisition epoch the cryptography was doomed and persecuted being considered black magic and Satanic deed.
In the period of Renaissance the creativity in many spheres also gave impulse to cryptography as a science and as an art of secret communications between the monarchs and emperors, like Leonardo da Vinci, Cardinal Richelieu and the Kings of France Louis XII-XIV. The "coding of messages", the substitution of words and figures by symbols and numerals of previously agreed character became wisely used in government correspondence. And the services of specialists in coding and decoding of secret letters became available as a result of this practice.
The Kama Sutra of Vatsayana lists cryptography as the 44th and 45th of 64 arts (yogas) men and women should know and practice. The date of this work is unclear but is believed to be between the first and fourth centuries, AD. In this list of arts, the 44th and 45th read: The art of understanding writing in cipher, and the writing of words in a peculiar way. The art of speaking by changing the forms of words. It is of various kinds. Some speak by changing the beginning and end of words, others by adding unnecessary letters between every syllable of a word, and so on.
The Equatorie of the Planetis (1392), possibly written by Geoffrey Chaucer, contains passages in cipher. The cipher is a simple substitution with a cipher alphabet consisting of letters, digits and symbols.
Breaking codes can make or break historical figures. A good example of how codes can change history, is the story of Mary Queen of Scots, a Catholic who was chased out of an increasingly Protestant Scotland in the 16th Century. Mary fled to England looking for protection from her cousin Elizabeth, the queen of England, but instead she received 19 years in prison. Sir Francis Walsingham, Elizabeth's principal secretary suspected that Mary was actively involved with a man called Anthony Babington to overthrow Elizabeth. Walsingham intercepted messages that Mary had written to Babington in a secret cipher. Little did they know that the person helping them smuggle messages was a double agent working for Queen Elizabeth. Walsingham handed the messages over to a man called Thomas Phelippes to decode. This he eventually did, and Mary effectively signed her own death warrant.
Just because we can't understand a text does not mean that it was necessarily meant to be kept secret. Sometimes it is just that we have lost the art of decoding them. The ancient Egyptians used hieroglyphs, as their means of written communication and for thousands of years this script was a mystery to scholars. In 1799, a French team discovered a slab of stone, now known as the Rosetta Stone, which is permanently housed in the British Museum. The Rosetta Stone contained three scripts, hieroglyphics at the top, demotic (the simplified form of ancient Egyptian writing) in the middle and Greek at the bottom. Over the course of many years, using the Rosetta Stone as a reference point, scholars gradually unraveled the mysteries of hieroglyphics.
The writer Edgar Allan Poe had a great fascination with cryptography. Besides numerous references to it in his stories, he conducted his own cryptographic challenge in December 1839. This challenge was published in Alexander's Weekly Messenger, and in it he asked the readers to submit their cryptographs to him, asserting that he would solve them all. He was true to his word and for the next six months, Poe managed to decipher all the codes submitted by his readers. A year later he was sent two cryptographs by one of his readers, Mr. W.B.Tyler. Poe published these cryptographs in the magazine for his readers to solve, but never published the solutions himself. Many believe that W.B.Tyler was a pseudonym for Poe himself, and that he was the author of the cryptographs, which remained unsolved for decades.
The first US Patent on a cryptographic device was filed in 1861. About 1,800 patents on the field have been issued since.
In 1895, radio was invented. The importance of this to cryptology is immense. During times of War, it allowed for enemy communications to be intercepted in mass. Thus, the profession of cryptanalysis, or the breaking of encrypted messages, was born.
Gilbert S Vernam created a machine in 1917 that makes a non-repeating, virtually random sequence of characters (often called a one-time pad). Using an encryption key the same length as the message, and never using that key again is the only proven method of securely communicating. However, it is impractical under most circumstances because all parties must have a long and identical key, which presents a logistical nightmare for everyday use.
In 1918, the United States employed eight American Indians from the Choctaw tribe to relay important messages across insecure communication channels in their native tongue. Since Native American languages are extremely complex and difficult to learn, this allowed for simple and effective encryption. During World War II they repeated this trick with the Navaho code talkers.
The greatest era of international smuggling - Prohibition (in the 1920s) - created the greatest era of criminal cryptology. (To this day, the FBI runs a cryptanalytic office to deal with criminal cryptography.) During Prohibition, alcohol was transported into the country by illegal smugglers who used coded radio communication to control illegal traffic and help avoid Coast Guard patrols. In order to keep the Coast Guard in the dark, the smugglers used an intricate system of codes and ciphers. The Coast Guard hired Mrs. Elizebeth Smith Friedman to decipher these codes, and thus forced the smugglers to use more complex codes, and to change their keys more often. She succeeded in sending many of them to jail.
In 1924, Alexander von Kryha produced his "coding machine" which was used, even by the German Diplomatic Corps, into the 1950s. However, it was cryptographically weak - having a small period. A test cryptogram of 1135 characters was solved by the US cryptanalysts Friedman, Kullback, Rowlett and Sinkov in 2 hours and 41 minutes. Nevertheless, the machine continued to be sold and used - a triumph of salesmanship and a lesson to consumers of cryptographic devices.
In the 1930s, the British developed the TYPEX encryption machine, based on the commercial Enigma from the 1920s. This machine contained five rotors, each of which changed letters of the alphabet to other letters. After each character of the message being encrypted was typed, the rotors changed positions, creating an entirely new encryption scheme for the next letter. Reversing the process decrypted the message.
In 1937, the Japanese invented the PURPLE machine to encrypt messages. This machine was a totally new concept to cryptography. All machines prior to it used rotors to change the position of letters in the alphabet. Instead, the Purple Machine used telephone stepping switches, and thus standard cryptanalytic techniques were useless against it. US cryptographer William Friedman eventually broke the code generated by this machine.
The Bombe, a machine that decodes Enigma messages, was invented in 1940.
The workload of (Russian) code machine operators was enormous: between 1941 and 1945 they coded and decoded more than 1,6 million messages (or 1500 telegrams in cipher per day). By the end of the war, the cryptographic service of the General Staff of the Army comprised some 5000 specialists and the amount of coding machines involved in the providing of security of telecommunications reached some 396 units.
The Lucifer cipher was developed at IBM in 1970. This eventually evolved into DES, which was accepted as the official US standard, only recently replaced by AES. DES was strengthened in the form of triple-DES, an algorithm accepted worldwide as relatively secure.
"New Directions in Cryptography" was published in 1976, introducing the concept of public-key cryptography, which forms the basis of Internet encryption. The book also focuses on the powers of authentication via a one-way function, where the authenticator does not need to know the actual password.
In 1990, mathematicians from Switzerland invented the International Data Encryption Algorithm (IDEA) to replace the aging DES. IDEA has 128 bits, meaning there are 340,282,366,920,938,463,463,374,607,431,768,211,456 possible keys. This algorithm also has the advantage of being able to be carried out quickly, because it uses math that comes naturally to computers.
In English, "e" is the most common letter, typically showing up 13 percent of the time. Code breakers look for such patterns, deducing that if a certain letter or symbol shows up more than any other, it probably stands for the letter "e."
During WW2, the neutral country Sweden had one of the most effective cryptanalysis departments in the world. It was formed in 1936, and by the time the war started, employed 22 people. The department was divided into groups, each concerned with a specific language. The Swedes were very effective in interpreting the messages of all the warring nations. They were helped, however, by bungling cryptographers. Often the messages that were received were haphazardly enciphered, or even not enciphered at all. The Swedes even solved a German cipher that was implemented on a Siemens machine similar to a Baudot machine used to encipher wired messages.
In a short story by Sir Arthur Conan Doyle, The Adventure of the Dancing Men, Sherlock Holmes is confronted by a simple substitution cipher. He solves the crime by deciphering a code in which the cipher text elements are hieroglyphics of little dancing men. Holmes figures these symbols are some kind of secret code. Using the method of frequency analysis, he substitutes the letter 'e' for the most commonly occurring figure. He also notices repetitions of certain poses, yet these dancers hold flags in their hands. Instead of counting these as different letters, he deduces that they mark word divisions. Following along these lines, and with the aid of some background knowledge of the squire's wife, he manages to crack the code and solve the case.