How to decrypt the secret code. Ciphers and codes

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

Studying 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. Walking the historical path from the Julius Caesar cipher to RSA keys, from the Rosetta Stone to Esperanto, we learn to perceive information in an unfamiliar form, solve riddles, and get used to multivariance. And most importantly, we learn to understand: both different people, unlike 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: it was the Roman Empire who discovered that there was still someone in the world whom they had not conquered. Under the command of Gaius Julius Caesar there is a huge army that must be quickly and accurately controlled.

Spies are not asleep, 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 of losing the battle.

But then the messenger is captured, the attacker unfolds the note... and understands nothing! “Probably,” he scratches the back of his head, “it’s on some unknown language..." Rome triumphs, its plans are safe.

What is the Caesar cipher? Its simplest version is when instead of each letter we put the next one in the alphabet: instead of “a” - “b”, instead of “e” - “z”, and instead of “i” - “a”. Then, for example, “I like to play” will become “A mävmä ydsbue.” Let's look at the sign; at the top there will be a letter that we encrypt, and at the bottom there will be a letter with which we replace it.

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

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

More precisely, she would have looked like this if Caesar lived in Russia. In his case, the alphabet was Latin.

Such a cipher is quite easy 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 plot. Agree on your shift number, and you can leave coded notes on each other's refrigerator for a surprise for someone's birthday, send coded messages, and maybe, if you're separated for a long time, even write secret, coded letters to each other!

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

What is "crack the code"? This means coming up with a way to solve it without knowing the key and meaning of the cipher. The Caesar cipher was also once cracked using the so-called “frequency analysis method.” Look at any text - there are many more vowels in it than consonants, and there are much more “o” 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 an encrypted “o”, “e”, “i” or “a” - the most common letters in Russian words. And as soon as you know what letter is used to denote, for example, “a,” you know how much the encrypted alphabet is “shifted,” which means you can decipher the entire text.

When the whole world learned the solution to Caesar's code, cryptographers had to come up with something more powerful. But, as often happens, people did not invent something completely new, but complicated what already existed. Instead of encrypting all the letters using the same shifted alphabet, several of them began to be used in secret messages. For example, we encrypt the first letter in the alphabet with a shift of 3, the second - with a shift of 5, the third - with a shift of 20, the fourth - again with a shift of 3, 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, multi-alphabetic). Try it, your cipher can only be solved by someone who is privy to the secrets of cryptography!

It would seem that the attackers should have become confused and the secrets should have remained secrets forever. But if the cipher has been cracked once, then any more complex versions of it will also be cracked once.

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

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

If the coder 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 were three alphabets, and not, for example, five? They didn't really know. And we went through everything possible options. Therefore, decryption took much longer, but 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. Humanity is relying more and more on cars: trains are replacing carts, radios are appearing in almost every home, and the first airplanes have already taken flight. And the encryption of secret plans is also eventually transferred to machines.

During World War II, many machines were invented to encrypt messages, but they all relied on the idea that a polyalphabetic cipher could be further obfuscated. To confuse it so much that, although in theory it could be solved, in practice no one will succeed. Confuse as much as a machine can do, but a person cannot. The most famous of these encryption machines is Enigma, used by Germany.

theromanroad.files.wordpress.com

But while Germany’s most important secret was the design of Enigma, the most important secret of its opponents was that by the middle of the war all countries had already solved Enigma. If this had become known in Germany itself, they would have started to come up with 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 had come up with a machine for encrypting messages, they could also come up with a machine for decrypting them, and he 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 on its basis a machine 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 of the entire Second World War was invented by the Americans. Each US warship was assigned... an Indian. Their language was so incomprehensible and poorly understood, it sounded so strange that the codebreakers did not know how to approach it, and the US Navy fearlessly transmitted information in the language of the Choctaw Indian tribe.

In general, cryptography is not only about how to solve a riddle, but also about how to solve it. People don’t 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 there was an ancient riddle Egyptian language.

Nobody knew what all these hieroglyphs meant. What did the Egyptians mean when they painted birds and scarabs? But one lucky day french army discovered the Rosetta Stone in Egypt.

There was an inscription on this stone - the same one, in ancient Greek, Egyptian alphabetic (demotic text) and Egyptian hieroglyphic. 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 quickly enough, but historians, linguists, mathematicians, and cryptographers puzzled over the hieroglyphs for many years, but in the end they still 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 solved ciphers, there are three special ones. One is the Diffie–Hellman method. If a small message is encrypted using this method, then in order to decrypt it, you need to take all the computers in the world and keep them busy for many, many years. This is what is used on the Internet today.

The second is quantum encryption. True, it has not yet been completely invented, but if people make quantum computers the way they dream of them, then such a code will know when they are trying to decrypt 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 for them to decrypt it. Two people choose the same book, and each word in their writing is searched for and replaced with three numbers: the page number, the line number, and the word number 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 chose? And most importantly, computers won’t help much in this matter either. Of course, if you connect a lot smart people and a lot of powerful computers, such a cipher will not stand.

But there is a main safety rule. There should be so much of this security that the encrypted message is not worth the enormous effort that must be spent on deciphering it. That is, so that the villain - the spy - would have to spend as much effort to unravel your code as he is not willing 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 making 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 are at both, the calmer and more active our life can be.

Pavlova Diana

Ciphers, codes, cryptography in mathematics.

Download:

Preview:

Open humanitarian scientific and practical conference

Research works “Search and creativity”

Research work:

"Ciphers and codes."

Completed:

Pavlova Diana Borisovna

student of grade 9 "B"

Municipal educational institution secondary school No. 106

Supervisor:

Lipina Svetlana Vladimirovna

Math teacher

Volgograd 2013

Introduction……………………………………………………………………………….3

Chapter 1. Ciphers…………………………………………………………….4

Chapter 2. Cryptography……………………………………………………. 5

Chapter 3. Encryption methods…………………………………………….6

3.1. Replacement ciphers………………………………………………………6

3.2. Permutation ciphers…………………………………………………………….6

Chapter 4. Variety of ciphers……………………………………………7-12

4.1. Cipher as described by Plutarch ………………………………………...7

4.2. "Polybius Square" …………………………………………………….7

4.3. Caesar's cipher…………………………….………………………….8

4.4 Gronfeld cipher ………………………………………………………8

4.5 Viginère cipher………………………………………………………..8

4.6 Matrix coding method……………………………………9-10

4.7 Code “Rotary grid”……………………………………………………….10

4.8 Gamma………………………………………………………………10

4.9 Cryptography of the Second World War……..……………………………11-12

4.10 The role of cryptography in the global industry.................................................... ....12

Conclusion………………………………………………………………………………..13

Applications……………………………………………………………………………….14-15

Used literature………………………………………………………16

Introduction.

Target: explore the application of basic mathematics to compose ciphers

Tasks:

find out what the concept of “cryptology” includes;

find out what encryption methods are known;

explore the areas of use of ciphers.

Relevance of the topic: tIt’s hard to find a person who hasn’t watched the series: “The Adventures of Sherlock Holmes and Doctor Watson”, “Seventeen Moments of Spring”, where encrypted secret messages were used. With the help of codes and ciphers, you can send various messages and be sure that only the person who knows the key to it can read them. Is it possible to use encryption knowledge nowadays? This work will help answer this and other questions.

Problem: insufficient comprehensive study of ciphers.

Object of study: ciphers.

Subject of research:thematic tasks.

Research methods: comparative characteristics, problem solving.

Novelty and practical significance: dThis work will help you learn a lot interesting facts about ciphers. It is designed for different people age groups: children, teenagers, boys, girls, etc. Students will be exposed to materials beyond school curriculum, and will be able to apply the studied material in mathematics in a non-standard situation.

Chapter 1. Ciphers.

Code (from Arab.صِفْر ‎‎, ṣifr « zero", where fr. chiffre "number"; akin to the wordnumber) - any text conversion system with a secret (key) to ensure the secrecy of transmitted information. The cipher can be a set of conventional symbols (a conventional alphabet of numbers or letters) or an algorithm for converting ordinary numbers and letters. The process of encrypting a message using a cipher is calledencryption. The science of creating and using ciphers is calledcryptography. Cryptanalysis- the science of methods for obtaining the original meaning of encrypted information.

Types of ciphers

Ciphers can use one key for encryption and decryption, or two different keys. On this basis they distinguish:

  • symmetric uses one key for encryption and decryption.
  • uses one key for encryption and decryption.
  • Asymmetric cipheruses two different keys.

Ciphers can be designed to either encrypt all text at once or encrypt it as it is received. Therefore there are:

  • Block cipherencrypts an entire block of text at once, releasing the ciphertext after receiving all the information.
  • Stream cipherencrypts information and produces ciphertext as it arrives. Thus, being able to process text of unlimited size using a fixed amount of memory.

Chapter 2. Cryptography.

As soon as people learned to write, they immediately had a desire to make what was written understandable not to everyone, but only to a narrow circle. Even in the most ancient monuments of writing, scientists find signs of deliberate distortion of texts: changing characters, violating the order of writing, etc. Changing the text in order to make it understandable only to a select few gave rise to the science of cryptography (Greek “secret writing”). The process of converting text written in a common language into text that can only be understood by the recipient is called encryption, and the method of such conversion is called a cipher. But if there are those who want to hide the meaning of the text, then there will also be those who want to read it. Methods for reading such texts are studied by the science of cryptanalysis. Although the methods of cryptography and cryptanalysis themselves were not very closely related to mathematics until recently, at all times many famous mathematicians participated in deciphering important messages.And often it was they who achieved noticeable success, because mathematicians in their work constantly deal with diverse and complex tasks, AEach cipher is a serious logical problem. Gradually, the role of mathematical methods in cryptography began to increase, and last century they significantly changed this ancient science.

One of the mathematical methods of cryptanalysis is frequency analysis. Today, information security is one of the most technologically advanced and classified areas. modern science. Therefore, the topic “Mathematics and Ciphers” is modern and relevant. The term “cryptography” has gone far from its original meaning - “secret writing”, “secret writing”. Today, this discipline combines methods for protecting information interactions of a completely different nature, based on data transformation using secret algorithms, including algorithms that use secret parameters. Dutch cryptographer Mouritz Fries wrote about encryption theory: “In general, cryptographic transformations are purely mathematical in nature.”

A simple example of such mathematical transformations used for classification is the equality:

y = ax+b, where x - message letter,

y - the text cipher letter obtained as a result of the encryption operation,

a and b are constant quantities that determine this transformation.

Chapter 3. Encryption methods.

3.1. Replacement ciphers.

Since ancient times, the main task of encryption has been related to maintaining the secrecy of correspondence. A message that fell into the hands of a strangerto a person, it should have been incomprehensible to him, but an initiated person could easily decipher the message. There are a great many secret writing techniques. It is impossible to describe all known ciphers. The simplest of cryptographic ciphers are replacement or substitution ciphers, when some symbols of a message are replaced by other symbols, according to some rule. Substitution ciphers also include one of the first known codes in human history - Caesar code , used in ancient Rome. The essence of this code was that a letter of the alphabet was replaced by another by shifting the alphabet by the same number of positions.

3.2 Permutation ciphers.

The cipher called the “Cardano lattice” also belongs to the “permutation” class. This is a rectangular card with holes, most often square, which, when applied to a sheet of paper, leaves only some of its parts open. The number of rows and columns in a card is even. The card is made in such a way that when it is used sequentially (rotated), each cell of the sheet underlying it will be occupied. The card is first turned lengthwise vertical axis symmetry by 180°, and then along the horizontal axis also by 180°. And again repeat the same procedure: If the Cardan lattice is a square, then the second option for self-alignment of the figure is possible, namely, successive rotations around the center of the square by 90°.

Chapter 4. Diversity cipher

4.1. Cipher as described by Plutarch.

The need to encrypt messages arose a long time ago.In the V - VI centuries. BC e. The Greeks used a special encryption device. According to Plutarch's description, it consisted of two sticks of the same length and thickness. They kept one for themselves, and gave the other to the person leaving. These sticks were called skitals. If the rulers needed to communicate some important secret, they cut out a long and narrow strip of papyrus, like a belt, and wound it around their skitala, without leaving any gap on it, so that the entire surface of the stick was covered by the strip. Then, leaving the papyrus on the skeletal as it was, they wrote everything they needed on it, and after writing, they removed the strip and sent it to the addressee without a stick. Since the letters on it were scattered in disarray, he could read what was written only by taking his wanderer and winding this strip around it without missing a beat.

Aristotle came up with a method for deciphering this cipher. It is necessary to make a long cone and, starting from the base, wrap it with a tape with an encrypted message, moving it to the top. At some point, pieces of the message will begin to be viewed. This way you can determine the diameter of the hulk.

Ciphers and codes

When sending his report, letter, radiogram, an intelligence officer must always proceed from the fact that his message may end up in the hands of the enemy. Therefore, since ancient times, correspondence has used methods that would, in any case, keep what was written secret.

At first, the most primitive ciphers were used - that is, each letter of the alphabet was replaced by some number. This cipher works flawlessly in a short note. But the longer the message, the more vulnerable it becomes. The fact is that in any language there is a strict pattern: every letter is repeated in the text a certain amount once. If you have time and desire, then do the experiment. Take a page of any book and count all the letters used in it. It turns out that you will encounter the letter “O” (approximately) 182 times, “I” – 144, “A” – 138, “H” – 118, “E” – 112, “B” – 92 times, etc. This is only on one page, but cryptographers, or, as they are otherwise called, cryptographers, more accurately checked the combination of letters over hundreds and thousands of pages. Using this pattern, they began to easily read correspondence encrypted with numbers.

And an endless war began between those who encrypt the correspondence and those who decipher it. For encryption, more and more complex digital systems, books, special machines, and computers began to be used. The codebreakers, for their part, became more sophisticated in their methods. Thousands of specialists, doctors of science and even academicians work in both fields.

The code is the key to the cipher, as well as the convention with the help of which correspondence is conducted. The codes range from simple to very complex, requiring special machines to decipher.

A great intelligence victory occurs when it is possible to capture the enemy's code books, machines, codes, or recruit a cryptographer. You will read about some of these operations in the book.

From the book Security Encyclopedia author Gromov V I

3. CAR CODES OF THE REPUBLIC01 Adygea02 Bashkiria03 Buryatia04 Gorny Altai05 Dagestan06 Ingushetia07 Kabardino-Balkaria08 Kalmykia09 Karachay-Cherkessia10 Karelia11 Komi12 Maria El13 Mordovia14 Sakha (Yakutia)15 North Ossetia16 Tatarstan17 Tu va18 Udmurtia19 Khakassia20 Chechnya21

From the book Big Soviet Encyclopedia(KO) of the author TSB

From the book Great Soviet Encyclopedia (RA) by the author TSB

From the book Jewish Dietetics, or Deciphered Kosher author Lyukimson Petr Efimovich

Chapter 10. When the pig is cleansed, or the secret codes of kashrut Some commentators of Scripture, analyzing the books of the prophets, came to the conclusion that after the coming of the Messiah, significant changes will occur in the world and a whole series animals whose meat is currently prohibited in

From the book Fault Codes ( pocket guide) by Computers

Fault codes. Directory. 01 – ALFA ROMEO 1 – Bosch Motronic ML4.1 and 1.7; other models - self-diagnosis without codes 0000 End of code transmission 1000 End of code transmission 1211 Battery 1212 Throttle valve limit sensor (idle position) 1213 Throttle valve limit sensor (idle position)

From the book Japan and the Japanese. What guidebooks are silent about author Kovalchuk Yulia Stanislavovna

Double codes To understand Japanese, you should consider psychological characteristics socialization in Japanese, as well as their inherent techniques of social survival. For this, the Japanese gods came up with double codes of behavior, wanting to separate their charges from the rest

From the book 31 tips on how to live with an automatic transmission author Technique Author unknown --

28. What are codes? Why is the “OD OFF”, “Hold”, “S” or “Check AT” light blinking? Why are there no gear shifts? Here we will talk about automatic transmissions With electronic system management. The operation of “electronic” automatic transmissions is controlled by an on-board transmission computer,

From the book Linux and UNIX: shell programming. Developer's Guide. by Tainsley David

From the book The Real Man's Handbook author Kashkarov Andrey Petrovich

From the book I Explore the World. Forensics author Malashkina M. M.

From the book The Court of Russian Emperors. Encyclopedia of life and everyday life. In 2 volumes. Volume 2 author Zimin Igor Viktorovich

From the book ELASTIX - communicate freely author Yurov Vladislav

Codes and ciphers: from digital codes to electronic signatures It is sometimes difficult to distinguish between the work of criminologists and intelligence officers; both use ciphers to transmit secret information. They have common methods of encoding messages, however, intelligence officers are ahead of

From the author's book

Ciphers of the 21st century Is it true that modern ciphers are so complex that the encryption method cannot be kept secret? Yes, that's true. If you put several cryptographers from warring organizations in one cramped room, allow them to spy on each other and

From the author's book

Portrait ladies and maid of honor ciphers Court ladies had special signs differences: chamberlains, state ladies, ladies-in-waiting - portraits of empresses, decorated with diamonds, which were worn on right side breasts According to tradition, such ladies were called portrait ones. The sign

From the author's book

Other service codes

On this day of yours professional holiday notes the Cryptographic Service of Russia.

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

How did you hide words before?

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

they chose a slave. They shaved his head bald and painted the message on it with waterproof vegetable paint. When the hair grew back, it was sent to the recipient.

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

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

All secret writings have systems

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

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

D I am known loosely by my name;
R The rogue and the innocent swear by him,
U I am more than a technician in disasters,
AND Life is sweeter with me and in the best lot.
B I can serve the harmony of pure souls alone,
A between villains - I was not created.
Yuri Neledinsky-Meletsky
Sergei Yesenin, Anna Akhmatova, Valentin Zagoryansky often used acrostics.

2. Litorrhea- a type of encrypted writing used in ancient Russian handwritten literature. It can be simple and wise. A simple one is called gibberish writing, it consists of the following: placing the consonant letters in two rows in the order:

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

Wise litorrhea suggests more complex rules substitutions.

3. "ROT1"- a code 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 is replaced by B, B is replaced by C, and so on. "ROT1" literally means "rotate forward 1 letter in the alphabet." Phrase "I love borscht" will turn into a secret phrase “Ah myvmya”. This cipher is intended to be fun and easy to understand and decipher even if the key is used in reverse.

4. From rearranging terms...

During World War I, confidential messages were sent using so-called permutation fonts. In them, 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 rearrange each pair of letters so that the previous message becomes “am am y 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 sliding 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 E is used, then A becomes E, B becomes F, C becomes Z, and so on alphabetically. If the Y cipher is used, then A becomes Y, B becomes Z, B becomes A, and so on. This algorithm is the basis for many more complex ciphers, but does not by itself provide reliable protection message secrets, since checking 33 different encryption keys will take a relatively short time.

Nobody could. Try it

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

Kryptos. A sculpture created by artist Jim Sanborn that is located in front of the Central Intelligence Agency headquarters in Langley, Virginia. The sculpture contains four encryptions; the code of the fourth has not yet been cracked. In 2010, it was revealed that characters 64-69 NYPVTT in Part 4 meant the word BERLIN.

Now that you have read the article, you will probably 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

identify immutable parts. Looking ahead, we can cite as an example the Enigma encryption machine (see Chapter 9), which contained several wheels; there were wires inside these wheels; The wiring of the wires inside the wheels did not change, but the order of the wheels inside the car itself changed daily. Thus, the wiring of the wires was an unchangeable part, and the order of the wheels was a variable part. Hacking a system is the most time-consuming part of the job; it can last several weeks or even months and require the use of mathematical methods, the search for and use of operator errors, and even information obtained by spies.

Once all the immutable parts of the system have been determined, it is necessary to determine all the variable parts (such as the initial positions of the wheels in the Enigma cipher machine, which changed for each message). This is the task message key discovery. After solving it, the messages will be decrypted.

So, hacking refers to the encryption system as a whole, while opening the keys is associated with the decryption of individual messages.

Codes and ciphers

Although the words code and cipher are often used loosely, we will make a distinction between these concepts. In code, frequently occurring text elements (which may consist of one or more letters, numbers, or words) are usually replaced by four or five letters or numbers called code groups and are taken from the code book. For particularly frequently used expressions or characters, the codebook may offer several code groups. This is done so that the cryptographer can vary them in order to complicate their identification. So, for example, in four-digit digital code for the word “Monday” there can be three alternative code groups - for example, 1538, or 2951, or 7392. We will look at the codes in Chapter 6.

Codes are a special case encryption systems, but not all encryption systems are codes . We will use word cipher in relation to encryption methods that use non-codebooks and the ciphertext is derived from the original plaintext according to a specific rule. Nowadays, instead of the word "rule" they prefer to use the word "algorithm", especially if we're talking about O computer program. The distinction between the concepts of code and cipher is sometimes not entirely clear, especially for simple systems. Perhaps we can consider that the Julius Caesar cipher uses a one-page code book, where each letter of the alphabet is associated with a letter that is three positions further in the alphabet. However, for most of the systems we'll look at, this distinction will be quite clear. For example, "Enigma", which is often

mistakenly called the "Enigma code", it is certainly not a code at all, but

cipher machine.

Historically, until relatively recently, cryptography was dominated by two basic ideas, and many encryption systems (including almost all of those described in the first eleven chapters of this book) were based on one or both of them. The first idea was to shuffle the letters of the alphabet (as one would normally shuffle a deck of cards) to produce what could be considered a random order, permutation, or anagram of the letters. The second idea is to convert the letters of the message into numbers (for example, by putting A=0, B=1, ..., Z=25), and then add to them (number by number) other numbers called gamma, which , in turn, can be letters converted into numbers. If the result of addition is a number greater than 25, subtract 26 from it (this method is called modulo addition 26). The result is then converted back

V letters. If the numbers added to the text are obtained using a rather difficult to predict process, then the message encrypted in this way is very difficult, or even impossible, to decipher without knowledge of the gamma.

It is interesting to note that the Julius Caesar cipher, however simple it may be, can be considered an example of both types. In the first case, our "shuffle of the deck" is equivalent to simply moving the last three cards to the beginning of the deck, so that all the letters are moved down three positions, and X, Y and Z are at the beginning. In the second case, the scale is the number 3, repeated an infinite number of times. It is impossible to imagine anything “weaker” than such a range.

Translation of a message into another language, perhaps, could also be considered a certain type encryption using a code book (that is, a dictionary), but this is still too loose a use of the word code. However, this method of translating into another language, when they climb after every word

V A dictionary like a code book is definitely not to be recommended. This is known to anyone who has tried to learn a foreign language.*) On the other hand, sometimes it is quite reasonable to use a little-known language to convey messages whose relevance is limited in time. They say, for example, that during the Second World War, American troops in Pacific Ocean soldiers from the Navajo Indian tribe were sometimes used as telephone operators to transmit

*) I remember how a certain schoolboy wrote an essay in French about how in the Middle Ages a traveler arrived at a hotel at night and knocked on the door. In response he hears "What Ho! Without." (“What the hell! Get out!” - approx. transl.). The student translated this expression into French verbatim, substituting the French words: "Que Ho! Sans." (it turned out “What the hell! Without.” - approx. transl.). Teacher French, having read this, was speechless for a moment, and then noticed; “You probably found these words in the dictionary they give out free with bags of sugar.”

messages on your native language, quite reasonably assuming that even in the event of interception telephone conversations the enemy would hardly find in his ranks a person who speaks this language and is able to understand the content of the message.

Another way to hide the content of information is to use some kind of personal cursive. This method was used by authors back in the Middle Ages personal diaries- for example, Samuel Pepys. Such codes are not difficult to open if there are enough entries in the diary. Regular repetition of certain symbols (for example, signs indicating the days of the week) is a good help in reading certain words and expressions. An example of more thorough work would be the decipherment of the ancient Mycenaean writing system, known as Linear B, where the characters corresponded to the syllables of the ancient Greek language; the credit for deciphering this type of writing belongs to Michael Ventris*) (see).

Widespread computers and the ability to practically build complex electronic circuits on silicon chips revolutionized both cryptography and cryptanalysis. As a result, some modern systems encryptions are based on advanced mathematical concepts and require a solid computing and electronic base. Therefore, in the pre-computer era it was almost impossible to use them. Some of them are described in chapters 12 and 13.

Assessing the strength of an encryption system

When a new encryption system is proposed, it is very important to evaluate its resistance to all already known attack methods in conditions where the cryptanalyst knows the type of encryption system used, but not in all details. The strength of an encryption system can be assessed for three different situations:

(1) the cryptanalyst knows only ciphertexts;

(2) the cryptanalyst knows the cipher texts and the original plaintexts to them;

(3) the cryptanalyst knows both ciphertexts and plaintexts, which he himself selected.

The first case reflects a “typical” situation: if under these conditions the encryption system can be broken in short time, then you should not use it. The second situation arises, for example, if identical messages are encrypted both new system, and according to the old one, which

*) Linear B is one of the most ancient systems of Greek writing. Found on clay tablets in Knossos (Crete) and Pylos. Deciphered by Michael Ventris (1922-1956), English architect and linguist (approx. transl.).

A cryptanalyst can read. Such situations related to cases serious violation information protection rules occur quite often. The third situation arises mainly when a cryptographer, wanting to evaluate the strength of the system he has created, invites his colleagues, playing the role of an adversary, to break his cipher and allows them to dictate encryption texts to him. This is one of the standard procedures testing new systems. Very interesting task for a cryptanalyst - to compose texts in such a way that after encrypting them, obtain maximum information about the details of the system. The structure of these messages depends on how exactly the encryption is done. The second and third situations can also arise if the cryptanalyst has a spy in the cryptographer's organization: this is exactly what happened in the 30s of the last century, when Polish cryptanalysts received the plaintext and encrypted texts of messages encrypted on the German Enigma cipher machine. An encryption system that cannot be broken even in such a situation (3) is a truly strong cipher. This is exactly what the cryptographer strives for, and what the cryptanalyst fears.

Codes that detect and correct errors

Another class of codes is intended to provide error-free transmission information, and not to hide its content. Such codes are called detecting and correcting errors, they are the subject of large-scale mathematical research. These codes have been used since the earliest days of computers to protect against errors in memory and data recorded on magnetic tape. The earliest versions of these codes, such as Hamming codes, are able to detect and correct a single error in a six-bit character. A more recent example is the code that was used on spaceship"Mariner" for transmitting data from Mars. Designed to take into account the potential for significant signal distortion on its long journey to Earth, this code was capable of correcting up to seven errors in each 32-bit “word”. A simple example of another level of code, detecting, but does not correct errors, is the ISBN code (International Standard Book Number). It consists of ten characters (ten digits or nine digits with an X at the end, which indicates the number 10), and allows you to check for errors in the ISBN number. The check is performed as follows: calculate the amount

(first digit) 1+(second digit) 2+(third digit) 3+...+(tenth digit) 10.