encrypted letters. Digital ciphers

Since there are a huge number of ciphers in the world, it is impossible to consider all ciphers not only within the framework of this article, but also the whole site. Therefore, we will consider the most primitive encryption systems, their application, as well as decryption algorithms. The purpose of my article is to explain the principles of encryption / decryption to a wide range of users as clearly as possible, as well as to teach primitive ciphers.

Even at school, I used a primitive cipher, which my older comrades told me about. Let's consider a primitive cipher "A cipher with the replacement of letters by numbers and vice versa."

Let's draw a table, which is shown in Figure 1. We arrange the numbers in order, starting with one, ending with zero horizontally. Below, under the numbers, we substitute arbitrary letters or symbols.

Rice. 1 The key to the cipher with the replacement of letters and vice versa.

Now let's turn to table 2, where the alphabet is numbered.

Rice. 2 Correspondence table of letters and numbers of alphabets.

Now let's encrypt the word K O S T E R:

1) 1. Convert letters to numbers: K = 12, O = 16, C = 19, T = 20, Yo = 7, P = 18

2) 2. Let's translate the numbers into symbols according to table 1.

KP KT KD PSHCH L KL

3) 3. Done.

This example shows a primitive cipher. Let's consider fonts similar in complexity.

1. 1. The simplest cipher is the CIPHER WITH THE REPLACEMENT OF LETTERS WITH NUMBERS. Each letter corresponds to a number in alphabetical order. A-1, B-2, C-3, etc.
For example, the word " TOWN" can be written as "20 15 23 14", but this will not cause much secrecy and difficulty in deciphering.

2. You can also encrypt messages using the NUMERIC TABLE. Its parameters can be anything, the main thing is that the recipient and the sender are aware of it. An example of a digital table.

Rice. 3 Numerical table. The first digit in the cipher is a column, the second is a row, or vice versa. So the word "MIND" can be encrypted as "33 24 34 14".

3. 3. BOOK CIPHER
In such a cipher, the key is a certain book that both the sender and the recipient have. The cipher denotes the page of the book and the line, the first word of which is the clue. Decryption is not possible if the sender and the correspondent have books of different years of publication and release. Books must be identical.

4. 4. CAESAR CIPHER(shift cipher, Caesar shift)
Known cipher. The essence of this cipher is the replacement of one letter by another, located at a certain constant number of positions to the left or to the right of it in the alphabet. Gaius Julius Caesar used this method of encryption in correspondence with his generals to protect military communications. This cipher is quite easy to break, so it is rarely used. Shift by 4. A = E, B= F, C=G, D=H, etc.
An example of a Caesar cipher: let's encrypt the word " DEDUCTION ".
We get: GHGXFWLRQ . (shift by 3)

Another example:

Encryption using the key K=3. The letter "C" "shifts" three letters forward and becomes the letter "F". A solid sign moved three letters forward becomes the letter "E", and so on:

Source alphabet: A B C D E F G I J K L M N O P R S T U V W Y Z

Encrypted: D E F G H I J K L M N O P R S T U V W Y Z A B C

Original text:

Eat some more of those soft French buns and have some tea.

The cipher text is obtained by replacing each letter of the original text with the corresponding letter of the cipher alphabet:

Fezyya iz zyi akhlsh pvenlsh chugrschtskfnlsh dtsosn, zhg eyutzm gb.

5. CIPHER WITH A CODE WORD
Another simple way in both encryption and decryption. A code word is used (any word without repeating letters). This word is inserted in front of the alphabet and the remaining letters are added in order, excluding those that are already in the code word. Example: the code word is NOTEPAD.
Source: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Replacement: N O T E P A D B C F G H I J K L M Q R S U V W X Y Z

6. 6. ATBASH CODE
One of the easiest encryption methods. The first letter of the alphabet is replaced by the last, the second by the penultimate, and so on.
Example: "SCIENCE" = HXRVMXV

7. 7. FRANCIS BACON CIPHER
One of the simplest encryption methods. For encryption, the Bacon cipher alphabet is used: each letter of the word is replaced by a group of five letters "A" or "B" (binary code).

a AAAAA g AABBA m ABABB s BAAAB y BABBA

b AAAAB h AABBB n ABBAA t BAABA z BABBB

c AAABA i ABAAA o ABBAB u BAABB

d AAABB j BBBAA p ABBBA v BBBAB

e AABAA k ABAAB q ABBBB w BABAA

f AABAB l ABABA r BAAAA x BABAB

The complexity of decryption lies in determining the cipher. Once it is defined, the message is easily alphabetized.
There are several ways to encode.
It is also possible to encrypt a sentence using a binary code. Parameters are defined (for example, "A" - from A to L, "B" - from L to Z). So BAABAAAAABAAAABABABB means TheScience of Deduction ! This method is more complicated and tedious, but much more reliable than the alphabetical version.

8. 8. THE BLUE VIGENERE CIPHER.
This cipher was used by the Confederates during the Civil War. The cipher consists of 26 Caesar ciphers with different shift values ​​(26 letters of the Latin alphabet). Tabula recta (Vigenère's square) can be used for encryption. Initially, the key word and the source text are selected. The key word is written cyclically until it fills the entire length of the original text. Further along the table, the letters of the key and the plaintext intersect in the table and form the ciphertext.

Rice. 4 Blaise Vigenère cipher

9. 9. LESTER HILL CIPHER
Based on linear algebra. Was invented in 1929.
In such a cipher, each letter corresponds to a number (A = 0, B =1, etc.). A block of n-letters is treated as an n-dimensional vector and multiplied by an (n x n) matrix mod 26. The matrix is ​​the cipher key. To be able to decrypt, it must be reversible in Z26n.
In order to decrypt the message, it is necessary to convert the ciphertext back into a vector and multiply by the inverse of the key matrix. For more information - Wikipedia to the rescue.

10. 10. TRITEMIUS CIPHER
An improved Caesar cipher. When decrypting, it is easiest to use the formula:
L= (m+k) modN , L is the number of the encrypted letter in the alphabet, m is the serial number of the letter of the encrypted text in the alphabet, k is the shift number, N is the number of letters in the alphabet.
It is a special case of an affine cipher.

11. 11. MASONIC CYFER



12. 12. GRONSFELD CYFER

The content of this cipher includes the Caesar cipher and the Vigenère cipher, but the Gronsfeld cipher uses a numerical key. We encrypt the word “THALAMUS” using the number 4123 as a key. We enter the numbers of the numerical key in order under each letter of the word. The number under the letter will indicate the number of positions to which the letters need to be shifted. For example, instead of T, you get X, and so on.

T H A L A M U S
4 1 2 3 4 1 2 3

T U V W X Y Z
0 1 2 3 4

Result: THALAMUS = XICOENWV

13. 13. PIG LATIN
More often used as children's fun, it does not cause any particular difficulty in deciphering. The use of English is mandatory, Latin has nothing to do with it.
In words that begin with consonants, these consonants are moved back and the “suffix” ay is added. Example: question = estionquay. If the word begins with a vowel, then ay, way, yay or hay is simply added to the end (example: a dog = aay ogday).
In Russian, this method is also used. They call it differently: “blue tongue”, “salty tongue”, “white tongue”, “purple tongue”. Thus, in the Blue language, after a syllable containing a vowel, a syllable with the same vowel is added, but with the addition of the consonant “s” (because the language is blue). Example: Information enters the nuclei of the thalamus = Insiforsomasacisia possotusupasesa in the nucleus rasa tasalasamusususas.
Pretty interesting option.

14. 14. POLYBIUS SQUARE
Like a digital table. There are several methods for using the Polybius square. An example of a Polybius square: we make a 5x5 table (6x6 depending on the number of letters in the alphabet).

1 METHOD. Instead of each letter in the word, the corresponding letter from below is used (A = F, B = G, etc.). Example: CIPHER - HOUNIW.
2 METHOD. The numbers corresponding to each letter from the table are indicated. The first number is written horizontally, the second - vertically. (A=11, B=21…). Example: CIPHER = 31 42 53 32 51 24
3 METHOD. Based on the previous method, let's write the resulting code together. 314253325124. We make a shift to the left by one position. 142533251243. Again we divide the code in pairs. 14 25 33 25 12 43. As a result, we get a cipher. Pairs of numbers correspond to a letter in the table: QWNWFO.

There are a lot of ciphers, and you can also come up with your own cipher, but it is very difficult to invent a strong cipher, since the science of decryption has stepped far forward with the advent of computers and any amateur cipher will be broken by experts in a very short time.

Methods for opening monoalphabetic systems (decoding)

With their simplicity in implementation, single-alphabetic encryption systems are easily vulnerable.
Let us determine the number of different systems in an affine system. Each key is fully defined by a pair of integers a and b that define the mapping ax+b. There are j(n) possible values ​​for a, where j(n) is the Euler function returning the number of coprime numbers with n, and n values ​​for b that can be used regardless of a, except for the identity mapping (a=1 b =0), which we will not consider.
Thus, there are j(n)*n-1 possible values, which is not so much: with n=33, there can be 20 values ​​for a (1, 2, 4, 5, 7, 8, 10, 13, 14 , 16, 17, 19, 20, 23, 25, 26, 28, 29, 31, 32), then the total number of keys is 20*33-1=659. Enumeration of such a number of keys is not difficult when using a computer.
But there are methods that simplify this search and which can be used in the analysis of more complex ciphers.
frequency analysis
One such method is frequency analysis. The distribution of letters in the cryptotext is compared with the distribution of letters in the alphabet of the original message. The letters with the highest frequency in the cryptotext are replaced by the letter with the highest frequency from the alphabet. The probability of a successful opening increases with the length of the cryptotext.
There are many different tables on the distribution of letters in a given language, but none of them contains definitive information - even the order of the letters may differ in different tables. The distribution of letters depends very much on the type of test: prose, spoken language, technical language, etc. The guidelines for the laboratory work give frequency characteristics for various languages, from which it is clear that the letters of the letter I, N, S, E, A (I, N, C, E, A) appear in the high-frequency class of each language.
The simplest protection against attacks based on frequency counting is provided by the system of homophones (HOMOPHONES), monosounding substitution ciphers in which one plaintext character is mapped to several ciphertext characters, their number is proportional to the frequency of the letter. Encrypting the letter of the original message, we randomly choose one of its replacements. Therefore, a simple calculation of frequencies does not give anything to the cryptanalyst. However, information is available on the distribution of pairs and triplets of letters in various natural languages.

Man is a social being. We learn to interact with others by observing their reactions to our actions from the first days of life. We use what art critics call "cultural codes" in every interaction. But cultural codes are the most difficult to decipher, there is no special program that will tell you what a raised eyebrow or seemingly causeless tears can mean; there is no clear answer; moreover, even the 'coder' himself may not know what he meant by his action! The science of understanding others is something that we comprehend all our lives, and the better this skill is developed, the more harmonious, as a rule, communication with others and any activity in which concerted actions are needed.

The study of cryptography in both its forms (encryption and decryption) allows you to learn how to find a connection between an encrypted, confusing, incomprehensible message and the meaning that is hidden in it. Passing the historical path from the cipher of Julius Caesar to RSA-keys, from the Rosetta stone to Esperanto, we learn to perceive information in an unusual form for us, solve riddles, get used to multivariance. And most importantly, we learn to understand: both different people who are different from us, and the mathematical and linguistic mechanisms that underlie each, absolutely each message.

So, an adventure story about cryptography for children, for everyone who has children, and for everyone who has ever been a child.

Flags flutter in the wind, hot horses neigh, armor rattles: the Roman Empire discovered that there was still someone in the world whom they had not conquered. Under the command of Gaius Julius Caesar is a huge army, which must be quickly and accurately controlled.

The spies are on the alert, the enemies are preparing to intercept the emperor's envoys in order to find out all his brilliant plans. Every piece of parchment that falls into the wrong hands is a chance to lose the battle.

But now the envoy is captured, the attacker unfolds the note ... and does not understand anything! “Probably,” he scratches his head, “this is in some unknown language ...”. Rome triumphs, her plans are safe.

What is a Caesar cipher? Its simplest variant is when instead of each letter we put the next alphabetically: instead of “a” - “b”, instead of “e” - “g”, and instead of “i” - “a”. Then, for example, "I love to play" will become "A yavmya idsbue." Let's look at the plate, on top of it there will be a letter that we encrypt, and on the bottom - with which we replace it.

The alphabet is sort of "shifted" by one letter, right? Therefore, this cipher is also called the “shift cipher” and they say “we use the Caesar cipher with a shift of 10” or “with a shift of 18”. This means that it is necessary to “shift” the lower alphabet not by 1, as we have, but, for example, by 10 - then we will have “y” instead of “a”, and “e” instead of “y”.

Caesar himself used this cipher with a shift of 3, that is, his encryption table looked like this:

More precisely, it would look like this if Caesar lived in Russia. In his case, the alphabet was Latin.

Such a cipher is easy enough to crack if you are a professional spy or Sherlock Holmes. But he is still suitable for keeping his little secrets from prying eyes.

You yourself can arrange your own little home conspiracy. Agree on your shift number, and you can leave encrypted notes on each other's fridge about someone's birthday surprise, send encrypted messages, and maybe, if there's a long separation, even write secret, coded letters to each other!

But the whole history of cryptography is the history of the struggle between the art of ciphering messages and the art of deciphering them. When a new way to encode a message appears, there are those who try to crack this code.

What is "Crack the Code"? This means - to come up with a way to solve it, not knowing the key and the meaning of the cipher. The Caesar cipher was also once cracked - the so-called "method of frequency analysis". Look at any text - there are much more vowels in it than consonants, and “o” is much more than, for example, “I”. For each language, you can name the most frequently and rarely used letters. You just need to find which letter is the most in the ciphertext. And most likely it will be encrypted "o", "e", "i" or "a" - the most common letters in Russian words. And as soon as you know what letter they designated, for example, “a”, you know how much the cipher alphabet is “shifted”, which means you can decipher the entire text.

When the whole world learned the solution to the Caesar code, cryptographers had to come up with something more powerful. But, as often happens, people did not invent something completely new, but complicated the existing one. Instead of encrypting all the letters according to the same shifted alphabet, several of them began to be used in secret messages. For example, we encrypt the first letter alphabetically with a shift of 3, the second with a shift of 5, the third with a shift of 20, the fourth with a shift of 3 again, the fifth with a shift of 5, the sixth with a shift of 20, and so on, in a circle. Such a cipher is called polyalphabetic (that is, polyalphabetic). Try it, so your cipher can already be solved only by someone who is privy to the secrets of cryptography!

It would seem that the attackers must have become confused and secrets must remain secrets forever. But if the cipher was once broken, then any more complex variants of it will also be broken once.

Let's imagine that someone encrypted the message with two alphabets. The first letter - with a shift of 5, the second - with a shift of 3, the third - again 5, the fourth again 3 - as on the plate below.

We can divide all encrypted letters into two groups: letters encrypted with shift 5 (1, 3, 5, 7, 9, 11, 13, 15, 17, 19) and letters encrypted with shift 3 (2, 4, 6 , 8, 10, 12, 14, 16, 18, 20). And inside each group, look for which letters we met more often than others - just like in Caesar's cipher, only more trouble.

If the cipher used three alphabets, then we will divide the letters into three groups, if five, then into five. And then the same frequency analysis comes into play again.

You can ask the question - how did the decoders know that there are three alphabets, and not, for example, five? They didn't really know. And they looked at all possible options. Therefore, decryption took much longer, but it was still possible.

In cryptography, the message to be transmitted is called "plaintext" and the encrypted message is called "ciphertext". And the rule by which the text is encrypted is called the "cipher key".

The 20th century crept up unnoticed. Mankind is relying more and more on cars: trains are replacing wagons, radios are appearing in almost every home, and the first planes have already taken off. And in the end, the encryption of secret plans is also transferred to the machines.

During World War II, a great many machines for encrypting messages were invented, but they all relied on the idea that a polyalphabetic cipher could be further confused. To confuse so much that, although in theory it will be possible to solve it, in practice no one will be able to do it. To confuse as much as a machine can do, but a person is not capable of. The most famous of these cipher machines is the Enigma used by Germany.

theromanroad.files.wordpress.com

But, while the most important secret of Germany was the design of the Enigma, the most important secret of its opponents was that by the middle of the war all countries had already solved the Enigma. If this became known in Germany itself, they would start to invent something new, but until the end of the war they believed in the ideality of their encryption machine, and France, England, Poland, Russia read secret German messages like an open book.

The thing is that the Polish scientist Marian Rejewski once thought that since they came up with a machine for encrypting messages, they could also come up with a machine for decrypting, and called his first sample "Bomb". Not because of the "explosive" effect, as one might think, but in honor of the delicious, round cake.

Then the mathematician Alan Turing built a machine based on it that completely deciphered the Enigma code, and which, by the way, can be considered the first progenitor of our modern computers.

The most complex code in the entire Second World War was invented by the Americans. For every US warship was seconded ... an Indian. Their language was so incomprehensible and poorly understood, sounded so strange that the codebreakers did not know how to approach, and the US Navy fearlessly transmitted information in the language of the Choctath Indian tribe.

In general, cryptography is not only about how to solve a riddle, but also about how to solve it. People do not always come up with such riddles on purpose - sometimes history itself throws them up. And one of the main mysteries for cryptographers for a long time was the mystery of the ancient Egyptian language.

No one knew what all these hieroglyphs meant. What did the Egyptians mean by drawing birds and scarabs. But one happy day, the French army discovered the Rosetta Stone in Egypt.

On this stone was an inscription - the same, in ancient Greek, Egyptian alphabetic (demotic text) and Egyptian hieroglyphic. The historians of that time knew ancient Greek well, so they quickly learned what was written on the stone. But the main thing is that, knowing the translation, they were able to reveal the secrets of the ancient Egyptian language. The demotic text was deciphered quite quickly, but historians, linguists, mathematicians, cryptographers puzzled over the hieroglyphs for many years, but in the end they figured it out.

And this was a great victory for cryptographers - a victory over time itself, which hoped to hide their history from people.

But among all these ciphers solved, there are three special ones. One is the Diffie-Hellman method. If a small message is encrypted with this method, then in order to decrypt it, you need to take all the computers in the world and keep them busy with this for many, many years. It is he who is used today on the Internet.

The second is quantum encryption. True, it has not yet been completely invented, but if people make quantum computers the way they dream of, then such a cipher will know when they are trying to decipher it.

And the third special cipher is the "book cipher". Its amazingness is that it is easy for them to encrypt something and not easy to decipher. Two people choose the same book, and each word from their letter is searched for and replaced with three numbers: the page number, the line number, and the number of the word in the line. It's very easy to do, right? And it’s not at all easy to solve: how does a spy know which book you have chosen? And most importantly, computers will not help much in this matter either. Of course, if you connect a lot of smart people and a lot of powerful computers, such a cipher will not stand.

But there is a basic safety rule. She, this security, should be so much that the encrypted message is not worth the enormous effort that must be spent on decrypting it. That is, so that the villain - the spy has to spend as much effort to unravel your code as he is not ready to spend to find out your message. And this rule works always and everywhere, both in friendly school correspondence and in the world of real spy games.

Cryptography is the art of guessing and solving riddles. The art of keeping secrets, and the art of revealing them. With cryptography, we learn to understand each other and figure out how to keep something important to ourselves safe. And the better we know how to do both, the calmer and more active our life can be.

Methods: explanatory and illustrative, partially exploratory.

  • Create conditions for increasing cognitive interest in the subject.
  • Contribute to the development of analytical-synthesizing thinking.
  • Contribute to the formation of skills and abilities that are of a general scientific and general intellectual nature.

Tasks:

educational:

  • generalize and systematize knowledge of the basic concepts: code, coding, cryptography;
  • get acquainted with the simplest encryption methods and their creators;
  • develop the ability to read encryption and encrypt information;

developing:

  • develop cognitive activity and creative abilities of students;
  • form logical and abstract thinking;
  • develop the ability to apply the acquired knowledge in non-standard situations;
  • develop imagination and mindfulness;

educational:

  • foster a communicative culture;
  • develop curiosity.

The proposed development can be used for students in grades 7-9. The presentation helps to make the material visual and accessible.

The society in which a person lives deals with information throughout its development. It is accumulated, processed, stored, transmitted. (Slide 2. Presentation)

And does everyone always have to know everything?

Of course not.

People have always sought to hide their secrets. Today you will get acquainted with the history of the development of cryptography, learn the simplest methods of encryption. You will be able to decipher the messages.

Simple encryption techniques were used and gained some distribution already in the era of the ancient kingdoms and in antiquity.

Cryptography - cryptography - is the same age as writing. The history of cryptography has more than one millennium. The idea of ​​creating texts with hidden meanings and encrypted messages is almost as old as the art of writing itself. There is a lot of evidence for this. Clay tablet from Ugarit (Syria) - exercises teaching the art of deciphering (1200 BC). The “Babylonian Theodicy” from Iraq is an example of an acrostic (mid-2nd millennium BC).

One of the first systematic ciphers was developed by the ancient Jews; this method is called temura - “exchange”.

The simplest of them is “Atbash”, the alphabet was divided in the middle so that the first two letters, A and B, coincided with the last two, T and Sh. The use of the Temur cipher can be found in the Bible. This prophecy of Jeremiah, made at the beginning of the 6th century BC, contains a curse to all the rulers of the world, ending with the “king of Sesach” who, when deciphered from the “Atbash” cipher, turns out to be the king of Babylon.

(Slide 3) A more ingenious encryption method was invented in ancient Sparta during the time of Lycurgus (5th century BC). To encrypt the text, Scitalla was used - a cylindrical rod, on which a tape of parchment was wound. The text was written line by line along the axis of the cylinder, the tape was unwound from the wand and passed to the addressee, who had a Scytall of the same diameter. This method permuted the letters of the message. The cipher key was the diameter of Scitalla. ARISTOTLE came up with a method for breaking such a cipher. He invented the Antiscital decryption device.

(Slide 4) Task "Check yourself"

(Slide 5) The Greek writer POLYBIUS used a signaling system that was used as a method of encryption. With its help it was possible to transfer absolutely any information. He wrote down the letters of the alphabet in a square table and replaced them with coordinates. The stability of this cipher was great. The main reason for this was the ability to constantly change the sequence of letters in the square.

(Slide 6) Task "Check yourself"

(Slide 7) A special role in preserving the secret was played by the encryption method proposed by JULIUS CAESAR and described by him in “Notes on the Gallic War.

(Slide 8) Task "Check yourself"

(Slide 9) There are several modifications of the Caesar cipher. One of them is the Gronsfeld cipher algorithm (created in 1734 by the Belgian José de Bronkhor, Comte de Gronsfeld, a military man and diplomat). Encryption lies in the fact that the shift value is not constant, but is set by a key (gamma).

(Slide 10) For the one who transmits the encryption, its resistance to decryption is important. This characteristic of a cipher is called cryptographic strength. To increase cryptographic strength allow ciphers with many alphabetic or multi-valued substitutions. In such ciphers, each character of the open alphabet is assigned not one, but several cipher characters.

(Slide 11) Scientific methods in cryptography first appeared in the Arab countries. Arabic origin and the word cipher itself (from the Arabic "number"). The Arabs were the first to replace letters with numbers in order to protect the original text. The secret writing and its meaning are even mentioned in the fairy tales of the Thousand and One Nights. The first book, specifically dedicated to the description of some ciphers, appeared in 855, it was called “The Book of the Great Aspiration of Man to Unravel the Mysteries of Ancient Writing”.

(Slide 12) The Italian mathematician and philosopher GEROLAMO CARDANO wrote the book "On the Subtleties", which has a part on cryptography.

His contribution to the science of cryptography contains two sentences:

The first is to use the plaintext as the key.

Secondly, he proposed a cipher, now called the Cardano Grid.

In addition to these proposals, Cardano gives a "proof" of the strength of ciphers based on counting the number of keys.

The Cardano grille is a sheet of hard material in which, at regular intervals, rectangular cuts are made, one stitch high and of various lengths. By superimposing this lattice on a sheet of writing paper, it was possible to write a secret message into the cutouts. The remaining spaces were filled with arbitrary text masking the secret message. This method of disguise was used by many famous historical figures, Cardinal Richelieu in France and the Russian diplomat A. Griboyedov. On the basis of such a lattice, Cardano constructed a permutation cipher.

(Slide 13) Task "Check yourself"

(Slide 14) They were also fond of cryptography in Russia. The ciphers used are the same as in Western countries - icon, substitutions, permutations.

The date of the emergence of the cryptographic service in Russia should be considered 1549 (the reign of Ivan IV), from the moment the "ambassadorial order" was formed, in which there was a "digital department".

Peter I completely reorganized the cryptographic service, creating the "Ambassador's Office". At this time, codes are used for encryption, as applications to "digital alphabets". In the famous "case of Tsarevich Alexei" "digital alphabets" also appeared in the accusatory materials.

(Slide 15) Task "Check yourself"

(Slide 16) The 19th century brought many new ideas in cryptography. THOMAS JEFFERSON created an encryption system that occupies a special place in the history of cryptography - the "disk cipher". This cipher was implemented using a special device, which was later called the Jefferson cipher.

In 1817, DESIUS WADSWORTH designed an encryption device that introduced a new principle into cryptography. The innovation was that he made plaintext and ciphertext alphabets of various lengths. The device with which he did this was a disk, with two movable rings with alphabets. The letters and numbers of the outer ring were removable and could be assembled in any order. This cipher system implements a periodic polyalphabetic substitution.

(Slide 17) There are many ways to encode information.

The captain of the French army, CHARLES BARBIER, developed in 1819 the coding system ecriture noctrume - night writing. Convex dots and dashes were used in the system, the disadvantage of the system is its complexity, since it was not letters that were encoded, but sounds.

LOUIS BRAILE improved the system, developed his own cipher. The foundations of this system are still in use today.

(Slide 18) SAMUEL MORSE developed in 1838 a system for encoding characters using dots and dashes. He is also the inventor of the telegraph (1837) - a device that used this system. The most important thing in this invention is the binary code, that is, the use of only two characters to encode letters.

(Slide 19) Task "Check yourself"

(Slide 20) At the end of the 19th century, cryptography began to acquire the features of an exact science, and not just an art, it began to be studied in military academies. One of them developed its own military field cipher, called the Saint-Cyr Line. It made it possible to significantly increase the efficiency of the cryptographer's work, to facilitate the algorithm for implementing the Vigenère cipher. It is in this mechanization of encryption-decryption processes that the contribution of the authors of the line to practical cryptography lies.

In the history of cryptography of the XIX century. the name of AUGUST KIRKHOFFES was vividly imprinted. In the 80s of the XIX century, he published the book "Military Cryptography" with a volume of only 64 pages, but they immortalized his name in the history of cryptography. It formulates 6 specific requirements for ciphers, two of which relate to the strength of encryption, and the rest - to operational qualities. One of them (“compromising the system should not cause inconvenience to correspondents”) became known as the “Kerckhoffs rule”. All these requirements are relevant today.

In the 20th century, cryptography became electromechanical, then electronic. This means that electromechanical and electronic devices have become the main means of transmitting information.

(Slide 21) In the second half of the 20th century, following the development of the element base of computer technology, electronic encoders appeared. Today, it is electronic encoders that make up the vast majority of encryption tools. They meet the ever-increasing requirements for reliability and speed of encryption.

In the seventies, two events occurred that seriously influenced the further development of cryptography. Firstly, the first data encryption standard (DES) was adopted (and published!) which "legalized" the Kerckhoffs principle in cryptography. Secondly, after the work of the American mathematicians W. DIFFI and M. HELLMAN, a "new cryptography" was born - cryptography with a public key.

(Slide 22) Task "Check yourself"

(Slide 23) The role of cryptography will increase due to the expansion of its areas of application:

  • digital signature,
  • authentication and confirmation of the authenticity and integrity of electronic documents,
  • e-business security,
  • protection of information transmitted via the Internet, etc.

Familiarity with cryptography will be required for each user of electronic means of information exchange, therefore cryptography in the future will become the "third literacy" along with the "second literacy" - computer and information technology skills.

In substitution ciphers (or substitution ciphers), in contrast to , the elements of the text do not change their sequence, but change themselves, i.e. the original letters are replaced with other letters or symbols (one or more) according to certain rules.

This page describes ciphers in which the substitution takes place on letters or numbers. When the replacement occurs for some other non-alphanumeric characters, for combinations of characters or patterns, this is called direct.

Monoalphabetic ciphers

In monoalphabetic substitution ciphers, each letter is replaced by one and only one other letter/symbol or group of letters/symbols. If there are 33 letters in the alphabet, then there are 33 substitution rules: what to change A to, what to change B to, etc.

Such ciphers are quite easy to decrypt even without knowing the key. This is done using frequency analysis ciphertext - you need to count how many times each letter occurs in the text, and then divide by the total number of letters. The resulting frequency must be compared with the reference. The most common letter for the Russian language is the letter O, followed by E, and so on. True, frequency analysis works on large literary texts. If the text is small or very specific in terms of the words used, then the frequency of the letters will differ from the reference, and more time will have to be spent on solving. Below is a table of the frequency of letters (that is, the relative frequency of letters found in the text) of the Russian language, calculated on the basis of NKRYA.

The use of the frequency analysis method to decrypt encrypted messages is beautifully described in many literary works, for example, Arthur Conan Doyle in the novel "" or Edgar Poe in "".

It is easy to compile a code table for a monoalphabetic substitution cipher, but it is quite difficult to remember it and it is almost impossible to restore it if lost, so some rules for compiling such code pages are usually invented. Below are the most famous of these rules.

random code

As I wrote above, in the general case, for the replacement cipher, you need to figure out which letter to which should be replaced. The simplest thing is to take and randomly mix the letters of the alphabet, and then write them out under the line of the alphabet. Get a code table. For example, like this:

The number of variants of such tables for 33 letters of the Russian language = 33! ≈ 8.683317618811886*10 36 . From the point of view of encrypting short messages, this is the most ideal option: in order to decrypt, you need to know the code table. It is impossible to sort through such a number of options, and if you encrypt a short text, then frequency analysis cannot be applied.

But for use in quests, such a code table must be presented somehow more beautifully. The solver must first either simply find this table or solve a certain verbal-literal riddle. For example, guess or solve.

Keyword

One of the options for compiling a code table is to use a keyword. We write down the alphabet, under it we first write down a keyword consisting of non-repeating letters, and then we write out the remaining letters. For example, for the word "manuscript" we get the following table:

As you can see, the beginning of the table is shuffled, but the end remains unshuffled. This is because the most “senior” letter in the word “manuscript” is the letter “U”, and after it the unmixed “tail” remained. The letters in the tail will remain unencoded. You can leave it like that (since most of the letters are still encoded), or you can take a word that contains the letters A and Z, then all the letters will mix up, and there will be no “tail”.

The keyword itself can also be pre-specified, for example, using or . For example, like this:

Having solved the arithmetic rebus-frame and matching the letters and numbers of the encrypted word, then you will need to enter the resulting word into the code table instead of numbers, and enter the remaining letters in order. You get the following code table:

Atbash

The cipher was originally used for the Hebrew alphabet, hence the name. The word atbash (אתבש) is composed of the letters "alef", "tav", "bet" and "shin", that is, the first, last, second and penultimate letters of the Hebrew alphabet. This sets the substitution rule: the alphabet is written out in order, under it it is also written out backwards. Thus, the first letter is encoded into the last one, the second - into the penultimate one, and so on.

The phrase "TAKE IT TO THE EXCEPTION" is converted using this cipher into "ERCHGTZ BL R E VFNPPZHS". Atbash Cipher Online Calculator

ROT1

This cipher is known to many children. The key is simple: each letter is replaced by the one that follows it in the alphabet. So, A is replaced by B, B by C, etc., and Z is replaced by A. “ROT1” means “ROTate 1 letter forward through the alphabet” (English “rotate/shift the alphabet one letter forward”). The message "Gryuklokotam grunt at night" will become "Tsyalmplpubn tsyalmplpubnyu rp opshbn." ROT1 is fun to use because it's easy for even a child to understand and easy to use for encryption. But it's just as easy to decipher.

Caesar's cipher

The Caesar cipher is one of the oldest ciphers. During encryption, each letter is replaced by another, which is separated from it in the alphabet not by one, but by a greater number of positions. The cipher is named after the Roman emperor Gaius Julius Caesar, who used it for secret correspondence. He used a three-letter shift (ROT3). Many people suggest doing encryption for the Russian alphabet using this shift:

I still think that there are 33 letters in Russian, so I propose this code table:

Interestingly, in this version, the phrase “where is the hedgehog?” is read in the replacement alphabet :)

But after all, the shift can be done by an arbitrary number of letters - from 1 to 33. Therefore, for convenience, you can make a disk consisting of two rings rotating relative to each other on the same axis, and write letters of the alphabet on the rings in sectors. Then it will be possible to have at hand the key for the Caesar code with any offset. Or you can combine the Caesar cipher with atbash on such a disk, and you get something like this:

Actually, that's why such ciphers are called ROT - from the English word "rotate" - "rotate".

ROT5

In this option, only numbers are encoded, the rest of the text remains unchanged. There are 5 substitutions, so ROT5: 0↔5, 1↔6, 2↔7, 3↔8, 4↔9.

ROT13

ROT13 is a variation of the Caesar cipher for the Latin alphabet with a shift of 13 characters. It is often used on the Internet in English-language forums as a means to hide spoilers, main points, puzzle solutions, and offensive material from casual view.

The Latin alphabet of 26 letters is divided into two parts. The second half is written under the first. When encoding, letters from the top half are replaced by letters from the bottom half and vice versa.

ROT18

Everything is simple. ROT18 is a combination of ROT5 and ROT13 :)

ROT47

There is a more complete version of this cipher - ROT47. Instead of using the A-Z alphabetical sequence, ROT47 uses a larger character set, almost all of the display characters from the first half of the ASCII table. Using this cipher, you can easily encode url, e-mail, and it will not be clear what exactly it is url and e-mail :)

For example, a link to this text would be encrypted like this: 9EEAi^^ [email protected]]CF^82>6D^BF6DE^4CJAE^4:A96C^K2> [email protected] Only an experienced guesser will be able to guess from the doubles of characters repeated at the beginning of the text that 9EEAi^^ can mean HTTP:⁄⁄ .

Polybius Square

Polybius is a Greek historian, commander and statesman who lived in the 3rd century BC. He proposed the original code for a simple substitution, which became known as "Polybius square" or Polybius's chessboard. This type of coding was originally used for the Greek alphabet, but then it was extended to other languages. The letters of the alphabet fit into a square or a suitable rectangle. If there are more letters for the square, then they can be combined in one cell.

Such a table can be used as in the Caesar cipher. To encrypt on a square, we find the letter of the text and insert the lower one from it in the same column into the encryption. If the letter is in the bottom row, then we take the top one from the same column. For Cyrillic, you can use the table ROT11(an analogue of the Caesar cipher with a shift of 11 characters):

The letters of the first line are encoded into the letters of the second, the second - into the third, and the third - into the first.

But it is better, of course, to use the "chip" of the Polybius square - the coordinates of the letters:

    Under each letter of the encoded text we write in a column two coordinates (top and side). You will get two lines. Then we write out these two lines in one line, split it into pairs of numbers and using these pairs as coordinates, again encode according to the Polybius square.

    It can be complicated. The initial coordinates are written out in a line without splitting into pairs, shifted by odd the number of steps, split the result into pairs and encode again.

Polybius Square can also be created using a code word. First, the code word is entered into the table, then the remaining letters. The code word must not contain repeated letters.

A variant of the Polybius cipher is used in prisons by tapping out the coordinates of the letters - first the line number, then the number of the letter in the line.

Poetic cipher

This encryption method is similar to the Polybius cipher, but the key is not the alphabet, but a poem that fits line by line into a square of a given size (for example, 10 × 10). If the line is not included, then its "tail" is cut off. Further, the resulting square is used to encode the text letter by letter with two coordinates, as in the Polybius square. For example, we take a good verse "Borodino" by Lermontov and fill in the table. We notice that the letters Yo, Y, X, W, W, Y, E are not in the table, which means we cannot encrypt them. The letters are, of course, rare and may not be needed. But if they are still needed, you will have to choose another verse that has all the letters.

RUS/LAT

Probably the most common cipher :) If you try to write in Russian, forgetting to switch to the Russian layout, you get something like this: Tckb gsnfnmcz gbcfnm gj-heccrb? pf,sd gthtrk.xbnmcz yf heccre. hfcrkflre? nj gjkexbncz xnj-nj nbgf "njuj^ Why not a cipher? The most that neither is a replacement cipher. The keyboard acts as a code table.

The conversion table looks like this:

Litorrhea

Litorea (from lat. littera - letter) - secret writing, a kind of ciphered writing used in ancient Russian handwritten literature. There are two types of litorea: simple and wise. A simple, otherwise called gibberish letter, is as follows. If "e" and "e" are counted as one letter, then thirty-two letters remain in the Russian alphabet, which can be written in two rows - sixteen letters each:

You get the Russian analogue of the ROT13 cipher - ROT16:) When encoding, the upper letter is changed to the lower one, and the lower one to the upper one. An even simpler version of litorea leaves only twenty consonants:

It turns out a cipher ROT10. When encrypting, only consonants are changed, while vowels and others that are not included in the table are left as is. It turns out something like “dictionary → lsosh”, etc.

The wise littoria involves more complex substitution rules. In various variants that have come down to us, substitutions of entire groups of letters are used, as well as numerical combinations: each consonant letter is assigned a number, and then arithmetic operations are performed on the resulting sequence of numbers.

Bigram encryption

Playfair cipher

The Playfair cipher is a manual symmetrical encryption technique that pioneered the use of bigram substitution. Invented in 1854 by Charles Wheatstone. The cipher provides for the encryption of pairs of characters (bigrams), instead of single characters, as in the substitution cipher and in more complex Vigenère encryption systems. Thus, the Playfair cipher is more resistant to cracking than the simple substitution cipher, since frequency analysis is more difficult.

The Playfair cipher uses a 5x5 table (for the Latin alphabet, for the Russian alphabet it is necessary to increase the size of the table to 6x6) containing a keyword or phrase. To create a table and use a cipher, just remember the keyword and four simple rules. To create a key table, first of all, you need to fill in the empty cells of the table with the letters of the keyword (without writing down repeated characters), then fill in the remaining cells of the table with alphabetic characters that are not found in the keyword, in order (in English texts, the “Q” character is usually omitted, to reduce the alphabet, in other versions "I" and "J" are combined into one cell). The keyword and subsequent letters of the alphabet can be entered into the table line by line from left to right, boustrophedon, or in a spiral from the upper left corner to the center. The keyword, completed with the alphabet, makes up a 5x5 matrix and is the cipher key.

In order to encrypt a message, it is necessary to break it into bigrams (groups of two characters), for example "Hello World" becomes "HE LL OW OR LD", and find these bigrams in the table. The two bigram symbols correspond to the corners of the rectangle in the key table. Determine the positions of the corners of this rectangle relative to each other. Then, guided by the following 4 rules, we encrypt pairs of characters in the source text:

    1) If two bigram characters match, add “X” after the first character, encrypt a new pair of characters and continue. In some versions of the Playfair cipher, "Q" is used instead of "X".

    2) If the bigram characters of the source text occur in one line, then these characters are replaced by the characters located in the nearest columns to the right of the corresponding characters. If the character is the last character in the string, then it is replaced with the first character of the same string.

    3) If the bigram characters of the source text occur in one column, then they are converted to the characters of the same column, located directly below them. If the character is the bottom character in a column, then it is replaced by the first character of the same column.

    4) If the bigram symbols of the source text are in different columns and different rows, then they are replaced by symbols located in the same rows, but corresponding to other corners of the rectangle.

For decryption, it is necessary to use the inversion of these four rules, discarding the characters "X" (or "Q"), if they do not make sense in the original message.

Consider an example of composing a cipher. We use the "Playfair example" key, then the matrix will look like:

Let's encrypt the message "Hide the gold in the tree stump". We break it into pairs, not forgetting the rule. We get: "HI DE TH EG OL DI NT HE TR EX ES TU MP". The following rules apply:

    1. Digram HI forms a rectangle, replace it with BM.

    2. Digram DE is located in one column, we replace it with ND.

    3. Digram TH forms a rectangle, we replace it with ZB.

    4. Digram EG forms a rectangle, replace it with XD.

    5. Bigram OL forms a rectangle, we replace it with KY.

    6. Bigram DI forms a rectangle, we replace it with BE.

    7. Bigram NT forms a rectangle, we replace it with JV.

    8. Digram HE forms a rectangle, we replace it with DM.

    9. Digram TR forms a rectangle, we replace it with UI.

    10. Digram EX is in one line, replace it with XM.

    11. Bigram ES forms a rectangle, we replace it with MN.

    12. Digram TU is in one line, replace it with UV.

    13. Digram MP forms a rectangle, we replace it with IF.

We get the ciphertext "BM ND ZB XD KY BE JV DM UI XM MN UV IF". Thus the message "Hide the gold in the tree stump" is converted to "BMNDZBXDKYBEJVDMUIXMMNUVIF".

Wheatstone double square

Charles Wheatstone developed not only the Playfair cipher, but also another bigram encryption method, which is called the "double square". The cipher uses two tables at once, placed along the same horizontal line, and the encryption goes in digrams, as in the Playfair cipher.

There are two tables with Russian alphabets randomly located in them.

Before encryption, the original message is divided into digrams. Each digram is encrypted separately. The first letter of the digram is found in the left table, and the second letter is found in the right table. Then they mentally build a rectangle so that the bigram letters lie at its opposite vertices. The other two vertices of this rectangle give the letters of the digram of the ciphertext. Let us assume that the bigram of the initial text of the IL is encrypted. The letter AND is in column 1 and row 2 of the left table. The letter L is in column 5 and row 4 of the right table. This means that the rectangle is formed by rows 2 and 4, as well as columns 1 of the left table and 5 of the right table. Therefore, the ciphertext bigram includes the letter O, located in column 5 and row 2 of the right table, and the letter B, located in column 1 and row 4 of the left table, i.e. we get the bigram of the ciphertext OB.

If both letters of the digram of the message lie in the same line, then the letters of the ciphertext are taken from the same line. The first letter of the bigram of the ciphertext is taken from the left table in the column corresponding to the second letter of the bigram of the message. The second letter of the bigram of the ciphertext is taken from the right table in the column corresponding to the first letter of the bigram of the message. Therefore, the digram of the TO message turns into a bigram of the ciphertext ZB. All digrams of the message are encrypted in a similar way:

Message

Ciphertext PE OV SCHN FM ESH RF BZh DC

Encryption using the "double square" method gives a very resistant to opening and easy to use cipher. Breaking the "double square" ciphertext requires a lot of effort, while the length of the message must be at least thirty lines, and without a computer it is not realistic at all.

Polyalphabetic ciphers

Vigenère cipher

The Vigenère cipher became a natural development of the Caesar cipher. Unlike monoalphabetic ciphers, this is already a polyalphabetic cipher. The Vigenère cipher consists of a sequence of several Caesar ciphers with different shift values. For encryption, a table of alphabets called "tabula recta" or "Vigenere square (table)" can be used. Each stage of encryption uses different alphabets, selected depending on the letter of the keyword.

For Latin, the Vigenère table might look like this:

For the Russian alphabet like this:

It is easy to see that the rows of this table are ROT ciphers with a successively increasing shift.

Encryption is as follows: under the line with the source text, the keyword is cyclically written into the second line until the entire line is filled. Each letter of the source text below has its own key letter. Further in the table we find the encoded letter of the text in the top line, and the letter of the code word on the left. At the intersection of the column with the original letter and the row with the code letter, the desired encrypted letter of the text will be located.

An important effect achieved when using a polyalphabetic cipher such as the Vigenère cipher is the masking of the frequencies of the occurrence of certain letters in the text, which simple substitution ciphers lack. Therefore, it will no longer be possible to apply frequency analysis to such a cipher.

To encrypt with the Vigenère cipher, you can use Vigenère cipher online calculator. For various variants of the Vigenère cipher with a right or left shift, as well as with the replacement of letters with numbers, you can use the tables below:

Gronsveld cipher

book cipher

If, however, a whole book (for example, a dictionary) is used as a key, then it is possible to encrypt not individual letters, but whole words and even phrases. Then the coordinates of the word will be the page number, the line number and the number of the word in the line. There are three numbers for each word. You can also use the book's internal notation - chapters, paragraphs, and so on. For example, it is convenient to use the Bible as a code book, because there is a clear division into chapters, and each verse has its own marking, which makes it easy to find the desired line of text. True, there are no modern words like “computer” and “internet” in the Bible, so for modern phrases it is better, of course, to use an encyclopedic or explanatory dictionary.

These were substitution ciphers in which letters are replaced by others. And there are also in which the letters are not replaced, but mixed with each other.

On this day, the Cryptographic Service of Russia celebrates its professional holiday.

"Cryptography" from ancient Greek means "secret writing".

How were the words hidden?

A peculiar method of transmitting a secret letter existed during the reign of the dynasty of the Egyptian pharaohs:

chose a slave. They shaved his head bald and applied the text of the message to it with waterproof vegetable paint. When the hair grew, it was sent to the addressee.

Cipher- this is some kind of text transformation system with a secret (key) to ensure the secrecy of the transmitted information.

AiF.ru made a selection of interesting facts from the history of encryption.

All secret writing systems have

1. Acrostic- a meaningful text (word, phrase or sentence), composed of the initial letters of each line of the poem.

Here, for example, is a riddle poem with a clue in the first letters:

D I am generally known by my own name;
R the rogue and the blameless swear by him,
At tehoy in disasters I am more than anything,
AND life is sweeter with me and in the best share.
B I can serve the happiness of pure souls alone,
BUT between the villains - I will not be created.
Yuri Neledinsky-Meletsky
Sergei Yesenin, Anna Akhmatova, Valentin Zagoryansky often used acrostics.

2. Litorrhea- a kind of cipher writing used in ancient Russian handwritten literature. It is simple and wise. A simple one is called a gibberish letter, it consists in the following: putting consonants in two rows in order:

they use upper letters instead of lower ones in writing and vice versa, and the vowels remain unchanged; for example, tokepot = kitten etc.

Wise litorea implies more complex substitution rules.

3. "ROT1"- cipher for kids?

You may have used it as a child too. The key to the cipher is very simple: each letter of the alphabet is replaced by the next letter.

A becomes B, B becomes C, and so on. "ROT1" literally means "rotate 1 letter forward in the alphabet". Phrase "I love borscht" turn into a secret phrase "A yavmya vps". This cipher is meant to be fun, easy to understand and decipher, even if the key is used in reverse.

4. From the rearrangement of terms ...

During World War I, confidential messages were sent using so-called permutation fonts. In them, the letters are rearranged using some given rules or keys.

For example, words can be written backwards so that the phrase "mom washed the frame" turns into a phrase "amam alym umar". Another permutation key is to permute each pair of letters so that the previous message becomes "am um um al ar um".

It may seem that complex permutation rules can make these ciphers very difficult. However, many encrypted messages can be decrypted using anagrams or modern computer algorithms.

5. Caesar's shift cipher

It consists of 33 different ciphers, one for each letter of the alphabet (the number of ciphers varies depending on the alphabet of the language used). The person had to know which Julius Caesar cipher to use in order to decipher the message. For example, if the cipher Ё is used, then A becomes Ё, B becomes F, C becomes Z, and so on in alphabetical order. If Y is used, then A becomes Y, B becomes Z, C becomes A, and so on. This algorithm is the basis for many more complex ciphers, but by itself does not provide reliable protection of the secret of messages, since checking 33 different cipher keys will take relatively little time.

Nobody could. Try you

Encrypted public messages tease us with their intrigue. Some of them still remain unsolved. Here they are:

Cryptos. A sculpture by artist Jim Sanborn that is located in front of the Central Intelligence Agency headquarters in Langley, Virginia. The sculpture contains four ciphers; it has not been possible to open the fourth code so far. In 2010, it was revealed that the characters 64-69 NYPVTT in the fourth part stand for the word BERLIN.

Now that you have read the article, you will surely be able to solve three simple ciphers.

Leave your options in the comments to this article. The answer will appear at 13:00 on May 13, 2014.

Answer:

1) saucer

2) The baby elephant is tired of everything

3) Good weather