encrypted language. How to decrypt the secret code. Date based encryption


Archaic encoders have sunk into oblivion, which cannot be said about encryption algorithms. The operations of shift, replacement, and permutation are still used in modern algorithms, but with a significant correction in security. Over the centuries since the first use of these ciphers, cryptographers have learned to estimate the amount of information, entropy and strength, but this was not always the case. Let's take a closer look at how the most popular ciphers in the history of cryptography work and what are their shortcomings.

In a modern society, where almost every person has an electronic device (or even more than one), where transactions with electronic currency are performed every minute, confidential emails are sent, electronic documents are signed, cryptography is needed like air. Needed by users to protect their privacy. Needed by programmers to ensure the security of designed systems. Needed by hackers to understand vulnerabilities in systems during an audit. Needed by admins to understand how and how best to protect corporate data. We could not ignore such an important topic and begin a series of articles devoted to an introduction to cryptography. For beginners - the easiest way to get acquainted with the crypt, for the pros - a good reason to systematize their knowledge. Six lessons, from easiest to hardest. Forward!

Terms

First, let's define some terminology:

  • Cryptography is the science of how to secure a message.
  • Cryptanalysis is the science of how to open an encrypted message without knowing the key.
  • Decryption is the process of obtaining plaintext by means of cryptanalysis.
  • Decryption is the process of obtaining the plaintext using the key and the decryption algorithm provided for that cipher.

In the world of cryptography, getting confused in these words is a terrible bad manners.

Why do I need knowledge about cryptography?

Suppose cryptography is very necessary, but let the guys with the mustaches of mathematics take care of it. Why do I need knowledge of cryptography?

If you are a regular user - then at least to ensure your privacy. Today, the means of total surveillance of millions of people are becoming available to large states and influential organizations. Therefore, cryptography is the most important tool that provides confidentiality, trust, integrity, authorization of messages and electronic payments. The ubiquity of cryptography will remain one of the few ways to protect the user from threats hanging over his confidential information. Knowing how this or that protocol or cipher works, what makes it good and where its weaknesses are, you will be able to consciously choose tools for working or just communicating on the Web.

If you are a programmer or an information security specialist, then here you can’t hide anywhere from cryptography. Any large project requires information security. It doesn’t matter what you are developing: a content service, a mailer, a messenger, a social network, or just an online store, there is critical data everywhere that needs to be protected from interception or database hijacking. Each transaction must be protected by cryptographic protocols. In this case, cryptography is the right tool. If you haven't encountered it yet, be sure - it's 100% just a matter of time.

In short, cryptography is used much more often than one might imagine. Therefore, it is time to remove the veil of secrecy from this science, get acquainted with the most interesting aspects and use its capabilities to your advantage.

Why study old ciphers?

On the Internet, cryptographic protocols are used in almost every request. But what was the situation when there was no Internet at all? Do not think that in those distant shaggy times there was no cryptography. The first encryption methods appeared about four thousand years ago. Of course, these were the most primitive and unstable ciphers, however, the population was then illiterate, so such methods could protect information from prying eyes.

People have always needed secret correspondence, so encryption has not stood still. With the disclosure of some ciphers, others were invented, more resistant. Paper ciphers were replaced by cipher machines, which had no equal among people. Even an experienced mathematician could not crack the cipher calculated on a rotary machine. With the advent of the first computers, the requirements for information security have increased many times over.

Why do we need to get acquainted with such ancient and unstable ciphers, if you can immediately read about DES and RSA - and voila, almost a specialist? The study of the first ciphers will help to better understand why this or that operation is needed in a modern encryption algorithm. For example, the permutation cipher, one of the first primitive algorithms, has not been forgotten, and permutation is one of the frequently encountered operations in modern encryption. Thus, in order to better understand where the legs of modern algorithms actually grow from, you need to look back several thousand years ago.

Historical ciphers and first ciphers

According to sources, the first methods of text encryption appeared along with the birth of writing. Secret writing methods were used by the ancient civilizations of India, Mesopotamia and Egypt. The writings of Ancient India mention ways of changing the text, which were used not only by rulers, but also by artisans who wanted to hide the secret of craftsmanship. The origin of cryptography is the use of special hieroglyphs in ancient Egyptian writing about four millennia ago.

The first cipher that originated in ancient civilizations and is relevant, in some way, to this day, can be considered a substitution cipher. A little later, a shift cipher was invented, which was used by Julius Caesar, which is why it was named after him.

In addition to ciphers, it is impossible not to mention the devices for encryption, which were developed by ancient mathematicians. For example, the wanderer is the first cipher developed in Sparta. It was a stick on which a strip of parchment was wound along its entire length. The text was applied along the axis of the stick, after which the parchment was removed, and an encrypted message was obtained. The key was the diameter of the stick. However, this encryption method was absolutely unstable - Aristotle became the author of the hack. He wound a strip of parchment around a cone-shaped stick until fragments of a readable text appeared.

Also a prime example from the world of ancient ciphers, the disk of Aeneas can become - a disk with holes according to the number of letters in the alphabet. The thread was pulled sequentially into those holes that corresponded to the letters of the message. The recipient pulled out the thread, wrote down the sequence of letters and read the secret message. However, this encoder had a significant drawback - anyone could get a thread and unravel the message.

Shift cipher

This is one of the earliest types of cipher. The encryption process is very simple. It consists in replacing each letter of the original message with another letter that is separated from the original one by a given number of positions in the alphabet. This number of positions is called a key. With a key of three, this method is called a Caesar cipher. The emperor used it for secret correspondence. In order to encrypt a message, you need to build a substitution table:

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
d e f g h i j k l m n o p q r s t u v w x y z a b c

As you can see, in the second row, the characters of the alphabet are shifted three positions "back". To encrypt a message, for each character in the source text, you need to take the corresponding character from the substitution table.

Cipher example

Original text: Hey Brut! How are you?
Ciphertext: Kl, Euxw! Krz duh brx?

Decryption

At the decryption stage, we have the ciphertext and the key equal to three. To get the original text, we look for a three-position shift to the beginning of the alphabet for each character. So, for the first character K, a shift of three will mean the character H. Then we decipher the text character by character until we get the original phrase Hi, Brut! How are you? .

Cryptanalysis

The easiest way to break such a cipher is by simply enumerating all possible key values ​​- there are only 25 of them. Everything is simple here, and there is no point in stopping.

Another option is to use text frequency analysis. For each language, there is statistical information about the frequency of use of each letter of the alphabet and the most common combinations of letters. For English, for example, the average frequencies of letters are as follows:

e 0,12702 s 0,06327 u 0,02758 p 0,01929 q 0,00095
t 0,09056 h 0,06094 m 0,02406 b 0,01492 z 0,00074
a 0,08167 r 0,05987 w 0,02360 v 0,00978
o 0,07507 d 0,04253 f 0,02228 k 0,00772
i 0,06966 l 0,04025 g 0,02015 j 0,00153
n 0,06749 c 0,02782 y 0,01974 x 0,00150

As for two-letter combinations (bigrams), the following trend can be noticed:

bigram Percentage bigram Percentage
th 3,15 he 2,51
an 1,72 in 1,69
er 1,54 re 1,48
es 1,45 on 1,45
ea 1,31 ti 1,28
at 1,24 st 1,21
en 1,20 nd 1,18

The idea is that in the ciphertext the most frequently encountered letter will not be the reference e, but something else. Accordingly, we need to find the most frequently encountered letter in our cipher. This will be the encrypted e. And then you need to calculate its shift from e in the substitution table. The resulting value is our key!

Substitution cipher

The main disadvantage of the shift cipher is that there are only 25 possible key values. Even Caesar began to suspect that his cipher was not the most best idea. Therefore, it was replaced by a replacement cipher. In order to use this algorithm, a table is created with the original alphabet and, directly below it, the same alphabet, but with rearranged letters (or any other character set):

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
b e x g w i q v l o u m p j r s t n k h f y z a d c

Cipher example

We act similarly to the previous cipher. For each character of the source text, we take the corresponding one from the substitution table:

Original text: Hey Brut! How are you?
Ciphertext: Vl, Enfh!Vrz bnw drf?

Decryption

When decrypting, we replace each character of the ciphertext with the corresponding character from the substitution table known to us: v => h, l => i, and so on. Then we get the original string Hi, Brut! How are you? .

Cryptanalysis

Cryptanalysis of this cipher is also performed by the method of frequency text analysis. Consider an example:

MRJGRJ LK HVW XBSLHBM RI QNWBH ENLHBLJ , LHK SRMLHLXBM , WXRJRPLX , BJG XRPPWNXLBM XWJHNW . LH LK RJW RI HVW MBNQWKH XLHLWK LJ HVW ZRNMG BJG HVW MBNQWKH XLHD LJ WFNRSW . LHK SRSFMBHLRJ LK BERFH 8 PLMMLRJ . MRJGRJ LK GLYLGWG LJHR KWYWNBM SBNHK : HVW XLHD , ZWKHPLJKHWN , HVW ZWKH WJG , BJG HVW WBKH WJG . HVW VWBNH RI MRJGRJ LK HVW XLHD , LHK ILJBJXLBM BJG EFKLJWKK XWJHNW . JFPWNRFK EBJUK , RIILXWK , BJG ILNPK BNW KLHFBHWG HVWNW , LJXMFGLJQ HVW EBJU RI WJQMBJG , HVW KHRXU WAXVBJQW , BJG HVW RMG EBLMWD . IWZ SWRSMW MLYW VWNW , EFH RYWN B PLMMLRJ SWRSMW XRPW HR HVW XLHD HR ZRNU . HVWNW BNW KRPW IBPRFK BJXLWJH EFLMGLJQK ZLHVLJ HVW XLHD . SWNVBSK HVW PRKH KHNLULJQ RI HVWP LK HVW KH . SBFM \ "K XBHVWGNBM, HVW QNWBHWKH RI WJQMLKV XVFNXVWK. LH ZBK EFLMH LJ HVW 17HV XWJHFND ED KLN XVNLKHRSVWN ZNWJ. HVW HRZWN RI MRJGRJ ZBK IRFJGWG ED OFMLFK XBWKBN BJG LJ 1066 NWEFLMH ED ZLMMLBP HVW XRJTFWNRN. LH ZBK FKWG BK B IRNHNWKK, B NRDBM SBMBXW , BJG B SNLKRJ .JRZ LH LK B PFKWFP .

Frequency analysis of the letters of this cipher shows the following (read line by line, the letters are sorted by frequency of use):

W -88 , H -74 , L -67 , J -55 , B -54 , K -52 ,

R -51 , N -41 , M -36 , V -35 , X -29 , G -27 ,

F -23 , P -16 , S -16 , I -15 , Z -13 , E -13 ,

D -11 , Q -10 , U -5 , Y -4 , T -1 , O -1 ,

A-1

It is likely that W => e, since this is the most frequent letter in the cipher (see the table of average letter frequencies for English in the previous cipher).

Next, we try to find the shortest word, which includes the letter W => e already known to us. We see that the combination HVW is most often found in the cipher. It is easy to guess that, most likely, this is the trigram the, that is, we have already identified three characters in the text. If you look at the intermediate result, there is no doubt:

MRJGRJ LK the XBSLtBM RI QNeBt ENLtBLJ , LtK SRMLtLXBM , eXRJRPLX , BJG XRPPeNXLBM XeJtNe . Lt LK RJe RI the MBNQeKt XLtLeK LJ the ZRNMG BJG the MBNQeKt XLtD LJ eFNRSe . LtK SRSFMBtLRJ LK BERFt 8 PLMMLRJ . MRJGRJ LK GLYLGeG LJtR KeYeNBM SBNtK : the XLtD , ZeKtPLJKteN , the ZeKt eJG , BJG the eBKt eJG . the heBNt RI MRJGRJ LK the XLtD , LtK ILJBJXLBM BJG EFKLJeKK XeJtNe . JFPeNRFK EBJUK , RIILXeK , BJG ILNPK BNe KLtFBteG theNe , LJXMFGLJQ the EBJU RI eJQMBJG , the KtRXU eAXhBJQe , BJG the RMG EBLMeD . IeZ SeRSMe MLYe heNe , EFt RYeN B PLMMLRJ SeRSMe XRPe tR the XLtD tR ZRNU . theNe BNe KRPe IBPRFK BJXLeJt EFLMGLJQK ZLthLJ the XLtD . SeNhBSK the PRKt KtNLULJQ RI theP LK the Kt . SBFM \ "K XBtheGNBM, the QNeBteKt RI eJQMLKh XhFNXheK. Lt ZBK EFLMt LJ the 17th XeJtFND ED KLN XhNLKtRSheN ZNeJ. The tRZeN RI MRJGRJ ZBK IRFJGeG ED OFMLFK XBeKBN BJG LJ 1066 NeEFLMt ED ZLMMLBP the XRJTFeNRN. Lt ZBK FKeG BK B IRNtNeKK, B NRDBM SBMBXe , BJG B SNLKRJ .JRZ Lt LK B PFKeFP .

Great, three letters are already known. Again we are looking for the shortest words with new substitutions known to us. The combination it is often used, and since the letter t has already been deciphered (HVW => the), it is obvious that in our text L => i (LH => it). After that, we turn to the search for bigrams is and to, we set that K => s, R => o. Then we pay attention to the trigrams ~ing and and. Text analysis shows that BJG is most likely a ciphertext from and. After replacing all the most frequently occurring characters, we get the text:

Mondon is the XaSitaM oI QNeat ENitain , its SoMitiXaM , eXonoPiX , and XoPPeNXiaM XentNe . it is one oI the MaNQest Xities in the ZoNMd and the MaNQest XitD in eFNoSe . its SoSFMation is aEoFt 8 PiMMion . Mondon is diYided into seYeNaM SaNts : the XitD , ZestPinsteN , the Zest end , and the east end . the heaNt oI Mondon is the XitD , its IinanXiaM and EFsiness XentNe . nFPeNoFs EanUs , oIIiXes , and IiNPs aNe sitFated theNe , inXMFdinQ the EanU oI enQMand , the stoXU eAXhanQe , and the oMd EaiMeD . IeZ SeoSMe MiYe heNe , EFt oYeN a PiMMion SeoSMe XoPe to the XitD to ZoNU . theNe aNe soPe IaPoFs anXient EFiMdinQs Zithin the XitD . SeNhaSs the Post stNiUinQ oI theP is the st . SaFM \ "s XathedNaM , the QNeatest oI enQMish XhFNXhes . it Zas EFiMt in the 17th XentFND ED siN XhNistoSheN ZNen . the toZeN oI Mondon Zas IoFnded ED OFMiFs XaesaN and in 1066 NeEFiMt ED ZiMMiaP the XonTFeNoN . it is Zas Fsed NoDaM SaMaXe , and a SNison .noZ it is a PFseFP .

London is the capital of Great Britain , its political , economic , and commercial center . It is one of the largest cities in the world and the largest city in Europe . Itspopulationisabout8 million. Londonisdividedintoseveralparts: theCity, Westminster, theWestEnd, andtheEastEnd. TheheartofLondonistheCity, itsfinancialandbusinesscenter. Numerousbanks, offices, andfirmsaresituatedthere, includingthebankofEngland, theStockExchange, andtheoldBailey. Fewpeoplelivehere, butoveramillionpeoplecometotheCitytowork. TherearesomefamousancientbuildingswithintheCity. PerhapsthemoststrikingofthemistheSt. Paul"sCathedral, thegreatestofEnglishchurches. Itwasbuiltinthe17thcenturybySirChristopherWren. TheTowerofLondonwasestablishedbyJuliusCaesarandin1066 rebuiltbyWilliamtheConqueror. Itwasusedasafortress, aroyalpalace, andaprison. NowitisaMuseum.

As you can see, in this cryptanalysis, our main tool was the statistical analysis of frequencies. Move on!

Richard Sorge cipher

You can't talk about ciphers and not say a word about spies. In the recent past, when there were no computers yet, it was mainly intelligence officers who sought to hide information. The science of encryption could not stand still, because service to the Motherland was its most important and necessary purpose. By the way, it was the Soviet ciphers, developed by domestic specialists, that determined the vector of cryptography development for many decades to come.

Let's analyze the rather well-known cipher of Richard Sorge, a Soviet intelligence officer who was sent to Japan. This cipher is thought out to the smallest detail. Encryption is carried out on English language. Initially, you need to create the following table:

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

First, we write the word SUBWAY into it, which we have chosen. Then we write all the other letters of the alphabet in order. The slash means a new word (separator) and the dot means itself. Further, the most common letters of the English alphabet (A, S, I, N, T, O, E, R) are numbered in order of appearance in the table:

0) S U B W 5) A Y
C D 3) E F G H
1) I J K L M 7) N
2) O P Q 4) R 6) T V
X Y Z . /

We build the table itself horizontally, writing letters in rows, and number them vertically, in columns. This improves the mixing properties.

Further, the table is converted to the following form: first, the most frequently occurring letters are written in columns in a row in the order of numbering (S, I, E, ...). And then all the other letters are written, also in columns in rows (C, X, U, D, J, ...). Such a table will provide good mixing properties and at the same time will not “spoil” the frequency analysis of the ciphertext:

0 1 2 3 4 5 6 7 8 9
- S I O E R A T N - -
8 C X U D J P Z B K Q
9 . W F L / G M Y H V

The table is ready. Now you can encrypt the message.

Cipher example

Let's take the original text:

Mr. Xwillflytomorrow.

Let's put slashes to separate words:

Mr. / X/ will/ fly/ tomorrow.

Let's break the text into blocks of four characters (just for ease of presentation):

Mr. / X/ will/ fly/ tomorrow.

Now the text needs to be encrypted according to our table. The algorithm is this:

  1. For each source symbol, we look for the corresponding digit in the first column (for M, this will be 9).
  2. For each source symbol, we look for the corresponding digit in the first row (for M, this will be 6).
  3. We write the received characters one by one (96). If instead of a symbol in the first row/column there is a dash, do not write anything:96 4 ...
    M R…
  4. Let's move on to the next character. Etc.

As a result, we get the following ciphertext:

9649094 81 94 911 93939492 9397946 29624 429190

MR. / X/ WILL/ FLY/ TOMORROW.

After that, the ciphertext is re-partitioned into blocks of the same length of five characters. The remaining characters that fall on the last incomplete group of five characters can simply be discarded. If we have more than two characters left, then they need to be completed with zeros to a full group of five. If one or two can be discarded, they do not carry much information, and they are easily guessed at headquarters. In our case, there are no extra characters left.

After regrouping, we get the following ciphertext:

96490 94819 49119 39394 92939 79462 96244 29190

Next, you need to impose a certain gamma on the resulting ciphertext. Simply put, gamma is a sequence of numbers that is chosen to be added to the original ciphertext. For example, if we have a gamma of 1234 5678 9876 , and the original ciphertext looked like 12222 14444 1555 , then the final ciphertext after applying the gamma looks like their sum - 1234+12222, 14444+5678, 9876+1555 .

Where to get the gamma and how to quietly transfer it to the headquarters? Sorge chose the gamma from the German Statistical Yearbook. Such a publication should not have surprised the Japanese, since Sorge arrived in the country under the guise of a German journalist. Sorge indicated the page and column from which the sequence began, which was superimposed on the ciphertext in this message. For example, 201st page and 43rd column. He wrote this data with an additional number 20143 before the ciphertext, which, in turn, was already encrypted with gamma.

Of course, today it is worth choosing a more well-known source for gamma. Any common tabular data that does not arouse suspicion will do. But to get acquainted with the cipher, let's still use the authentic source :).

Suppose we have selected the 199th page and the fourth row, the fourth column. This is where the desired range begins:

324 36 380 230 6683 4358 50 2841

In this case, to apply the gamma, you need to do:

19946 { 96490 + 324 94819 + 36 49119 + 380 39394 + 230 92939 + 6683 79462 + 4358 96244 + 50 29190 + 2841 }

As a result, the resulting ciphertext will be:

19946 96814 94855 49499 39624 99622 83820 96294 32031

Decryption

In Moscow, this text was deciphered using a similar table. First of all, the first five-digit number was analyzed, and the specified gamma sequence was in the reference book:

{ 96814 - 324 94855 - 36 49499 - 380 39624 - 230 99622 - 6683 83820 - 4358 96294 Mr. Xwillflytomorrow

Cryptanalysis

Sorge's cipher was never cracked by enemy cryptanalysts. Many times the Japanese secret services intercepted the ciphertext, but it will remain in the form of columns of five-digit numbers that were filed into the files of uncaptured spies.

Vernam cipher

During the First World War, cryptologists actively used a one-time cipher-notebook, or Vernam cipher. It has been proven to be theoretically absolutely secure, but key must be the same length as the message being sent. Absolute security is the property that an encrypted message is not cryptanalyzable because it does not give an attacker any information about the plaintext.

The essence of the Vernam cipher is extremely simple. To do this, you need to remember the “exclusive or” operation or modulo 2 addition. So, for a plaintext message, the ciphertext will be equal to:

-- -- - +

G11011

During the First World War, binary codes for characters were set in the International Telegraph Alphabet No. 2 (International Telegraph Alphabet No. 2, ITA2).

In fact, despite its cryptographic strength, this cipher has more minuses than pluses:

  • the key must be a completely random sequence - you will probably have to stand and roll the die to generate one;
  • a secure channel is needed for transmission - it is doubtful that it was always at hand during the First World War;
  • if a third party can somehow find out the message, it will easily restore the keys and replace the message;
  • reliable destruction of the notebook page is required - burn it and eat the ashes, then the enemy will not know for sure what was encrypted.

Cipher example

Original text: HELLO
Key: AXHJB

We add bit by bit modulo 2 and look for which letter corresponds to the received code in the telegraph alphabet:

H⊕A = 10100⊕00011 = 10111 => Q
E⊕X = 00001⊕11101 = 11100 => M
L⊕H = 10010⊕10100 = 00110 => I
L⊕J = 10010⊕01011 = 11001 => B
O⊕B = 11000⊕11001 = 00001 => E

Ciphertext: QMIBE

Decryption

Decryption using a key is performed similarly to encryption:

ciphertext⊕key = plaintext

Cryptanalysis

With the correct use of the key, an attacker can only guess the characters. Even if he has an unlimited number of ciphertexts, but they are all encrypted with different keys from different characters, he will have an infinite number of plaintext options. At the same time, one can guess the meaning of the source text only by the number of characters.

Cryptanalysis of the Vernam cipher is easily possible if we choose a key with repeated characters during encryption. If an attacker manages to get hold of several texts with overlapping keys, he will be able to recover the original text.

Consider an attack that is feasible if we use the same key twice in encryption. It's called an insertion attack.

Suppose we managed to intercept the encrypted QMIVE message. We are trying to break the cipher and we convinced the sender to encrypt their message again, but put the first character in 1 (of course, the sender must be an immense sucker to fulfill such a condition, but suppose we can convince).

Then we get the ciphertext VDYBJY.

We know that the first character is 1. I calculate the first character of the private key key:

H⊕D = 10100⊕01001 = 11101 => X

We apply it to the first text and get:

M⊕X = 11100⊕11101 = 00001 => E

  • add the plaintext character with the ciphertext character => find out the key character;
  • add the key symbol with the corresponding ciphertext symbol => get the plaintext symbol

This sequence of operations is repeated until all the characters in the plaintext are known.

Encryption machines

Over time, manual encryption began to seem long and of little use. Cryptographers were constantly ciphering, and cryptanalysts at this time were desperately trying to break the cipher. It was necessary to speed up and automate the process and complicate the algorithm. The replacement cipher turned out to be the most suitable for modification. If the text encrypted by hand in this way could be recovered without much difficulty, then the machine could do this operation several times, and it became very difficult to recover the text.

So, the main mechanism of the encoder was a disk with contacts applied on both sides, corresponding to the alphabets of plain and cipher text. The contacts were connected to each other according to a certain rule called disk switching. This switching determined the replacement of letters at the initial position of the disk. When the position of the disk changed, the switching changed and the alphabet for encryption shifted.

Work example

Let the initial position of the disk define the substitution:

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
b e x g w i q v l o u m p j r s t n k h f y z a d c

After the first letter of the source text is replaced, the rotor rotates and the substitution shifts one character:

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
e x g w i q v l o u m p j r s t n k h f y z a d c b

The second letter will be encrypted according to the new alphabet. And after its replacement, the rotor shifts again, and so on according to the number of characters in the original encrypted message.

Enigma

The first rotary encryption machine was the Enigma, which was in service with Germany during World War II. She had three rotors interconnected. When the first rotor turns, the ring connected to it falls into the groove of the second disk and pushes it. Similarly, iterations of the third rotor are controlled by the second rotor. As a result, each time you press the machine key, the same letter is encoded with completely different values.

When encrypting, it was necessary to take into account the initial position of the rotors, their order and the positions of the rings. A plug-in panel is used for double letter replacement. The reflector performs a final substitution to control the correspondence between the encryption and decryption operations. Take a look at the construction of Enigma:

In the figure, the bold line highlights how the letter A is entered from the keyboard, encoded with a plug, passes through three rotors, is replaced on a reflector and exits as an encrypted letter D.

Enigma has long been considered invulnerable. The Germans daily changed the position of plugs, discs and their layout and position. During hostilities, they daily encoded a short sequence of letters, which was encrypted twice and transmitted at the very beginning of the message. The recipient decrypted the key and set the machine settings according to this key. It was this repeated use of the same key that allowed analysts at Bletchley Park (the UK's main cipher division) to crack the German cipher.

In fact, the Enigma mechanism is not stable, since the plugs and the reflector perform mutually exclusive operations. Using frequency analysis for a sufficiently large ciphertext, you can choose the position of the rotors by brute force. It is because of these vulnerabilities that Enigma remains only an exhibit in the Bletchley Park Museum.

sigaba

Ten years later, the US military developed the Sigaba rotary cipher machine, which significantly surpassed its progenitor in performance. "Sigaba" has three blocks of five rotors and a printing mechanism. Encryption on this machine was used by the US military and navy until the 1950s, until it was replaced by a newer modification of the KL-7. As you know, this rotary machine was never hacked.

Purple

Speaking of the famous cryptographic mechanisms, one cannot fail to mention the Japanese Purple cipher machine, as the Americans called it. Encryption in Purple was also based on the movement of four rotors, and the secret key was set once a day. The text was entered from the keyboard, with the help of rotors it was replaced with an encrypted one and printed out on paper. During decryption, the process of successive passage through the rotors was repeated in reverse order. Such a system is completely stable. However, in practice, errors in choosing keys led to the fact that Purple repeated the fate of the German Enigma. It was hacked by the American cryptanalysts department.

findings

The experience of the history of cryptography shows us the importance of choosing a secret key and the frequency of key changes. Mistakes in this arduous process make any encryption system less secure than it could be. Next time we'll talk about key distribution.

links:

This is the first lesson in the Diving into Crypto series. All lessons of the cycle in chronological order:

  • Cryptography lessons. Basic ciphers. part 1. Fundamentals, historical ciphers, how shift ciphers, replacement ciphers, Richard Sorge, Vernam cipher and cipher machines work (and are analyzed) (are you here)
  • . part 2. What it is, how keys are distributed, and how to choose a strong key
  • What is the Feistel network, what are the domestic block ciphers used in modern protocols - GOST 28147-89, Grasshopper
  • Lesson 4. What is it, how do they work and what is the difference between 3DES, AES, Blowfish, IDEA, Threefish by Bruce Schneider
  • Lesson 5. Types of EPs, how they work and how to use them
  • Lesson 6. What is it, where is it used and how does it help in the distribution of secret keys, random number generation and electronic signature

[Total Votes: 7 Average: 4.1/5]

Last updated by at June 28, 2016 .

Topic: "Cryptography. Ciphers, their types and properties"


Introduction

1. History of cryptography

2. Ciphers, their types and properties

Conclusion

Bibliography


Introduction

The fact that information is valuable, people realized a very long time ago - it is not for nothing that the correspondence of the powerful of this world has long been the object of close attention of their enemies and friends. It was then that the task of protecting this correspondence from overly prying eyes arose. The ancients tried to use a variety of methods to solve this problem, and one of them was cryptography - the ability to compose messages in such a way that its meaning was inaccessible to anyone except those initiated into the secret. There is evidence that the art of secret writing originated in pre-antique times. Throughout its centuries-old history, until very recently, this art has served a few, mostly the top of society, without going beyond the residences of heads of state, embassies and - of course - reconnaissance missions. And only a few decades ago everything changed radically - information acquired an independent commercial value and became a widespread, almost ordinary commodity. It is produced, stored, transported, sold and bought, which means it is stolen and forged - and, therefore, it must be protected. Modern society is all in more becomes information-driven, the success of any type of activity increasingly depends on the possession of certain information and on the lack of it from competitors. And the stronger this effect is manifested, the greater the potential losses from abuse in the information sphere, and the greater the need for information protection.

The widespread use of computer technology and the constant increase in the volume of information flows cause a constant increase in interest in cryptography. Recently, the role of software information protection tools that do not require large financial costs in comparison with hardware cryptosystems has increased. Modern encryption methods guarantee almost absolute data protection.

The purpose of this work is to get acquainted with cryptography; ciphers, their types and properties.

Get to know cryptography

Consider ciphers, their types and properties


1. History of cryptography

Before proceeding to the actual history of cryptography, it is necessary to comment on a number of definitions, since without it all of the following will be "slightly" difficult to understand:

Confidentiality is understood as the impossibility of obtaining information from the transformed array without knowing additional information (key).

The authenticity of information consists in the authenticity of authorship and integrity.

Cryptanalysis combines mathematical methods for violating the confidentiality and authenticity of information without knowing the keys.

Alphabet - a finite set of signs used to encode information.

Text is an ordered set of alphabetic elements. The following are examples of alphabets:

alphabet Z 33 - 32 letters of the Russian alphabet (excluding "ё") and a space;

alphabet Z 256 - characters included in the standard codes ASCII and KOI-8;

binary alphabet - Z 2 = (0, 1);

octal or hexadecimal alphabet

A cipher is a set of reversible transformations of a set of open data into a set of encrypted data specified by the cryptographic transformation algorithm. A cipher always has two elements: an algorithm and a key. The algorithm allows using a relatively short key to encrypt arbitrarily large text.

A cryptographic system, or cipher, is a family of T reversible transformations of plaintext into ciphertext. Members of this family can be assigned one-to-one with a number k, called a key. The transformation Tk is determined by the corresponding algorithm and the value of the key k.

Key - a specific secret state of some parameters of the cryptographic data transformation algorithm, which ensures the choice of one option from the totality of all possible ones for this algorithm. The secrecy of the key should ensure the impossibility of restoring the original text from the encrypted one.

The key space K is the set of possible key values.

Usually the key is a consecutive series of letters of the alphabet. It is necessary to distinguish between the concepts of "key" and "password". The password is also a secret sequence of letters of the alphabet, however, it is used not for encryption (as a key), but for authentication of subjects.

An electronic (digital) signature is a cryptographic transformation attached to the text, which allows, upon receipt of the text by another user, to verify the authorship and integrity of the message.

Data encryption is the process of converting open data into encrypted data using a cipher, and data decryption is the process of converting closed data into open data using a cipher.

Decryption is the process of converting private data into public data with an unknown key and possibly an unknown algorithm, i.e. cryptanalysis methods.

Encryption is the process of encrypting or decrypting data. The term encryption is also used as a synonym for encryption. However, it is incorrect to use the term "coding" as a synonym for encryption (and instead of "cipher" - "code"), since coding is usually understood as the representation of information in the form of characters (letters of the alphabet).

Cryptographic resistance is a characteristic of a cipher that determines its resistance to decryption. Typically, this characteristic is determined by the period of time required for decryption.

With the spread of writing in human society, there was a need for the exchange of letters and messages, which made it necessary to hide the contents of written messages from outsiders. Methods for hiding the content of written communications can be divided into three groups. The first group includes methods of masking or steganography, which conceal the very fact of the presence of a message; the second group consists of various methods of secret writing or cryptography (from the Greek words ktyptos - secret and grapho - I write); methods of the third group are focused on the creation of special technical devices, the classification of information.

In the history of cryptography, four stages can be conditionally distinguished: naive, formal, scientific, computer.

1. Naive cryptography (before the beginning of the 16th century) is characterized by the use of any, usually primitive, methods of confusing the enemy regarding the content of encrypted texts. At the initial stage, to protect information, coding and steganography methods were used, which are related, but not identical, to cryptography.

Most of the ciphers used were a permutation or monoalphabetic substitution. One of the first recorded examples is the Caesar cipher, which consists in replacing each letter of the source text with another one that is separated from it in the alphabet by a certain number of positions. Another cipher, the Polybian Square, attributed to the Greek writer Polybius, is a common monoalphabetic substitution that is performed using a square table randomly filled with the alphabet (for the Greek alphabet, the size is 5 × 5). Each letter of the source text is replaced by the letter below it in the square.

2. The stage of formal cryptography (late 15th - early 20th centuries) is associated with the appearance of formalized ciphers that are relatively resistant to manual cryptanalysis. In European countries, this happened during the Renaissance, when the development of science and trade caused a demand for reliable ways to protect information. An important role at this stage belongs to Leon Batista Alberti, an Italian architect who was one of the first to propose polyalphabetic substitution. This cipher, which received the name of the diplomat of the XVI century. Blaise Viginer, consisted in the sequential "addition" of the letters of the source text with the key (the procedure can be facilitated with the help of a special table). His Treatise on the Cipher is considered the first scientific work on cryptology. One of the first printed works, in which encryption algorithms known at that time were generalized and formulated, is the work "Polygraphy" by the German abbot Johann Trisemus. He owns two small but important discoveries: a way to fill the Polybian square (the first positions are filled with an easily remembered keyword, the rest with the remaining letters of the alphabet) and encryption of pairs of letters (bigrams). A simple but stable method of polyalphabetic substitution (bigram substitution) is the Playfair cipher, which was discovered at the beginning of the 19th century. Charles Wheatstone. Wheatstone also owns an important improvement - "double square" encryption. Playfair and Wheatstone ciphers were used until the First World War, as they were difficult to manually cryptanalyze. In the 19th century The Dutchman Kerckhoff formulated the main requirement for cryptographic systems, which remains relevant to this day: the secrecy of ciphers should be based on the secrecy of the key, but not the algorithm.

Finally, the last word in pre-scientific cryptography, which provided even higher cryptographic strength, and also made it possible to automate the encryption process, was rotary cryptosystems.

One of the first such systems was the mechanical machine invented in 1790 by Thomas Jefferson. Multi-alphabetic substitution with the help of a rotary machine is implemented by varying the relative position of rotating rotors, each of which performs a substitution "stitched" in it.

Rotary machines received practical distribution only at the beginning of the 20th century. One of the first practical machines was the German Enigma, developed in 1917 by Edward Hebern and improved by Arthur Kirch. Rotary machines were actively used during the Second World War. In addition to the German Enigma machine, Sigaba (USA), Turech (Great Britain), Red, Orange and Purple (Japan) devices were also used. Rotor systems are the pinnacle of formal cryptography, since they implemented very strong ciphers with relative ease. Successful crypto-attacks on rotor systems became possible only with the advent of computers in the early 1940s.

3. Home distinguishing feature scientific cryptography (1930 - 60s) - the emergence of cryptosystems with a strict mathematical justification for cryptographic stability. By the beginning of the 30s. finally formed sections of mathematics, which are the scientific basis of cryptology: probability theory and mathematical statistics, general algebra, number theory, began to actively develop the theory of algorithms, information theory, cybernetics. A kind of watershed was the work of Claude Shannon "Theory of Communication in Secret Systems", which summed up the scientific basis for cryptography and cryptanalysis. Since that time, they began to talk about cryptology (from the Greek kryptos - secret and logos - message) - the science of converting information to ensure its secrecy. The stage of development of cryptography and cryptanalysis before 1949 began to be called pre-scientific cryptology.

Shannon introduced the concepts of "scattering" and "mixing", substantiated the possibility of creating arbitrarily strong cryptosystems. In the 1960s Leading cryptographic schools approached the creation of block ciphers, even more secure than rotary cryptosystems, but allowing practical implementation only in the form of digital electronic devices.

4. Computer cryptography (since the 1970s) owes its appearance to computational tools with a performance sufficient to implement cryptosystems that, at high encryption speeds, provide several orders of magnitude higher cryptographic strength than "manual" and "mechanical" ciphers.

The first class of cryptosystems, practical use which became possible with the advent of powerful and compact computing tools, became block ciphers. In the 70s. The American DES encryption standard was developed. One of its authors, Horst Feistel, described a model of block ciphers, on the basis of which other, more secure symmetric cryptosystems were built, including the domestic encryption standard GOST 28147-89.

With the advent of DES, cryptanalysis was also enriched; several new types of cryptanalysis (linear, differential, etc.) were created to attack the American algorithm, the practical implementation of which, again, was only possible with the advent of powerful computing systems. In the mid 70s. The twentieth century saw a real breakthrough in modern cryptography - the emergence of asymmetric cryptosystems that did not require the transfer of a secret key between the parties. Here, the starting point is considered to be the work published by Whitfield Diffie and Martin Hellman in 1976 under the title "New Directions in Modern Cryptography". It was the first to formulate principles for the exchange of encrypted information without the exchange of a secret key. Ralph Merkley independently approached the idea of ​​asymmetric cryptosystems. A few years later, Ron Rivest, Adi Shamir, and Leonard Adleman discovered the RSA system, the first practical asymmetric cryptosystem whose security was based on the factorization problem for large primes. Asymmetric cryptography has opened up several new applications at once, in particular electronic digital signature (EDS) and electronic money systems.

In the 1980-90s. completely new areas of cryptography appeared: probabilistic encryption, quantum cryptography and others. Awareness of their practical value is yet to come. The task of improving symmetric cryptosystems also remains relevant. In the same period, non-Feistel ciphers (SAFER, RC6, etc.) were developed, and in 2000, after an open international competition, a new US national encryption standard, AES, was adopted.

Thus, we have learned the following:

Cryptology is the science of converting information to ensure its secrecy, consisting of two branches: cryptography and cryptanalysis.

Cryptanalysis is a science (and the practice of its application) about the methods and ways of breaking ciphers.

Cryptography is the science of how information is transformed (encrypted) in order to protect it from illegal users. Historically, the first task of cryptography was to protect transmitted text messages from unauthorized access to their content, known only to the sender and recipient, all encryption methods are only a development of this philosophical idea. With the complication of information interactions in human society, new tasks for their protection have arisen and continue to arise, some of them were solved within the framework of cryptography, which required the development of new approaches and methods.


2. Ciphers, their types and properties

In cryptography, cryptographic systems (or ciphers) are classified as follows:

symmetric cryptosystems

asymmetric cryptosystems

2.1 Symmetric cryptographic systems

Symmetric cryptographic systems are those cryptosystems in which the same secret key is used for encryption and decryption. The whole variety of symmetric cryptosystems is based on the following base classes:

I. Mono- and polyalphabetic substitutions.

Monoalphabetic substitutions are the simplest type of transformations, which consists in replacing the characters of the source text with others (of the same alphabet) according to a more or less complex rule. In the case of monoalphabetic substitutions, each character of the source text is converted into a ciphertext character according to the same law. With polyalphabetic substitution, the conversion law changes from character to character. One and the same cipher can be considered both mono- and polyalphabetic, depending on the alphabet being defined.

For example, the simplest type is a direct (simple) replacement, when the letters of the encrypted message are replaced by other letters of the same or some other alphabet. The replacement table might look like this:


The original characters of the ciphertext a b in G d e well h and to l m n about P R with t at f
Replacement characters s R x l r z i m a y e d w t b g v n j o

Using this table, we encrypt the word victory. We get the following: btpzrs

II. Permutations are also a simple method of cryptographic transformation, which consists in rearranging the characters of the source text according to a certain rule. Permutation ciphers are not currently used in their pure form, since their cryptographic strength is insufficient, but they are included as an element in many modern cryptosystems.

The simplest permutation is to write the original text in reverse and at the same time break the ciphergram into five letters. For example, from the phrase

LET IT BE AS WE WANTED

you get the following ciphertext:

ILETO KHYMKA KKATT EDUB TSUP

The last five are missing one letter. So, before encrypting the original expression, it should be supplemented with an insignificant letter (for example, O) to a multiple of five, then the ciphergram, despite such minor changes, will look different:

OILET OHYMK AKKAT TEDUB TSUP

III. Block ciphers are a family of reversible transformations of blocks (parts of a fixed length) of the source text. In fact, a block cipher is a substitution system on the alphabet of blocks. It can be mono- or polyalphabetic depending on the block cipher mode. In other words, with block encryption, information is divided into blocks of a fixed length and encrypted block by block. There are two main types of block ciphers: permutation ciphers (transposition, permutation, P-blocks) and substitution ciphers (substitution, substitution, S-blocks). Currently, block ciphers are the most common in practice.

The American data encryption standard DES (Data Encryption Standard), adopted in 1978, is a typical representative of the block cipher family and one of the most common cryptographic data encryption standards used in the United States. This cipher allows efficient hardware and software implementation, and it is possible to achieve encryption speeds of up to several megabytes per second. Initially, the method underlying this standard was developed by IBM for its own purposes. It was tested by the US National Security Agency, which found no statistical or mathematical flaws in it.

DES has blocks of 64 bits and is based on a 16-fold permutation of data; it also uses a 56-bit key for encryption. There are several DES modes: Electronic Code Book (ECB) and Cipher Block Chaining (CBC). 56 bits are 8 seven-bit characters, i.e. the password cannot be more than eight letters. If, in addition, only letters and numbers are used, then the number options will be significantly less than the maximum possible 2 56 . However, this algorithm, being the first experience of an encryption standard, has a number of disadvantages. In the time that has passed since the creation of DES, computer technology has developed so rapidly that it was possible to carry out an exhaustive search of the keys and thereby solve the cipher. In 1998, a machine was built that could recover the key in an average time of three days. Thus, DES, when used in a standard way, has already become a far from optimal choice for meeting data privacy requirements. Later, modifications of DESa began to appear, one of which is Triple Des ("triple DES" - since it encrypts information three times with ordinary DES). It is free from the main drawback of the previous version - a short key: here it is twice as long. But, as it turned out, Triple DES inherited others weak sides its predecessor: the lack of opportunities for parallel computing in encryption and low speed.

IV. Gamma is a transformation of the source text, in which the characters of the source text are added to the characters of a pseudo-random sequence (gamma) generated according to a certain rule. Any sequence of random characters can be used as a gamma. The procedure for applying gamma to the source text can be done in two ways. In the first method, the characters of the source text and gamma are replaced by digital equivalents, which are then added modulo k, where k is the number of characters in the alphabet. In the second method, the characters of the source text and gamma are represented as a binary code, then the corresponding digits are added modulo 2. Instead of modulo 2 addition, other logical operations can be used during gamma.

Thus, symmetric cryptographic systems are cryptosystems in which the same key is used for encryption and decryption. Enough effective tool Increasing the strength of encryption is the combined use of several different encryption methods. The main disadvantage of symmetric encryption is that the secret key must be known to both the sender and the recipient.

2.2 Asymmetric cryptographic systems

Another broad class of cryptographic systems are the so-called asymmetric or two-key systems. These systems are characterized by the fact that different keys are used for encryption and decryption, interconnected by some dependence. The use of such ciphers became possible thanks to K. Shannon, who proposed to build a cipher in such a way that its disclosure would be equivalent to solving a mathematical problem that requires performing computational volumes that exceed the capabilities of modern computers (for example, operations with large prime numbers and their products). One of the keys (for example, the encryption key) can be made public, in which case the problem of obtaining a shared secret key for communication is eliminated. If the decryption key is made public, then on the basis of the resulting system, it is possible to build an authentication system for transmitted messages. Since in most cases one key of a pair is made public, such systems are also called public key cryptosystems. The first key is not secret and can be published for use by all users of the system who encrypt the data. Data decryption with a known key is not possible. To decrypt the data, the recipient of the encrypted information uses the second key, which is secret. Of course, the decryption key cannot be determined from the encryption key.

The central concept in asymmetric cryptographic systems is the concept of a one-way function.

A one-way function is an effectively computable function for which there are no efficient algorithms for inverting (i.e., searching for at least one argument value from a given function value).

A trap function is a one-way function for which the inverse function is easy to calculate if there is some additional information, and difficult if such information is not available.

All ciphers of this class are based on so-called decoy functions. An example of such a function is the multiplication operation. Computing the product of two integers is very simple, but there are no effective algorithms for performing the inverse operation (expanding a number into integer factors). The reverse transformation is possible only if some additional information is known.

In cryptography, the so-called hash functions are very often used. Hash functions are one-way functions that are designed to control the integrity of data. When information is transmitted on the sender's side, it is hashed, the hash is transmitted to the recipient along with the message, and the recipient recalculates the hash of this information. If both hashes matched, then this means that the information was transmitted without distortion. The topic of hash functions is quite extensive and interesting. And its scope is much more than just cryptography.

Currently, the most developed method of cryptographic protection of information with a known key is RSA, named after the initial letters of the names of its inventors (Rivest, Shamir and Adleman) and is a cryptosystem, the strength of which is based on the complexity of solving the problem of decomposing a number into prime factors. Prime numbers are those numbers that have no divisors other than themselves and one. Coprime numbers are numbers that have no common divisors other than 1.

For example, let's choose two very large prime numbers (large initial numbers are needed to build large cryptographically strong keys). We define the parameter n as the result of multiplying p and q. We choose a large random number and call it d, and it must be coprime with the result of multiplication (p - 1) * (q - 1). Find a number e for which the relation is true:

(e*d) mod ((p - 1) * (q - 1)) = 1

(mod is the remainder of the division, i.e. if e multiplied by d is divided by ((p - 1) * (q - 1)), then the remainder will be 1).

The public key is the pair of numbers e and n, and the private key is d and n. When encrypting, the source text is considered as a number series, and we perform an operation on each of its numbers:

C (i) = (M (i) e) mod n

As a result, the sequence C (i) is obtained, which will make up the cryptotext.

M (i) = (C (i) d) mod n

As you can see, decryption requires knowledge of the secret key.

Let's try on small numbers. Set p=3, q=7. Then n=p*q=21. We choose d as 5. From the formula (e*5) mod 12=1 we calculate e=17. Public key 17, 21, secret - 5, 21.

Let's encrypt the sequence "2345":

C(2) = 2 17 mod 21 =11

C(3) = 3 17 mod 21= 12

C(4) = 4 17 mod 21= 16

C(5) = 5 17 mod 21= 17

Cryptotext - 11 12 16 17.

Let's check the decryption:

M(2) = 115 mod 21= 2

M(3) = 125 mod 21= 3

M (4) = 16 5 mod 21= 4

M(5) = 175 mod 21= 5

As you can see, the result is the same.

The RSA cryptosystem is widely used on the Internet. When a user connects to a secure server, public key encryption is used using the ideas of the RSA algorithm. The strength of RSA is based on the assumption that it is extremely difficult, if not impossible, to determine a private key from a public key. To do this, it was necessary to solve the problem of the existence of divisors of a huge integer. Until now, no one has solved it with analytical methods, and the RSA algorithm can be cracked only by exhaustive enumeration.

Thus, asymmetric cryptographic systems are systems in which different keys are used for encryption and decryption. One of the keys can even be made public. In this case, decryption of data using a known key is impossible.


Conclusion

Cryptography is the science of mathematical methods for ensuring confidentiality (the impossibility of reading information to outsiders) and authenticity (the integrity and authenticity of authorship, as well as the impossibility of refusing authorship) of information. Initially, cryptography studied methods of information encryption - the reversible transformation of an open (source) text based on a secret algorithm and a key into cipher text. Traditional cryptography forms a branch of symmetric cryptosystems in which encryption and decryption are carried out using the same secret key. In addition to this section, modern cryptography includes asymmetric cryptosystems, electronic digital signature (EDS) systems, hash functions, key management, obtaining hidden information, and quantum cryptography.

Cryptography is one of the most powerful means of ensuring confidentiality and controlling the integrity of information. In many ways, it occupies a central place among software and hardware safety controllers. For example, for portable computers, which are extremely difficult to physically protect, only cryptography can guarantee the confidentiality of information even in the event of theft.


Bibliography

1. Zlatopolsky D.M. The simplest methods of text encryption. /D.M. Zlatopolsky - Moscow: Chistye Prudy, 2007

2. Moldovyan A. Cryptography. /BUT. Moldovyan, N.A. Moldovyan, B.Ya. Soviets - St. Petersburg: Lan, 2001

3. Yakovlev A.V., Bezbogov A.A., Rodin V.V., Shamkin V.N. Cryptographic protection of information. / Tutorial- Tambov: Tambov Publishing House. state tech. university, 2006

4. http://ru. wikipedia.org

5. http://cryptoblog.ru

6. http://Stfw.ru

7. http://www.contrerror. tsure.ru


Moldovyan A. Cryptography./A. Moldovyan, N. A. Moldovyan, B. Ya. Sovetov - St. Petersburg: Lan, 2001

Action in the field of information technology. Thus, it is possible to consider the study of the elective course "Computer and Information Security» in the educational field «Informatics». The course is focused on preparing the younger generation for life and work in a completely new environment of the information society, in which the issues of providing ...

Please complain to pay anai iptography land sai ikihauwai! Whether you're writing notes to your friends in class or trying to figure out cryptography (the science of codes and ciphers) for fun, this article can help you learn some basic principles and create your own way to encode private messages. Read step 1 below to get an idea of ​​where to start!


Some people use the words "code" and "cipher" to refer to the same concepts, but those who seriously study this issue know that these are two completely different concepts. A secret code is a system in which each word or phrase in your message is replaced by another word, phrase, or series of characters. A cipher is a system in which each letter of your message is replaced by another letter or symbol.

Steps

Codes

Standard codes

    Create your message. Using a code book, write the message carefully and carefully. Note that pairing your code with a cipher will make your message even more secure!

    Translate your message. When your friends receive the message, they will need to use their copy of the code book to translate the message. Make sure they know that you are using a double protection method.

    Book of code

    1. Choose a book. When using a book of code, you will create a code that indicates the place of the desired words in the book. If you want to increase the chances that any of the words you need will be in the book of code, then use dictionaries or large travel guides. You want the number of words used in the book to be large and related to different topics.

      Translate the words of your message into numbers. Take the first word of your message and find it somewhere in the book. Then write down the page number, line number, and word number. Write them together to replace the word you want. Do this operation for each word. You can also use this technique to encrypt phrases if your code book can provide you with the desired phrase ready.

      • So, for example, a word on page 105, line five down, line 12 would become 105512, 1055.12, or something similar.
    2. Send a message. Give the encrypted message to your friend. Tom will need to use the same book to translate the message back.

    police coding

    Ciphers

    Date based encryption

      Choose a date. For example, it would be Steven Spielberg's birthday on December 16, 1946. Write this date using numbers and slashes (12/18/46), then remove the dashes to get the six-digit number 121846, which you can use to send an encrypted message.

      Assign a number to each letter. Imagine the message "I like Steven Spielberg's movies". Under the message, you write your six-digit number over and over until the very end of the sentence: 121 84612184 612184 6121846 121846121.

      Encrypt your message. Write the letters from left to right. Move each plain text letter by the number of units listed below it. The letter "M" is shifted by one unit and becomes "H", the letter "H" is shifted by two units and becomes "P". Please note that the letter "I" is shifted by 2 units, for this you need to jump to the beginning of the alphabet, and it becomes "B". Your final message will be “Npyo hfögbuschg ynyfya chukgmse tsyuekseb”.

      Translate your message. When someone wants to read your message, all they need to know is what date you used to encode. To recode, use the reverse process: write the numeric code, then return the letters in the opposite order.

      • Encoding with a date has the additional advantage that the date can be absolutely anything. You can also change the date at any time. This makes updating the cipher system much easier than with other methods. However, it is better to avoid such famous dates as May 9, 1945.

    Encryption with a number

    1. Choose a secret number with your friend. For example, the number 5.

      Write your message (no spaces) with this number of letters on each line (don't worry if the last line is shorter). For example, the message "My cover is blown" would look like this:

      • Moepr
      • caviar
      • ieras
      • covered
    2. To create a cipher, take the letters from top to bottom and write them down. The message will be "Myikokererrypyatrtao".

      To decipher your message, your friend must count the total number of letters, divide it by 5, and determine if there are incomplete lines. After that, he/she writes these letters in columns so that there are 5 letters in each row and one incomplete line (if any), and reads the message.

    Graphic cipher

    Rearrangement of Caesar

    Secret languages

    confused language

    Sound code

    gibberish

    • Hide your code in a place that only the sender and recipient know about. For example, unscrew any pen and put your code inside it, assemble the pen back, find a place (like a pencil holder) and tell the recipient the place and type of the pen.
    • Encrypt spaces as well to confuse the code even more. For example, you can use letters (E, T, A, O, and H work best) instead of spaces. They are called blanks. The s, b, b, and z will look too obvious for experienced codebreakers, so don't use them or other characters that stand out.
    • You can create your own code by rearranging the letters in the words randomly. "Dij yaemn in the park" - "Wait for me in the park."
    • Always send codes to agents on your side.
    • When using Turkish Irish, you don't need to specifically use "eb" before a consonant. You can use "ie", "br", "of" or any other inconspicuous combination of letters.
    • When using positional encoding, feel free to add, remove, and even rearrange letters from one place to another to make deciphering even more difficult. Make sure your partner understands what you are doing or it will all be meaningless to her/him. You can split the text into parts so that there are three, four or five letters in each, and then swap them.
    • For rearranging Caesar, you can rearrange the letters as many places as you want, forward or backward. Just make sure the permutation rules are the same for each letter.
    • Always destroy decrypted messages.
    • If you're using your own code, don't make it too complicated for others to figure it out. It may be too difficult to decipher even for you!
    • Use Morse code. This is one of the most famous codes, so your interlocutor will quickly understand what it is.

    Warnings

    • If you write the code inaccurately, this will make the decoding process more difficult for your partner, provided that you do not use variations of codes or ciphers designed specifically to confuse the decryptor (except your partner, of course).
    • Confused language is best used for short words. It's not as effective with long words because the extra letters are much more visible. The same is true when using it in speech.

From the very time that mankind has grown to written speech, codes and ciphers have been 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 studies codes and methods for breaking them, and this activity in modern realities can bring a lot of benefits. If you want to learn this, then 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 words with one letter. Most ciphers based on relatively simple substitutions are easiest to break with simple brute force substitution. Yes, you will have to tinker, but it will only get more difficult.

    • Words from one letter in Russian are pronouns and prepositions (I, 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 way to solve the cipher.
    • You must learn to read the cipher. Breaking it is not so important. Learn to snatch the patterns and rules that underlie the cipher, and then breaking it will not be fundamentally difficult for you.
  1. Look for the most commonly used symbols and letters. For example, in English these are “e”, “t” and “a”. When working with a cipher, use your knowledge of the language and sentence structure, on the basis of which you make hypotheses and assumptions. Yes, you will rarely be 100% sure, but solving ciphers is a game where you are required to make guesses and correct your own mistakes!

    • Look for double characters and short words first of all, 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 there are apostrophes in the text, then you are in luck! So, in the case of English, 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 cipher, at a certain moment you understand which of the above types it belongs to, then you have practically solved it. Of course, this will not happen so often, but the more ciphers you solve, the easier it will be for you later.

    • Digital substitution and key ciphers are the most common these days. When working on a cipher, the first thing to check is if it is of this type.

    Recognition of common ciphers

    1. substitution ciphers. Strictly speaking, substitution ciphers encode a message by replacing one letter with another, according to a predetermined algorithm. The algorithm is the key to unraveling the cipher, if you unravel 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. It's really simple code, sort of the basics. If you need to solve a cipher in the form of a long string of numbers, it is likely that square cipher methods will come in handy.

      Caesar's cipher. Caesar not only knew how to do three things at the same time, he also understood encryption. Caesar created a good, simple, understandable and, at the same time, resistant to cracking cipher, which was named after him. The Caesar Cipher is the first step towards learning complex codes and ciphers. The essence of the Caesar cipher is that all the 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, and so on.

      Watch out for keyboard templates. Based on the traditional QWERTY keyboard layout, various ciphers are currently 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, changing the columns one position up, "wikihow" becomes "28i8y92".
      • polyalphabetic ciphers. Simple substitution ciphers rely on the cipher to create a sort of alphabet for encryption. But already in the Middle Ages it became too unreliable, too easy to crack. Then cryptography took a step forward and became more complicated, starting to use characters from several alphabets for encryption at once. Needless to say, the reliability of encryption immediately increased.

    What does it mean to be a codebreaker

      Be patient. Breaking the cipher is patience, patience and more patience. Well, perseverance, of course. It is slow, painstaking work, with a lot of frustration due to frequent mistakes and the need to constantly select symbols, words, methods, etc. A good decryptor simply has to be patient.

      Write your own ciphers. Of course, cryptograms are one thing, and polyalphabetic ciphers without code words are completely different, but you still need to write your own ciphers. It is through this activity that you will be able to understand the mindset of those who encrypt messages in one way or another. It's like a "shield and sword" - the sharper the sword, the more reliable the shield. Many decryptors are themselves not the last people in terms of compiling ciphers. Learn more and more complex methods, learn to decipher them - and you will reach the heights of mastery.

      Solve known and still unsolved ciphers. The FBI, for example, regularly gives the cryptography community food for thought by publishing various ciphers and offering anyone who wants to solve them. Solve them, send your answers... you may change jobs soon.

      Enjoy the complexity of the work and the atmosphere of the mystery! Decryption is like diving deep into a Dan Brown novel, but for real! Complexity, mystery, anticipation of discovery - all this is the mysterious and exciting world of ciphers.

    • In English, the letter "e" is used most often.
    • If the cipher is printed, then there is a chance that it was printed in a special font - such as Windings. And it could be… a double cipher!
    • Don't give up if the cipher hasn't worked for a long time. This is fine.
    • The longer the cipher, the easier it is to crack.
    • One letter in the cipher does not necessarily correspond to one letter in the decrypted message. The reverse is also true.
    • A letter in a cipher almost never stands for itself (“a” is not “a”).

When the complex cipher is finally solved, it may contain the secrets of world leaders, secret societies and ancient civilizations. Before you - a dozen of the most mysterious ciphers in the history of mankind, which have not yet been solved.

Post sponsor: chandeliers and lamps

Notes by Ricky McCormick

In June 1999, 72 hours after one person was reported missing, a body was found in a Missouri cornfield. Strangely, the corpse decomposed more than it should have in such a time. At the time of his death, 41-year-old Ricky McCormick had two encrypted notes in his pockets. He was unemployed with incomplete schooling, living on welfare, and he didn't have a car. McCormick also served time in prison for the rape of a minor. He was last seen alive five days before his body was found, when he came for a routine checkup at Forest Park Hospital in St. Louis.

Neither the FBI's cryptanalysis unit nor the American Cryptoanalytic Association was able to decipher the notes and made them public 12 years after the assassination. Investigators believe the mysterious notes were written about three days before the murder. McCormick's relatives claim that the victim has been using this technique of coding messages since childhood, but, unfortunately, none of them knows the key to this cipher.

Cryptos

This is a sculpture by American artist Jim Sanborn, which is installed in front of the entrance to the headquarters of the CIA in Langley, Virginia. It contains four complex encrypted messages, three of which have been decrypted. Until now, 97 characters of the last part, known as K4, remain undeciphered.

In the 1990s, CIA deputy head Bill Studman tasked the NSA with deciphering the inscriptions. A dedicated team was formed that was able to decipher three of the four messages in 1992, but did not make them public until 2000. Also three parts were solved in the 1990s by CIA analyst David Stein, who used paper and pencil, and computer scientist Jim Gillogly, who used a computer.

The decoded messages are reminiscent of CIA correspondence, and the sculpture is shaped like paper coming out of a printer during printing.

Voynich manuscript

The Voynich manuscript, created in the 15th century, is one of the most famous mysteries of the Renaissance. The book bears the name of the antiquary Wilfried Voynich, who bought it in 1912. It contains 240 pages and some pages are missing. The manuscript is full of biological, astronomical, cosmological and pharmaceutical illustrations. There is even a mysterious folding astronomical table. In total, the manuscript contains more than 170 thousand characters that do not comply with any rules. There is no punctuation or breaks in the writing of cipher characters, which is not typical for handwritten cipher text. Who created this manuscript? Researcher? Herbalist? Alchemist? The book once allegedly belonged to the Holy Roman Emperor Rudolf II, who was fond of astrology and alchemy.

Leon Battista Alberti, an Italian writer, artist, architect, poet, priest, linguist and philosopher, could not choose any one occupation. Today he is known as the father of Western cryptography, and he lived during the same years that the manuscript was created. He created the first polyalphabetic cipher and the first mechanical cipher machine. Maybe the Voynich manuscript is one of the first experiments in cryptography? If the code for the Voynich manuscript is deciphered, it could change our knowledge of the history of science and astronomy.

Shagborough lettering

Shepherd's Monument is located in picturesque Staffordshire in England. It was erected in the 18th century and is a sculptural interpretation of Nicolas Poussin's painting The Arcadian Shepherds, but some details have been changed. Below the picture is a text of 10 letters: the sequence O U O S V A V V between the letters D and M. Above the picture there are two stone heads: a smiling bald man and a man with goat horns and pointed ears. According to one version, the man who paid for the monument, George Anson, wrote an abbreviation of the Latin saying "Optimae Uxoris Optimae Sororis Viduus Amantissimus Vovit Virtutibus", which means "To the best of wives, best of sisters, devoted widower dedicates this to your virtues."

Former CIA linguist Keith Massey linked these letters to John 14:6. Other researchers believe that the cipher is associated with Freemasonry. Former analyst Bletchley Park Oliver Lawn suggested that the code could be a reference to Jesus' family tree, which is unlikely. Richard Kemp, head of the Shugborough estate, initiated an advertising campaign in 2004 that linked the inscription to the location of the Holy Grail.

Linear A

Linear A is a variation of the Cretan script containing hundreds of characters and has not yet been deciphered. It was used by several ancient Greek civilizations between 1850 and 1400 BC. After the Achaean invasion of Crete, it was replaced by Linear B, which was deciphered in the 1950s and turned out to be one of the earliest forms of the Greek language. Linear A has never been deciphered, and the codes for Linear B are not suitable for it. The reading of most of the signs is known, but the language remains incomprehensible. Mostly its traces were found in Crete, but there were written monuments in this language in mainland Greece, Israel, Turkey, and even in Bulgaria.

Linear A, which is said to be the forerunner of the Cretan-Minoan script, is believed to be exactly what can be seen on the Phaistos Disc, one of the most famous archaeological mysteries. It is a baked clay disk approximately 16 cm in diameter, dating from the second millennium BC. and found in the Phaistos Palace in Crete. It is covered in symbols of unknown origin and meaning.

1000 years after Crete-Minoan, Eteocretan appeared, which is not classified and may be somehow related to Linear A. It is written in the Greek alphabet, but it is definitely not Greek.

Dorabella cipher

The English composer Edward Elgar was also very interested in cryptology. In memory of him, the first cipher machines of the early 20th century were named after his work Enigma Variations. Enigma machines were able to encrypt and decrypt messages. Elgar sent his girlfriend Dora Penny "a note to Dorabella" - that's what he called a girlfriend who was twenty years his junior. He was already happily married to another woman. Maybe he had an affair with Penny? She never deciphered the code he sent her, and no one else has ever been able to.

Bale cryptograms

The Virginia man who creates ciphers for the secrets of hidden treasures is Dan Brown's stuff, not the real world. In 1865, a pamphlet was published describing a huge treasure that would be worth over $60 million today. It has allegedly been buried in Bedford County for 50 years. Perhaps the person who did this, Thomas J. Bale, never existed. But the pamphlet indicated that Bale gave the box of three encrypted messages to the hotel owner, who did nothing with them for decades. Bale was never heard from again.

Bale's only account that has been deciphered states that the author left a huge amount of gold, silver, and jewels in a stone cellar six feet deep. It also says that another cipher describes the exact location of the cellar, so there should be no difficulty in finding it. Some skeptics believe that Bale's treasure is a duck that was successfully used to sell pamphlets at 50 cents, which would be $13 in today's money.

Zodiac Killer Mysteries

A notorious California serial killer known as the Zodiac taunted the San Francisco police with several ciphers, claiming that some of them would reveal the location of bombs planted throughout the city. He signed letters with a circle and a cross - a symbol denoting the Zodiac, the celestial belt of thirteen constellations.

The Zodiac also sent three letters to three different newspapers, each containing a third of the 408-character cipher. A schoolteacher from Salinas saw the symbols in the local newspaper and deciphered the cipher. The message said, "I like killing people because it's so much fun. It's more fun than killing wild animals in the forest because man is the most dangerous animal of all. Killing gives me the most thrill. It's even better than sex. The best is waiting for me to die. I will be born again in paradise, and all those I have killed will become my slaves. I won't tell you my name because you'll want to slow down or stop the recruitment of slaves for my afterlife."

The zodiac claimed responsibility for killing 37 people and was never found. He has imitators all over the world.

Taman Shud

In December 1948, a man's body was found on Somerton Beach in Australia. The identity of the deceased could not be established, and the case is shrouded in mystery to this day. The man may have been killed with a non-marking poison, but even the cause of death is unknown. The Somerton man was dressed in a white shirt, tie, brown knit pullover, and tan jacket. The clothes tags had been cut off and the wallet was missing. The teeth did not match any available dental records.

In the pocket of an unknown person, they found a piece of paper with the words "tamam shud", or "finished" in Persian. Later, when publishing material on this topic in one of the newspapers, a typo was made: instead of “Tamam”, the word “Taman” was printed, as a result of which the erroneous name entered the story. It was a fragment of a page from a rare edition of the Rubaiyat collection by the 12th-century Persian poet Omar Khayyam. The book was found and inside The cover was written with a local phone number and an encrypted message. In addition, a suitcase with belongings was found in the storage room of a nearby railway station, but this did not help to identify the victim. Was the Somerton man a deep-cover Cold War spy? Amateur cryptographer? Years pass, but the researchers have not come close to unraveling.

Blitz ciphers

This riddle is the newest of all listed, as it was only made public in 2011. Blitz ciphers are a few pages discovered during World War II. They lay for years in wooden boxes in one of the basements of London, which was opened as a result of German bombing. One soldier took these papers with him, and it turned out that they were full of strange drawings and encrypted words. The documents contain over 50 unique calligraphic-like characters. It is not possible to date the documents, however, according to the popular version, blitz ciphers are the work of occultists or Freemasons of the 18th century.

Editor's Choice
Bonnie Parker and Clyde Barrow were famous American robbers who operated during the...

4.3 / 5 ( 30 votes ) Of all the existing signs of the zodiac, the most mysterious is Cancer. If a guy is passionate, then he changes ...

A childhood memory - the song *White Roses* and the super-popular group *Tender May*, which blew up the post-Soviet stage and collected ...

No one wants to grow old and see ugly wrinkles on their face, indicating that age is inexorably increasing, ...
A Russian prison is not the most rosy place, where strict local rules and the provisions of the criminal code apply. But not...
Live a century, learn a century Live a century, learn a century - completely the phrase of the Roman philosopher and statesman Lucius Annaeus Seneca (4 BC - ...
I present to you the TOP 15 female bodybuilders Brooke Holladay, a blonde with blue eyes, was also involved in dancing and ...
A cat is a real member of the family, so it must have a name. How to choose nicknames from cartoons for cats, what names are the most ...
For most of us, childhood is still associated with the heroes of these cartoons ... Only here is the insidious censorship and the imagination of translators ...