Oblivion of old ideas and attempts to invent the "old wheel"

    From the history of US cryptography



    Already at the end of the 18th century, cryptography was enriched by a remarkable invention - the Jefferson encoder , named after the statesman, first secretary of state, and then President of America Thomas Jefferson. Jefferson himself called his system "disk cipher." The well-known multi-alphabet replacement cipher implemented such a device.

    The encoder was a wooden cylinder, which was cut into 36 disks (although the number of disks could be different), which were mounted on one axis so as to independently rotate around it. On the side surfaces of the discs in a loose order - all the letters of the English alphabet.



    A line stood out parallel to the axis of the disk on the surface of the cylinder. Clear text was divided into groups of 36 characters, the first letter of the group was fixed by the position of the first disk on the selected line, the second by the second disk, etc. The cipher text was read from any line parallel to the selected one. For decryption, on a similar device, the resulting encrypted text was written out by turning the disks along a selected line, and plaintext was found among the lines parallel to it by meaningfully reading the possible options.



    A replica of Jefferson's plastic disk encoder. It has only 10 disks, not 36, but is well suited to demonstrate the operation of this encoder:







    Jefferson's invention was a harbinger of the emergence of disk encryptors, which were used in developed countries in the twentieth century. Oddly enough, during the life of the creator himself, the fate of this device was unsuccessful. Jnfferson himself was wary of the encoder and continued to use the nomenclators.
    For a period from about the 16th to the 19th centuries. typical was the so-called. nomenclator - a cipher, which is a combination of a replacement cipher and a small code. The nomenclator usually contained the code equivalents of the letters of the alphabet and the most common syllables, words and phrases, as well as a number of special characters. Most often, there were symbols specially created for this purpose, but often astrological and occult symbols were also used. The nomenclator was designed as an encryption system that was best suited to the most common cryptanalysis methods of that time, which usually included counting the frequency of occurrence in the text of each cipher symbol and a search in the text of words and expressions containing combinations of letters characteristic of a given language. The method of frequency analysis of letters is based on the fact that in any language some letters are more common, than others. In the English language, for example, the letter E is more often than others. The other most frequently occurring letters are T, A, O, N, R, and S. (This group of letters is easy to remember as a whole in the form of the word “SENORITA.”) And the letters J, K , X and Z are rare in English. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. In the English language, for example, the letter E is more often than others. The other most frequently occurring letters are T, A, O, N, R, and S. (This group of letters is easy to remember as a whole in the form of the word “SENORITA.”) And the letters J, K , X and Z are rare in English. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. In the English language, for example, the letter E is more often than others. The other most frequently occurring letters are T, A, O, N, R, and S. (This group of letters is easy to remember as a whole in the form of the word “SENORITA.”) And the letters J, K , X and Z are rare in English. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. the letter E is more common than others. The other most common letters are T, A, O, N, R, and S. (This group of letters is easy to remember as a whole in the form of the word “SENORITA.”) And the letters J, K, X, and Z are found in English is rare. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. more often than others, the letter E. The other most common letters are T, A, O, N, R, and S. (This group of letters is easy to remember as a whole in the form of the word “SENORITA.”) And the letters J, K, X, and Z are found in English is rare. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. The other most common letters are T, A, O, N, R, and S. (This group of letters is easy to remember as a whole in the form of the word “SENORITA.”) But the letters J, K, X, and Z are rare in English. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. The other most common letters are T, A, O, N, R, and S. (This group of letters is easy to remember as a whole in the form of the word “SENORITA.”) But the letters J, K, X, and Z are rare in English. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. (It is easy to remember this whole group of letters in the form of the word “SENORITA.”) But the letters J, K, X, and Z are rare in English. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. (It is easy to remember this whole group of letters in the form of the word “SENORITA.”) But the letters J, K, X, and Z are rare in English. Since the frequency of the letter does not change during the replacement operation, the key to unraveling the true value of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. The key to unraveling the true meaning of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged. The key to unraveling the true meaning of a given cipher symbol is sometimes to calculate the frequency of its appearance in the ciphertext. Likewise, the simple replacement operation does not change the letter combinations (letter patterns). For example, the word ATTACK, being encrypted, can take the form XJJXBU. Despite the fact that the meanings of the letters have changed, the letter model of the word (namely, two identical letters framed by the same letter on the left and right, followed by two different letters) has remained unchanged.


    The nomenclator of the ancient Romans was also called a slave, whose duties it was to know and call his master the names of the citizens of the city and all the slaves in the house, as well as to proclaim the names of the dishes served. But now is not about that. “Nomenclators” were the standard for diplomatic correspondence, spy messages and were the main means of anti-political conspiracy from the beginning of the fifteenth century to the end of the eighteenth century.

    Jefferson was very cautious about his invention and consulted with mathematician R. Patterson about it. As a result of this exchange of information, Patterson proposed his own cipher, which he said was more reliable, such a cipher was a vertical permutation with the introduction of "dummies", although in terms of strength it was significantly inferior to the Jefferson cipher.
    In the Patterson cipher, the message must be written from top to bottom and from left to right. Then it should be divided into several sections with a size of no more than nine lines. Lines in each section are numbered and shuffled in random order. The order of the lines in the section will give the first half of the key, for example: 5-1-3-2-4-7-6-8 for a section of eight lines.

    You can then insert from 0 to 9 random letters at the beginning of each line. The resulting sequence gives the second half of the key, for example, 1-7-9-3-3-2-1-1-7 (1 letter was inserted in the first line, 7 letters in the second, and so on). The message will have a torn right edge - at the end you can add a few more meaningless letters to align it.

    The key itself is written as a two-digit number, where tens are the number from the first half, and units are the number of meaningless letters added to the beginning. It is enough for the decoder to subtract from each line the specified number of letters and rearrange them in the necessary order (at the time of Patterson it was necessary to arm with scissors and re-stick the cut lines on a sheet of paper). The message is decrypted, it can again be read from top to bottom, and the nonsense at the right edge is simply ignored.


    Only in the XX century, the high strength of the Jefferson cipher was recognized, later it was used to encrypt messages by the American army during the Second World War, and the inventor himself was called the father of the "American encryption business."



    Throughout history, there have been several attempts to “reinvent the long-forgotten wheel” of Jefferson. At the beginning of the 20th century, Parker Hitt (again the United States) put the Jefferson cipher in a “strip cipher,” which was much simpler to manufacture. Stripes with a double alphabet were fixed in a frame, which was more technologically advanced than wooden discs with an alphabet. The meaning of encryption and decryption remained the same, however, complex disks were replaced with easily reproducible “strips” of solid material (for example, cardboard, metal). The significance of this invention is not in the emergence of new cryptographic ideas, but in the technological simplicity of their embodiment. At the end of 1937, the Japanese carried out a secret seizure in the building of the American Consulate in Kobe (Japan) and photographed the American embassy
    strip cipher. However, they could not take advantage of this extraction effectively, since the cipher strength was determined by a key system, which, in addition to the “strips”, included their choice and location on the tablet. The strips were replaceable, there were up to hundreds of them, and the choice of thirty active strips was set by the key table.

    Later, in the 20s of the last century, Jefferson’s cipher was “invented” once again. After that, cryptanalysts came to the conclusion that, despite its simplicity, this cipher is quite strong. As a result, the US Army adopted it and, as is believed, the use of this code led to the appearance of the first complex electromechanical devices.

    Long tape method




    In the early December morning of 1917, a handsome young man rushed between the massive columns of the lobby of the American Telephone and Telegraph (AT&T) building located in downtown New York. He ran into the elevator and climbed it to the 17th floor, where the telegraph office of the company, which was part of its research department, was located. This department, in which several of the most talented engineers worked, has already been engaged in bringing to mind the latest achievements in the field of telegraphy - the direct-printing telegraph apparatus, which the department called the teletype.

    The young man's name was Gilbert Wernham, and he was always a little late. Colleagues considered Vernam a very intelligent engineer and a capable inventor. Among them there were rumors that every evening, stretching out on the couch, he asked himself out loud: “What else would you invent?” Vernam had a rare mindset that allowed him to invent an original electric circuit and then transfer it to a drawing canvas, without reproducing all the required connections using wires. A great idea had already matured in his head. Vernam rather timidly presented his idea to colleagues, who immediately considered it worthy of special attention.

    Work on a secret project began in the summer, a few months after the United States declared war on Germany. Parker instructed several of his subordinates to investigate the possibility of keeping telecast messages secret.

    It turned out that the current fluctuations in the communication line could be recorded using an oscilloscope and then easily converted to the letters of the transmitted message. Therefore, it was decided to make changes to the wire connections of the teletype printing mechanism. As a result, the message text was encrypted using the single-alphabetical replacement method. The telegraph department understood that such protection was too weak, but could not come up with anything else and stopped working on this problem until Vernam told them about his idea.



    Vernam worked in the telegraph department and called his code “the long tape method for teletypes.” The essence of the Vernam cipher is simple: the telegraph message, presented in the form of a bit stream, was folded modulo with a tape on which a random stream of bits of unlimited duration was recorded. That is, the gamming code was transferred to electric soil. There were only two requirements to the cipher, the gamma had to be random and the gamma tape could be used only once (from here the name OTP - One Time-Pad, OTK - One-Time-Key; OTT - One-Time-Tape) . For encryption, a gamma punched tape with random signs was prepared in advance, after which its impulses with the impulses of the plaintext signs were added electromechanically. The amount received was a ciphertext. At the receiving end, the pulses received through the communication channel,

    Vernam suggested using the features of the teletype code, in which the encoded character was expressed in the form of five elements. Each of these elements symbolized the presence ("plus") or absence ("minus") of the electric current in the communication line. Thus, there were 32 different combinations of pluses and minuses. 26 of them were mapped to letters, and the remaining 6 designated “service combinations” (a space between words, a transition from letters to numbers and punctuation marks, a reverse transition from numbers and punctuation marks to letters, returning the carriage of a printing device, a new line and idling). For example, the letter "A" was expressed by the combination "+ + - - -", the letter "N" corresponded to "- - + + -", and the transition to numbers and punctuation marks was specified through "+ + - + +". The encoded message was printed on punched tape: The “pros” were represented by holes, and the “cons” by their absence. When reading punched tape, metal probes passed through the holes, closed the electric circuit and sent current pulses through the wires. And where there was a “minus” on the punched tape, the paper did not allow these probes to close the circuit, and as a result, the current pulse was not transmitted.






    Vernam designed a special device consisting of magnets, relays and collector plates in order to electrically sum the pulses during encryption. Since the decryption procedure was completely analogous to the encryption procedure, the same device was used during decryption. The pulses entered the summing device from two readers: one read the “gamma”, and the other read the plaintext. The resulting "pros" and "cons" could be transmitted like a normal teletype message. At the receiving end, the device invented by Vernam added pulses that were read from an identical gamma tape and restored the original pulses of the plaintext.



    A single-band electromechanical cryptographic machine was created in the United States around 1933 by the Western Union Telegraph Company. A limited number of such machines were produced, based on the Vernam cipher.

    Even if the message was intercepted, it was impossible to decrypt it without a gamut, because the enemy saw only a random sequence, which meant nothing to him. The information that was available to the enemy is only the length of the message. In its original form, the Vernam system was vulnerable, since the key punched tape was made in the form of a ring and was used again after its completion. Vernam managed to merge two processes together - encryption and message transfer. He created what was later called linear encryption.

    Only after World War I, Vernam received a patent for his invention, which soon overtook, for a while, the fate of Jefferson's disk encoder.

    However, although the device invented by Vernam was undoubtedly a valuable fruit of the creative engineering thought of a talented inventor, in commercial terms, it failed completely. Telegraph companies and commercial companies, which, according to AT&T, should have bought Vernam’s patented cipher set-top boxes in large quantities for their teletypes, preferred old-fashioned codes that significantly reduced the message length, thereby reducing telegraph costs and at the same time providing at least some , albeit small, security of correspondence. After the end of World War I, the budgets of the armed forces of all countries were reduced to a minimum. Lack of funds and lack of material resources forced the army signalmen to return again to combining two relatively short tapes with a “gamut”,

    As for Vernam himself, he continued to engage in research work at AT&T. He slightly improved his encryption system, and also invented a device for automatically encrypting hand-written text during its transfer by photo telegraph. In 1929, Vernam was transferred to one of AT&T branches with a significant increase. However, four months later, a financial crisis erupted in the United States, and since Vernam had not yet managed to earn sufficient seniority in a new place, he was soon fired. He went to work in another large company, but the sharp change in his personal fate, apparently, had a depressing effect on him. Every year, less and less was heard about Vernama, until, finally, on February 7, 1960, the person who automated the encryption process died in complete obscurity at home.

    Vernam cipher (One-time pad) in PHP

    Here is the implementation in php:

    Открытый текст: '$oStr'", // смотрим что получилось
            "
    Ключ: '$key'", "
    Зашифрованый текст: '$shStr'
    "; return array($key => $shStr); } header('Content-type: text/html; charset=utf-8'); // Зашифруем строку для примера $crypt = shifrVernam("Hello word!"); /*Вывод: Открытый текст: 'Hello word!' Ключ: 'c462031ba7e' Зашифрованый текст: '+QZ^_F SD' */ // Результат расшифруем с полученным ключем foreach($crypt as $key => $shr) shifrVernam($shr,$key);/*Вывод: Открытый текст: '+QZ^_F SD' Ключ: 'c462031ba7e' Зашифрованый текст: 'Hello word!' */


    Major Joseph Moborn was an outstanding cryptanalyst. He thoroughly studied cryptanalysis at the Army School of Communications and was well acquainted with the latest achievements in this field. Moborn began to further improve the Verman method. He combined the randomness of gamma with the one-time cipher block rule. Now three restrictions have been introduced: the cipher block is implemented as an encryption gamma, equal in length to or greater than the encrypted message; gamma marks were completely random or equally probable; each gamma was used once and only once, after which it was destroyed by the sending or receiving correspondent. There was also an additional rule: only two copies of the cipher key were made, one copy for the transmitter, the second copy for the receiving correspondent.



    Three sheets of a one-time cipher block, each of which is a possible key for the cipher. The message is encrypted using sheet 1

    As a result, an absolutely stable cipher system, a one-time cipher block is absolutely stable both in theory and in practice, no matter how long the intercepted ciphertext is, no matter how long it takes to study it, a cryptanalyst will never be able to open the one-time cipher block used to receive of this ciphertext, it simply does not have a starting point for its research, since the gamma does not contain repetitions in a one-time cipher system, is not used more than once, is not a connected text and has no internal structural patterns. Therefore, all decryption methods, to one degree or another based on these characteristics, do not give any results. And now - the cryptanalyst comes to a standstill.



    The perfect encryption method did not “deserve” universal use due to the huge amount of gamma that is required when using it. In wartime, it was necessary to encrypt hundreds of thousands of words during the day, and for this it would be necessary to produce millions of gamma marks. And since the gamut for each message was supposed to be one and only, its total volume is equivalent to the volume of all correspondence during the war, which is simply not possible in rapidly changing military conditions.

    Also popular now: