📜 ⬆️ ⬇️

Cryptography and secure communication: the history of the first ciphers

Cryptography and encryption for thousands of years used by people to protect their secrets. With some degree of conventionality, this story can begin with ancient Egypt.

Ancient Egypt


The most ancient text with elements of cryptography was found in the tomb of the ancient Egyptian grandee Khnumhotep II, the hereditary prince and nomarch of Menat-Khufu, who lived almost 4,000 years ago. Somewhere around 1900 BC The clerk of Khnumhotep described the life of his master in his tomb. Among the hieroglyphs, he used several unusual characters that hide the direct meaning of the text. This encryption method is actually a substitution cipher, when elements of the source text are replaced by other elements according to certain rules.


Symbols from the tomb of Khnumhotep II and their decoding
')
As the Egyptian culture developed, the replacement of hieroglyphs was increasingly common. There are different versions of why the Egyptians used such an encryption system. According to one version, they wanted to protect their religious rituals from ordinary people. According to another version, thus the scribes gave the text a kind of formal form, as in our time, lawyers use specific expressions to replace ordinary words. As now, Egyptian cryptography could also be a scribe's way to impress other people - to show that he can communicate at a higher level than they.

Ancient Greece


Approximately 500 g BC The Spartans developed a device called a hermitage, created to send and receive secret messages. It was a cylinder wrapped in a spiral with a narrow strip of parchment. The message was written along the wanderings, but if the strip was unfolded, it became unreadable. For the reading of the text, a wander of the same diameter was required. Only in this case, the letters became in a row to restore the original message.


Sample wanderers

A skitala is an example of a permutation cipher in which elements of the source text are swapped, and not replaced by other characters. By modern standards, it would be very easy for a wander to be hacked, but 2,500 years ago very few people could read and write. Skitala provided the Spartans with a secure connection.

Ancient Rome


The earliest known method of military use of cryptography belongs to Julius Caesar. About 2000 years ago, Caesar, as commander of the Roman army, solved the problem of secure communications with his regiments. The problem was that messengers with secret military messages were often intercepted by the enemy. Caesar developed a substitution cipher in which he replaced one letter with another. Only those who knew the lookup table could decrypt the secret message. Now, even if the messenger falls into the hands of the enemy, the encryption will not be declassified. This gave the Romans a huge advantage in the war.


Substitution Cipher Example

Unlike the example in this illustration, Caesar usually simply shifted the letters by some specific number. This number was the encryption key for its algorithm. The random order of replacing characters provides much better security due to the greater number of possible replacement tables.

Alberti-Vigenera cipher


In the middle of the 15th century, an Italian scientist, architect, sculptor, painter and mathematician Leon Batista Alberti invented an encryption system based on an encryption disk. It was a mechanical device with sliding disks, which allowed for many different methods of character substitution. This is the basic concept of a multi-alphanumeric cipher, in which the encryption method changes directly during the encryption process. In his book Crackers of Codes, David Kahn calls Alberti "the father of Western cryptography." Alberti never realized his concept of a encryption disk, it remained only on paper.


Cipher disk

In the 16th century, a French diplomat, Blaise Vizhener, based on the concept of a multi-alphanumeric cipher, Alberti created a cipher, which was called the Vigenere cipher. It works exactly like Caesar's system, except that the key changes during the encryption process. The Vigenere cipher uses a lattice of letters that defines the substitution method. It is called the Vigenere square or Vigenere table. The grid consists of 26 alphabet lines offset by one character relative to each other.



The method of changing one key to another follows a simple pattern. A special secret word is selected as the encryption key. Each character in the source text is replaced using a table. To determine which letter needs to replace the first character, we combine the first character of the source text (along one axis) with the first symbol of the secret word (along the other axis). The method is repeated for the second and each subsequent letters, the secret word is used repeatedly until the characters in the source text run out.

Suppose you need to encrypt this phrase:

ATTACKATDAWN («  ») 

The sender of the message selects the secret word and repeats it until the end of the source text. For example, LEMON.

 LEMONLEMONLE 

To encrypt the first character, you need to align row A with column L (the result is L), to encrypt the second symbol — string T with column E (result is X) and so on. Here is the result:

  :   ATTACKATDAWN  :   LEMONLEMONLE :       LXFOPVEFRNHR 

Decryption is performed in the same way: the letter in the text of the message (diagonal lines of the table) is combined with the letter of the secret word in the columns or rows of the table.

Jefferson Disc Encryption


At the end of the 18th century, Thomas Jefferson came up with an encryption system that is very similar to the Vigenère code, but with better protection. His encoder consisted of 26 discs with letters of the alphabet randomly placed on each. The discs were numbered and mounted on the cylinder in a specific order. The key is the order of the disks on the axis.


Jefferson Disc Encryption

To encrypt a message, you need to make the source text in one of the rows of the cylinder. Encrypted text will be any other string. The recipient of the message should arrange the disks in the correct order, and then make a string of cipher text on the cylinder. Then a quick visual inspection of the cylinder will immediately reveal the text of the original message. Almost zero probability that in the rows of the cylinder there will be two messages that are not without meaning.

Like Alberti, Jefferson never used his encryption system. At the beginning of the 20th century, the American army cipher machines invented the Jefferson cylinder anew, without knowing anything about this invention. Jefferson was ahead of his time by more than a hundred years. The US Army used such an encryption system from 1923 to 1942.

Source: https://habr.com/ru/post/321338/


All Articles