Secret messages – Magazine ?

Since civilizations understood the value of information as an element of power, cryptography emerged: an exciting discipline that has changed the course of history several times.

We are in Rome, in the year 58 BC. C., when the news arrives that nearly 400 thousand Helvetians, established in what is now Switzerland and its surroundings, are preparing to emigrate to southern Gaul fleeing from the Germans. To do this they will have to cross the Roman province governed by the newly appointed proconsul Gaius Julius Caesar.

At that time Caesar is visiting Rome. As soon as he hears the news, he leaves with the only available legion for Geneva, the capital of his province. The situation is critical for Caesar, who needs to buy time in order to prepare the defense of the province. He therefore decides to send a messenger. It is essential both that the message reaches its destination and that it does not fall into the hands of those who could take advantage of the delicate situation. The messenger leaves immediately. After traveling tirelessly, our man arrives at his destination without any other setback than several nights of late sleep. Mission accomplished.

The message he transmitted was the following:

OHYDQWDOLQHDGHIHQVLYDDOQRUWHBUHVLVWHKDVWDPLOOHJDGD

Cryptography, an ancient science

Cryptography is a term derived from the Greek words kryptoswhich means “hidden” and graphien, which means “to write.” The objective of cryptography is, therefore, to hide the meaning of a message, through a general method known as encryption algorithm. This encryption is specified exactly by a set of pre-established rules between the sender and receiver of the message, which we will call the key. The message that you want to encrypt is usually called plain text, and ciphertext is the one that is generated by applying the algorithm together with the key.

Figures as diverse as the Roman Emperor Augustus, the Queen of Scots Mary Stuart, Louis XIV “The Sun King” and the commander Che Guevara used cryptography regularly in their private communications. And since man understood the value of information as an element of power, cryptography emerged. For this reason, where cryptography has found the most practical applications has been in the military and political field. As in the example, Caesar frequently used secret writing, and he even invented his own encryption algorithm or “cipher” (see box), which consisted of replacing each letter with another located three positions later. In general, the algorithm involves replacing each letter of the alphabet with a letter of the encrypted alphabet. The key defines the exact encrypted alphabet, which in this case has been moved three places from the normal alphabet. With all this, could you tell me what message Julius Caesar sent?

This type of cryptography is called substitution cryptography, because each letter of the initial message is replaced by a different one. In transposition the letters of the message simply change places, generating an anagram. An example of historical transposition is that of the Spartan scythalus, the first military cryptographic device in history. The scythalus was a staff, of which there were two identical specimens. The sender wound a leather strip around the cane and wrote the message he wanted to convey longitudinally on it. The tape was then removed, leaving an incomprehensible message – the message had been encrypted – and it was sent to the recipient, who had a copy of the scythalus. By placing the ribbon on the staff, the message was recovered, which was impossible if the exact diameter of the scythalus was unknown. In this way, Sparta could transmit secret orders to the generals of its army during military campaigns.

Both substitution and transposition cryptography are included in symmetric secret key cryptography. It is symmetric because sender and receiver must have the same key to encrypt and decrypt messages. And it is secret because once the key is known, the message becomes transparent to anyone. This has posed serious problems throughout history, since the key had to be transmitted through secure channels, normally by completely trusted personal emails. Furthermore, in the event that the mail could not reach the recipient, he or she was isolated. The problem of key distribution was not fully solved until the last quarter of the 20th century.

Figures and codes

Although colloquially both terms are used interchangeably, strictly speaking a “code” and a “figure” are two different concepts. The essential difference between the two is that a figure is defined as a substitution at the level of letters, while a code is defined as a substitution at the level of words and even phrases. With the exception of the Navajo code, the rest of the examples in this article are not codes, but figures. Therefore, we speak here of encrypting or deciphering a text, instead of encoding or decoding it.

An advantage of coding is that it usually involves compression of information, but it has a major drawback. If we want to send an encrypted message, the sender and receiver must agree on the key, that is, on the 26 letters of the encrypted alphabet. And with a code? How many words can be used? They would then have to agree on each and every one of them. And it could be hundreds or thousands. Like a dictionary. And if in the worst case the codebook is intercepted by the enemy, the task of generating a new one is very slow, compared to that of generating a new cipher.

Cryptanalysis

The Arabs were the first to develop techniques to decipher a message without knowing its key, a science known as cryptanalysis. The 9th century scientist, Al Kindi, is credited with developing the technique to decipher monoalphabetic substitution cryptography (like that of Julius Caesar, where each letter corresponds to one and only one different letter), which had remained impregnable for centuries. . Al Kindi’s technique is known as frequency analysis and consists of studying the frequency with which each letter of the alphabet appears in normal text in a language. In the case of Spanish, the most frequent letter is “a”, unlike, for example, in English, where it is “e”. So, if we take an encrypted text (which we know is in Spanish), of a certain length, and it turns out that the letter that is repeated the most is, say, “g”, it seems clear to think that “a” has been encrypted as a G”. Obviously it’s not that simple, but by proceeding with logic and applying some tricks (such as focusing on words with a single letter or syllable, or trying to figure out what the vowels are) you can decipher the message. The best way is to try it yourself, so I challenge you to decipher these four verses from a poem by Humberto Zarrilli. A clue: in the plain text the letter that was repeated the most was “a”. Would you be able, with just this information and using the tricks I told you above, to decipher the text? What if I told you that it was a Caesar cipher, but with a different offset? What is the key that was used?

QFQZSFQQ J SF DJQ XTQ XJ UZ XN JWTS F OZLF W; FQ JX HTSIN YJ OZLFGFS ZSF YFWIJ, KWJSYJ FQ RF W.

With the birth of cryptanalysis, a battle began between creators of encryption algorithms and decryptors that has not ceased to this day. This battle of wits has been the driving force behind notable scientific advances (and others that are not so scientific, unfortunately) and once again demonstrates to us the inexhaustible capacity for human improvement.

The cultural and political framework of the Renaissance was ideal for the development of cryptography in the West: on the one hand, the resurgence of the sciences; on the other, the continuous wars and countless machinations and conspiracies between States. For all these reasons, cryptography became a routine diplomatic tool, and the different European courts created the first departments dedicated exclusively to cryptanalysis.

During this time, the so-called polyalphabetic substitution cryptography was developed, which consisted of a mixture of monoalphabetic substitutions. In this way, it turned out that the same letter in the original text could end up represented by different letters in the ciphertext, thus being impregnable to frequency analysis. The most famous method is the one known as the “Vigenère board”, a table made up of the plain alphabet followed by 26 coded alphabets, each of them starting with the next letter from the previous one. To encrypt a message with the Vigenère board and the key ICE (for example), the first thing is to repeat the key over the plain text as many times as necessary, until each letter of the message is associated with a letter of the key. To encrypt each letter, we look for the line on the Vigenère board identified by the key letter (the line such that A is encrypted as the key letter), and on that line we look for the cipher corresponding to the plaintext letter :

Plain text:

REINFORCEMENTS WILL ARRIVE BY SEA ON DAY SEVEN

Clue:

HIELOHIE LOHIELOHI ELO HIE LO HIE LOHIE

Ciphertext:

STIRO YIR CSMCICNVA TZF TIV PZKQE DWLBI

In this example, to encrypt the first letter of the message, L, we start from the first line of the Vigenère board (which is the plain alphabet) and look downwards for the correspondence of the letter A of this line with the first letter of the key: H (see figure). This correspondence is on line 8. Then, we look for the first letter of the plaintext, L, on the first line and its correspondence on line 8; the result is the letter S. For the second letter of the plaintext, which is also L, the correspondence is between the first line and 9 (where A is encrypted as I, which is the second letter of the key); In this case, L corresponds to the letter T. For the rest of the message, the same procedure is followed. Could you do it the other way around, that is, decipher a message using the Vigenère board? We propose this one, where the key is FLOOR:

RWEC KMK

The polyalphabetic nature of the Vigenère board or cipher is what gives it its strength, but also makes it much more complicated and time-consuming to use. Military communications, in particular, required speed and simplicity. For all these reasons, and despite its evident solidity as a cryptographic system, the Vigenère board fell into disuse.

The telegraph and the radio

The evolution of cryptography is undoubtedly linked to the development of communications. Therefore, we are going to jump to the beginning of the 19th century, in which the invention of the telegraph revolutionized communications throughout the world. For the first time in the history of humanity, news spreads at the same speed at which it…