Simple ciphers. Simple ciphers and their decryption

Once upon a time, the eldest Nastya and I voraciously played detectives and detectives, came up with our own codes and methods of investigation. Then this hobby passed and now it has returned again. Nastya has a fiancé, Dimka, who enthusiastically plays scouts. My daughter shared his passion. As is known, in order to transmit to each other important information, intelligence officers need a code. With these games you will also learn how to encrypt a word or even an entire text!

White spots

Any text, even without a code, can turn into hard-to-read gibberish if the spaces between letters and words are incorrectly placed.

For example, this is what a simple and understandable sentence turns into "Meet me at the lakeside" - "Meeting Yanaber Yeguozera".

Even attentive person will not immediately notice the catch. But experienced intelligence officer Dimka says that this is the simplest type of encryption.

No vowels

Or you can use this method - write text without vowels.

As an example, here is a sentence: "The note lies in the hollow of an oak tree that stands at the edge of the forest". The ciphertext looks like this: "Zpska lies in dpl db, ktr stt n pshke ls".

This will require ingenuity, perseverance, and, possibly, the help of adults (who also sometimes need to exercise their memory and remember their childhood).

Read it backwards

This encryption combines two methods at once. The text must be read from right to left (that is, vice versa), and spaces between words can be placed at random.

Here, read and decipher: "Neleta minv oak, manoro tsop irtoms".

Second for the first

Or each letter of the alphabet can be represented by the letter that follows it. That is, instead of “a” we write “b”, instead of “b” we write “c”, instead of “c” we write “d” and so on.

Based on this principle, you can create an unusual cipher. To avoid confusion, we made mini-cheat sheets for all participants in the game. It is much more convenient to use this method with them.

Guess what kind of phrase we have encrypted for you: "Tjilb g tjsibmzh fiobue mzhdlp – po ozhlpdeb ozh toynbzhu shmarf".

Deputies

The "Replacement" method is used on the same principle as the previous cipher. I read that it was used to encrypt sacred Jewish texts.

Instead of the first letter of the alphabet, we write the last, instead of the second, the penultimate one, and so on. That is, instead of A - Z, instead of B - Yu, instead of C - E...

To make it easier to decipher the text, you need to have the alphabet and a piece of paper with a pen on hand. Look at the letter matches and write it down. It will be difficult for a child to estimate by eye and decipher.

Tables

You can encrypt text by first writing it into a table. You just need to agree in advance which letter you will use to mark the spaces between words.

A small hint - it should be a common letter (such as p, k, l, o), because letters that are rarely found in words immediately catch the eye and because of this the text is easily deciphered. You also need to discuss how big the table will be and how you will enter the words (from left to right or top to bottom).

Let's encrypt the phrase together using the table: At night we go to catch crucian carp.

We will denote a space with the letter “r”, writing words from top to bottom. Table 3 by 3 (we draw in the cells of a regular notebook sheet).

Here's what we get:
N B I M O T K A Y
O Y D R V A S R
CH R E L I R R E.

Lattice

In order to read the text encrypted in this way, you and your friend will need the same stencils: sheets of paper with squares cut out on them in random order.

The encryption must be written on a piece of paper in exactly the same format as the stencil. Letters are written in hole cells (and you can also write, for example, from right to left or from top to bottom), the remaining cells are filled with any other letters.

The key is in the book

If in the previous code we prepared two stencils, now we will need identical books. I remember back in my childhood the boys at school used Dumas’s novel “The Three Musketeers” for these purposes.

The notes looked something like this:
"324 s, 4 a, b, 7 words.
150 s, 1 a, n, 11 sl...”

First digit indicated the page number,
second– paragraph number,
third letter– how to count paragraphs from above (v) or from below (n),
fourth letter- word.

In my example the right words need to search:
First word: on page 324, 4th paragraph from the top, seventh word.
Second word: on page 150, 1 paragraph from the bottom, eleventh word.

The decryption process is slow, but no outsider will be able to read the message.

Instructions

Taking advantage in modern terms, any encrypted message has an author who composed it; the addressee for whom it is intended; and the interceptor - the cryptographer trying to read it.

There are two main methods used in manual encryption: substitution and permutation. The first is that the letters of the original message are replaced by others according to a certain rule. The second is that the letters, again according to the rule, change places. Of course, these two methods can be combined, which makes the cipher more secure.

The simplest type of substitution cipher is cryptography. In this case, the letters are replaced with conventional icons: numbers, symbols, images of dancing men, and so on. To reveal a secretly written message, it is enough to determine which symbol corresponds to which letter.

For this purpose, frequency tables are usually used, showing how often a particular letter occurs in the language of the message. For example, in a language, the first places in such a table will be the letters “a”, “e”, “o”. By substituting them instead of the most frequently encountered icons, you can decipher some words, and this, in turn, will give the meanings of other symbols.

In more secure ciphers, letters are replaced by key. For example, the key could be multi-digit number. To encrypt text in this way, a key number is written over it many times so that there is a number above each letter. After this, the letter is replaced by another, the one following it through as many positions as indicated by the number. In this case, the alphabet is considered closed in a ring, that is, for example, the second letter after “i” will be “b”.

It is more difficult to open such a cryptogram, since for each letter of the cipher there are ten reading options. To decrypt, you must first determine the length of the key and divide the text into words. This is usually done using a table, where the first line is the encryption text, and below it are options where each letter of the cipher is replaced with a possible letter source text. Thus, the table has eleven lines.

By looking at which options lead to the most natural-looking division of the text into words, the cryptographer determines what letters are used to encode spaces, and therefore finds one or more digits of the key. From this you can already begin to draw conclusions about how many times the key is repeated in the text.

Putting it in place for now unknown letters options from the table, the cryptographer determines in which cases meaningful words and fragments appear in the text.

To make his work easier, the cryptographer usually seeks to find out any information about the contents of the text or key. If you know what signature is at the end of the document, or what word should be repeated there often, then using this information you can reveal part of the encryption key. By substituting the found fragment in other places in the document, the cryptographer finds out the length of the key and learns several more parts of the source text.

Video on the topic

Sources:

  • Vladimir Zhelnikov. Cryptography from papyrus to computer
  • how to replace letters with symbols

Decoding is one of the most exciting activities. After all, it is always so curious to find out what exactly is hidden behind this or that encoding. Moreover, there are very, very many types of different ciphers. Therefore, there are also plenty of ways to recognize and translate them. The most difficult task- correctly determine exactly how to decipher a particular riddle.

Instructions

If you are going to decrypt a specific encoding, remember that in most cases information is encrypted through substitution. Try to identify the most common letters in the language and match them with the ones you have in the code. Researchers have made your task easier and some of them have already been compiled into specific table. If you use it, it will significantly speed up the decryption process. In a similar way, at one time they were solved ciphers Polybius and Caesar.

To make it easier to study, use the keys. To decrypt, you will need a concept like the length of the key, which you can only determine by selecting individual letters (see step 1). Once you select the length of your key, you can form a group of characters that is encoded with one letter. And so gradually the whole code will be revealed to you. This process is quite labor-intensive and time-consuming, so please be patient.

Also try to decipher the message by selecting one word that a large share probabilities should appear in this text. Shift it across the text until it overlaps itself in the cipher. This way you will define part of the key. Next, decipher the text in the area around the key. Select text decoding options accordingly. It must necessarily correlate with the key word and be adequate to it, i.e. match the context.

Remember that to successfully decipher the encoding, you will need knowledge of the most well-known message encryption methods. So, for example, if you have a text dating from the 5th century BC, then with a high degree of probability you can say that it is encoded in a wandering. The principle of such encryption was the method of simple permutation. That is, the letters of the alphabet simply swapped places and then, using a round object, were applied to the sheet in a chaotic order. To decipher such a message, the main thing is to correctly restore the size of this round object.

Digital encryption recognize with mathematical methods. One popular way is to use probability theory. And in the Middle Ages, using mathematical symbols was carried out by rearranging and using magic squares. These are figures in which the numbers fit into the cells sequentially natural numbers. They usually start with 1. Secret magic square is that all the numbers in it add up to each column or row or diagonal to give the same number.

Take into account the fact that the text for decryption is located in such a square according to the numbering of the cells. Write down the contents of the table and get the text that needs to be decrypted. And only then, by rearranging, select the required encryption option.

The fashion for deciphering words is quickly spreading on the Internet. Some people sincerely believe in the meaning of this action, others are openly having fun. In both cases we're talking about about solving puzzles. Only the rules of the puzzle may be different.

Methods: explanatory-illustrative, partially search.

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

Tasks:

educational:

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

developing:

educational:

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

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

Should everyone always 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 secret writing and learn the simplest methods of encryption. You will have the opportunity to decipher the messages.

Simple encryption techniques were used and became somewhat widespread already in the era of the ancient kingdoms and in antiquity.

Secret writing - cryptography - is the same age as writing. The history of cryptography goes back more than one millennium. The idea of ​​creating texts with secret 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 poem (mid-2nd millennium BC).

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

The simplest of them is “Atbash”, the alphabet was divided down 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 on all the rulers of the world, ending with the “king of Seshach”, who, when deciphered from the Atbash cipher, turns out to be the king of Babylon.

(Slide 3) A more ingenious method of encryption was invented in ancient Sparta in the time of Lycurgus (5th century BC) the Scitalla was used to encrypt the text - a cylindrical rod on which a parchment ribbon was wound. The text was written line by line along the axis of the cylinder, the tape was unwound from the staff and passed on to the addressee who had a Scytalla of the same diameter. This method rearranged 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 deciphering device “Antiscitalla”.

(Slide 4) Task “Test 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 transmit 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 “Test yourself”

(Slide 7) Special role The encryption method proposed by JULIUS CAESAR and described by him in “Notes on the Gallic War” played a role in maintaining the secret.

(Slide 8) Task “Test 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, Count de Gronsfeld, a military man and diplomat). Encryption consists 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. Ciphers that use many alphabetic or multi-digit substitutions can increase cryptographic strength. In such ciphers, each symbol open alphabet not one, but several encryption symbols are assigned.

(Slide 11) Scientific methods in cryptography first appeared in Arab countries. The word cipher itself is of Arabic origin (from the Arabic “digit”). The Arabs were the first to replace letters with numbers in order to protect the original text. Even the tales of “A Thousand and One Nights” speak about secret writing and its meaning. The first book specifically devoted to the description of some ciphers appeared in 855, it was called “The Book of Man’s Great Striving to Unravel the Mysteries of Ancient Writing.”

(Slide 12) The Italian mathematician and philosopher GEROLAMO CARDANO wrote the book “On Subtleties”, which contains a part devoted to cryptography.

His contribution to the science of cryptography contains two sentences:

The first is to use plaintext as a key.

Secondly, he proposed a cipher now called the “Cardano Lattice”.

In addition to these proposals, Cardano provides a “proof” of the strength of ciphers based on counting the number of keys.

The Cardano grid is a sheet of hard material in which rectangular cuts of one stitch height and varying lengths are made at irregular intervals. By placing this grid on a sheet of writing paper, a secret message could be written into the cutouts. The remaining spaces were filled with random text masking the secret message. This method of camouflage was used by many famous historical figures, Cardinal Richelieu in France and Russian diplomat A. Griboedov. Based on this lattice, Cardano constructed a permutation cipher.

(Slide 13) Task “Test yourself”

(Slide 14) They were also interested in secret writing in Russia. The ciphers used are the same as in Western countries - sign, substitution, permutation.

The date of the appearance of the cryptographic service in Russia should be considered 1549 (the reign of Ivan IV), from the moment of the formation of the “embassy order”, which had a “digital department”.

Peter I completely reorganized the cryptographic service, creating the “Embassy Office”. At this time, codes are used for encryption, as applications to the “digital alphabet”. In the famous “case of Tsarevich Alexei”, “digital alphabet” also appeared in the indictment materials.

(Slide 15) Task “Test yourself”

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

In 1817, DECIUS WADSWORTH constructed a ciphering device which introduced a new principle into cryptography. The innovation was that he made plaintext and ciphertext alphabets of various lengths. The device with which he accomplished 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 periodic polyalphabetic substitution.

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

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

LOUIS BRAILLE improved the system and developed his own cipher. The basics of this system are still in use today.

(Slide 18) SAMUEL MORSE developed a system for encoding characters using dots and dashes in 1838. He is also the inventor of the telegraph (1837) - a device in which this system was used. 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 “Test yourself”

(Slide 20) B late XIX century, cryptography begins to take on features exact science, and not just art, they are beginning to study it 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 and to simplify the algorithm for implementing the Vigenère cipher. It is in this mechanization of the encryption-decryption processes that the authors of the line make their contribution to practical cryptography.

In the history of cryptography of the 19th century. the name of AUGUSTE KERCHOFFS was clearly imprinted. In the 80s of the 19th century he published the book “Military Cryptography” of only 64 pages, but they immortalized his name in the history of cryptography. It sets out 6 specific requirements for ciphers, two of which relate to encryption strength, and the rest to performance. One of them (“compromising the system should not cause inconvenience to correspondents”) became known as the “Kerkhoffs rule.” All these requirements are still 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 elemental base of computer technology, electronic encryptors appeared. Today, it is electronic encryptors that make up the overwhelming share of encryption tools. They meet ever-increasing requirements for encryption reliability and speed.

In the seventies, two events occurred that seriously influenced the further development of cryptography. First, the first data encryption standard (DES) was adopted (and published!), “legalizing” the Kerkhoffs principle in cryptography. Secondly, after the work of American mathematicians W. DIFFY and M. HELLMAN, “new cryptography” was born - public key cryptography.

(Slide 22) Task “Test yourself”

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

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

Every user of electronic means of information exchange will need familiarity with cryptography, so cryptography in the future will become a “third literacy” on a par with the “second literacy” - computer and information technology skills.

In substitution ciphers (or substitution ciphers), unlike, 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 replacement occurs with letters or numbers. When the replacement occurs with some other non-alphanumeric characters, with combinations of characters or pictures, it 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 replacement rules: what to change A to, what to change B to, etc.

Such ciphers are quite easy to decipher even without knowing the key. This is done using frequency analysis ciphertext - you need to count how many times each letter appears in the text, and then divide by total number letters The resulting frequency must be compared with the reference one. The most frequent letter for the Russian language it is the letter O, followed by E, etc. 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 letters will differ from the standard, and more time will have to be spent on solving. Below is a table of letter frequency (i.e. relative frequency letters found in the text) of the Russian language, calculated on the basis of NKRY.

The use of frequency analysis to decrypt encrypted messages has been beautifully described in many literary works, for example, in Arthur Conan Doyle's novel "" or Edgar Allan Poe's "".

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

Random code

As I already wrote above, in general case For a replacement cipher, you need to figure out which letter should be replaced with which. The simplest thing is to take and randomly mix the letters of the alphabet, and then write them down under the line of the alphabet. The result is 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 an encryption point of view short messages- this is the most ideal option: To decipher, you need to know the code table. It is impossible to go through such a number of options, but if you encrypt short text, then frequency analysis cannot be applied.

But to use it in quests, such a code table needs to be presented in a more beautiful way. The solver must first either simply find this table or solve some kind of verbal-letter riddle. For example, guess or solve.

Keyword

One option for compiling a code table is to use a keyword. We write down the alphabet, under it we first write keyword, consisting of non-repeating letters, and then 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 was shuffled, but the end remained unshuffled. This is because the most “senior” letter in the word “manuscript” is the letter “U”, so after it there is an unmixed “tail”. The letters in the tail will remain unencoded. You can leave it like this (since most letters are still encoded), but you can take a word that contains the letters A and Z, then all the letters will be mixed up, and there will be no “tail”.

The keyword itself can also be guessed in advance, for example using or. For example, like this:

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

Atbash

The cipher was originally used for the Hebrew alphabet, hence the name. The word atbash (אתבש) is made up of the letters "aleph", "tav", "bet" and "shin", that is, first, last, second and penultimate letters Hebrew alphabet. This sets the replacement rule: the alphabet is written out in order, and underneath it is written out backwards. Thus, the first letter is encoded into the last, the second - into the penultimate, etc.

The phrase “TAKE HIM TO THE EXCEPTION” is transformed with the help of this cipher into “ERCHGTC ЪЪР E VФНПжС”. Online Atbash cipher calculator

ROT1

This code is known to many children. The key is simple: each letter is replaced by the next one in the alphabet. So, A is replaced by B, B by C, etc., and I is replaced by A. “ROT1” means “ROTate 1 letter forward through the alphabet.” The message “Hryuklokotam oinklokotamit at night” will become “Tsyalmplpubn tsyalmplpubnyu rp opshbn.” ROT1 is fun to use because it is easy for a child to understand and easy to use for encryption. But it is just as easy to decipher.

Caesar Cipher

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

I still believe that the Russian language has 33 letters, so I propose this code table:

It’s interesting that in this version the replacement alphabet reads the phrase “where is the hedgehog?” :)

But the shift can be done by arbitrary number 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 the 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 the atbash on such a disk, and you will get something like this:

Actually, that’s why such ciphers are called ROT - from English word“rotate” - “rotate”.

ROT5

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

ROT13

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

The 26-letter Latin alphabet 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

It's simple. ROT18 is a combination of ROT5 and ROT13 :)

ROT47

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

For example, a link to this text will be encrypted like this: 9EEAi^^?@K5C]CF^82>6D^BF6DE^4CJAE^4:A96C^K2>6?2nURC@Ecf. Only an experienced solver will be able to guess from the repeated pairs of characters at the beginning of the text that 9EEAi^^ can mean HTTP:⁄⁄ .

Polybius Square

Polybius - Greek historian, commander and statesman, who lived in the 3rd century BC. He came up with an original simple substitution code that became known as the Polybius square or Polybius checkerboard. This type coding was originally used for Greek alphabet, but was then extended to other languages. The letters of the alphabet fit into a square or suitable rectangle. If there are more letters for a square, then they can be combined in one cell.

Such a table can be used as in the Caesar cipher. To encrypt a square, we find the letter of the text and insert the lower one in the same column into the encryption. If the letter is on the bottom line, then take the top one from the same column. For Cyrillic alphabet you can use the table ROT11(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’s better, of course, to use the “trick” 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 these two lines into one line, divide it into pairs of numbers and using these pairs as coordinates, we again encode using the Polybius square.

    It can be complicated. We write the original coordinates in a line without splitting them into pairs, shift them by odd number of steps, divide the result into pairs and encode again.

A 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 should not contain repeated letters.

A version of the Polybius cipher is used in prisons by tapping out the coordinates of 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, only the key is not the alphabet, but a poem that fits line by line into a square of a given size (for example, 10x10). If the line is not included, then its “tail” is cut off. Next, the resulting square is used to encode the text letter by letter with two coordinates, as in the Polybius square. For example, take a good verse from “Borodino” by Lermontov and fill out the table. We notice that the letters E, J, X, Ш, Ш, Ъ, E are not in the table, which means we won’t be able to encrypt them. The letters, of course, are rare and may not be needed. But if they are still needed, you will have to choose another verse that contains 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 will end up with something like this: Tckb gsnfnmcz gbcfnm gj-heccrb? pf,sd gthtrk.xbnmcz yf heccre. hfcrkflre? nj gjkexbncz xnj-nj nbgf "njuj^ Why not a code? The best replacement cipher ever. The keyboard acts as a code table.

The conversion table looks like this:

Litorrhea

Litorrhea (from Latin littera - letter) is secret writing, a type of encrypted writing used in ancient Russian handwritten literature. There are two types of litorrhea: simple and wise. A simple one, otherwise called gibberish, is as follows. If “e” and “e” are counted as one letter, then there are thirty-two letters left in the Russian alphabet, which can be written in two rows - sixteen letters in each:

The result will be a Russian analogue of the ROT13 cipher - ROT16:) When encrypting, the upper letter is replaced with a lower one, and the lower letter with an upper one. An even simpler version of litorrhea - leaving only twenty consonant letters:

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

Wise litorrhea involves more complex rules substitutions. 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 over the resulting sequence of numbers.

Bigram encryption

Playfair cipher

The Playfair cipher is a manual symmetric 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 more complex systems Vigenere encryption. Thus, the Playfair cipher is more resistant to cracking compared to a simple substitution cipher, since frequency analysis is more difficult.

The Playfair cipher uses a 5x5 table (for the Latin alphabet, for the Russian alphabet you need to increase the table size 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 the empty cells of the table with the letters of the keyword (without writing repeating characters), then fill the remaining cells of the table with alphabetical characters not found in the keyword, in order (in English texts usually the "Q" character is omitted to make the alphabet smaller; other versions combine "I" and "J" 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 left top corner to the center. The keyword, supplemented by the alphabet, forms a 5x5 matrix and is the cipher key.

In order to encrypt a message, you need to break it into bigrams (groups of two characters), for example, “Hello World” becomes “HE LL OW OR LD,” and find these bigrams in a table. The two bigram symbols correspond to the corners of a rectangle in the key table. We 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 symbols match, add an “X” after the first symbol, encrypt a new pair of symbols and continue. Some variants of the Playfair cipher use "Q" instead of "X".

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

    3) If the bigram symbols of the source text occur in one column, then they are converted to the symbols of the same column located directly below them. If a 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 with symbols located in the same rows, but corresponding to other corners of the rectangle.

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

Let's look at an example of composing a cipher. We use the “Playfair example” key, then the matrix will take the form:

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

    1. The bigram HI forms a rectangle, replace it with BM.

    2. The bigram DE is located in one column, replace it with ND.

    3. The bigram TH forms a rectangle, replace it with ZB.

    4. The bigram EG forms a rectangle, replace it with XD.

    5. The bigram OL forms a rectangle, replace it with KY.

    6. The bigram DI forms a rectangle, replace it with BE.

    7. The bigram NT forms a rectangle, replace it with JV.

    8. The bigram HE forms a rectangle, replace it with DM.

    9. Bigram TR forms a rectangle, replace it with UI.

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

    11. The bigram ES forms a rectangle, replace it with MN.

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

    13. The bigram MP forms a rectangle, replace it with IF.

We get the encrypted text “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".

Double Wheatstone square

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

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

Before encryption, the original message is divided into bigrams. Each bigram is encrypted separately. The first letter of the bigram is found in the left table, and the second letter in the right table. Then mentally construct a rectangle so that the letters of the bigram lie in it opposite vertices. The other two vertices of this rectangle give the letters of the ciphertext bigram. Let us assume that the bigram of the original text IL is encrypted. The letter I 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, and columns 1 of the left table and 5 of the right table. Consequently, the ciphertext bigram includes the letter O, located in column 5 and line 2 of the right table, and the letter B, located in column 1 and line 4 of the left table, i.e. we obtain the ciphertext bigram OB.

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

Message APPLIED AYU _SH ES TO GO

Ciphertext PE OV SHCHN FM ESH RF BZ DC

Double-square encryption produces a highly tamper-resistant and easy-to-use cipher. Cracking a double square ciphertext requires a lot of effort, and the message length must be at least thirty lines, and without a computer it is not at all possible.

Polyalphabetic ciphers

Vigenère cipher

A natural development of the Caesar cipher was the Vigenère cipher. Unlike monoalphabetic ones, this is already a polyalphabetic cipher. The Vigenère cipher consists of a sequence of several Caesar ciphers with different meanings shift For encryption, a table of alphabets called a "tabula recta" or "Vigenère square (table)" can be used. At each stage of encryption, different alphabets are used, selected depending on the letter of the keyword.

For the Latin alphabet, 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 successively increasing shifts.

They encrypt it like this: 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 has its own key letter below. Next 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 masking the frequencies of appearance of certain letters in the text, which simple substitution ciphers do not have. 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 versions of the Vigenère cipher with a shift to the right or left, as well as with replacing letters with numbers, you can use the tables below:

Gronsveld cipher

Book cipher

If you use a whole book (for example, a dictionary) as a key, then you can encrypt without individual letters, but whole words and even phrases. Then the coordinates of the word will be the page number, line number and word number in the line. For each word you get three numbers. You can also use the internal notation of the book - chapters, paragraphs, etc. 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, not in the Bible modern words type “computer” and “Internet”, 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 with others. And there are also ones in which the letters are not replaced, but mixed together.

Ever since humanity grew to writing, codes and ciphers are used to protect messages. The Greeks and Egyptians used ciphers to protect personal correspondence. In fact, it is from this glorious tradition that the modern tradition of breaking codes and ciphers grows. Cryptanalysis is the study of codes and methods of breaking them, and is an activity in modern realities can bring a lot of benefits. If you want to learn this, you can start by studying the most common ciphers and everything connected with them. In general, read this article!

Steps

Decryption of substitution ciphers

    Start by looking for one-letter words. Most ciphers based on relatively simple substitution are most easily broken by simple brute-force substitution. Yes, you will have to tinker, but it will only get more difficult.

    • Words consisting of one letter in Russian are pronouns and prepositions (ya, v, u, o, a). To find them, you will have to carefully study the text. Guess, check, fix or try new options - there is no other method of solving the cipher.
    • You must learn to read the code. Hacking it is not that important. Learn to pick out the patterns and rules underlying the cipher, and then breaking it will not be fundamentally difficult for you.
  1. Look for the most frequently used symbols and letters. For example, in English these are “e”, “t” and “a”. When working with a code, use your knowledge of language and sentence structure, based on which you make hypotheses and assumptions. Yes, you will rarely be 100% sure, but solving codes is a game where you are required to make guesses and correct your own mistakes!

    • Double characters and short words look first, try to start decoding with them. It’s easier, after all, to work with two letters than with 7-10.
  2. Pay attention to apostrophes and symbols around. If the text contains apostrophes, then you are in luck! So, in case English language, the use of an apostrophe means that characters such as s, t, d, m, ll or re are encrypted after. Accordingly, if there are two identical characters after the apostrophe, then this is probably L!

    Try to determine what type of cipher you have. If, while solving a code, at a certain moment you understand which of the types described above it belongs to, then you have practically solved it. Of course, this will not happen very often, but the more codes you solve, the easier it will be for you later.

    • Digital substitution and keyboard ciphers are most common these days. When working on a cipher, first check to see if it is the same type.

    Recognition of common ciphers

    1. Substitution ciphers. Strictly speaking, substitution ciphers encode a message by replacing some letters with others, according to a predetermined a specific algorithm. The algorithm is the key to solving the cipher; if you solve it, then decoding the message will not be a problem.

      • Even if the code contains numbers, Cyrillic or Latin, hieroglyphs or unusual characters - as long as the same types of characters are used, then you are probably working with a substitution cipher. Accordingly, you need to study the alphabet used and derive substitution rules from it.
    2. Square cipher. The simplest encryption, used by the ancient Greeks, based on the use of a table of numbers, each of which corresponds to a letter and from which words are subsequently composed. This is really simple code, kind of the basics. If you need to solve a cipher in the form of a long string of numbers, it is likely that the methods of working with a square cipher will be useful.

      Caesar's cipher. Caesar could not only do three things at once, he also understood encryption. Caesar created a good, simple, understandable and, at the same time, crack-resistant cipher, which was named in his honor. The Caesar Cipher is the first step towards learning complex codes and ciphers. The essence of the Caesar cipher is that all characters of the alphabet are shifted in one direction by a certain number of characters. For example, shifting 3 characters to the left will change A to D, B to E, etc.

      Watch out for keyboard patterns. Based on the traditional QWERTY keyboard layout, various ciphers are now being created that work on the principle of displacement and substitution. The letters are shifted left, right, up and down by a certain number of characters, which allows you to create a cipher. In the case of such ciphers, you need to know in which direction the characters were shifted.

      • So, by moving the columns up one position, “wikihow” becomes “28i8y92”.
      • Polyalphabetic ciphers. Simple substitution ciphers rely on the cipher creating a kind of alphabet for encryption. But already in the Middle Ages it became too unreliable, too easy to hack. Then cryptography took a step forward and became more complex, starting to use symbols from several alphabets for encryption. Needless to say, the reliability of encryption immediately increased.

    What does it mean to be a code breaker?

      Be patient. Breaking a code requires patience, patience and more patience. And perseverance, of course. This is slow, painstaking work involving a large number disappointments due to common mistakes and the need to constantly select symbols, words, methods, etc. A good codebreaker simply has to be patient.



Did you like the article? Share with your friends!