Means of cryptographic protection of state secrets are still equated to weapons. Very few countries in the world have their own cryptographic companies that make really good information security products. Even in many developed countries there is no such opportunity: there is no school there that would allow these technologies to be supported and developed. Russia is one of the few countries in the world - there may be five or so such countries - where all this is developed. Moreover, both in the commercial and public sectors there are companies and organizations that have maintained the continuity of the school of cryptography from the times when it was just in its infancy.

Encryption algorithms

Today, there are a lot of encryption algorithms that have significant resistance to cryptanalysis (cryptographic strength). Encryption algorithms are divided into three groups:

  • Symmetric algorithms
  • Asymmetric Algorithms
  • Hash Function Algorithms

Symmetric algorithms

Symmetric encryption involves using the same key for both encryption and decryption. Two main requirements apply to symmetric algorithms: complete loss of all statistical patterns in the encryption object and lack of linearity. It is customary to divide symmetric systems into block and flow ones.

In block systems, the source data is divided into blocks and then transformed using a key.

In streaming systems, a certain sequence (output gamma) is generated, which is subsequently superimposed on the message itself, and data encryption occurs in a stream as the gamma is generated. A communication diagram using a symmetric cryptosystem is shown in the figure.

Where where M is the plaintext, K is the secret key transmitted over a private channel, En(M) is the encryption operation, and Dk(M) is the decryption operation

Typically, symmetric encryption uses a complex and multi-stage combination of substitutions and permutations of the original data, and there can be many stages (passes), and each of them must correspond to a “pass key”

The substitution operation fulfills the first requirement of a symmetric cipher, getting rid of any statistics by shuffling the message bits according to a certain specified law. The permutation is necessary to fulfill the second requirement - to make the algorithm nonlinear. This is achieved by replacing a certain part of a message of a given size with a standard value by accessing the original array.

Symmetrical systems have both their advantages and disadvantages over asymmetrical ones.

The advantages of symmetric ciphers include high encryption speed, shorter required key length with similar strength, greater knowledge and ease of implementation. The disadvantages of symmetric algorithms are considered primarily the complexity of key exchange due to high probability violations of key secrecy during the exchange that is necessary, and the complexity of managing keys in a large network.

Examples of symmetric ciphers

  • GOST 28147-89 - domestic encryption standard
  • 3DES (Triple-DES, triple DES)
  • RC6 (Rivest Cipher)
  • Twofish
  • SEED - Korean encryption standard
  • Camellia – Japanese encryption standard
  • CAST (after the initials of the developers Carlisle Adams and Stafford Tavares)
  • XTEA is the easiest algorithm to implement
  • AES – American encryption standard
  • DES – data encryption standard in the USA up to AES

Asymmetric Algorithms

Asymmetric systems are also called public key cryptosystems. This is a method of data encryption in which the public key is transmitted over open channel(not hidden) and is used to verify electronic signatures and to encrypt data. To decrypt and create an electronic signature, a second key, a secret one, is used.

The very design of asymmetric cryptosystems uses the idea of ​​one-way functions ƒ(x), in which it is easy to find x, knowing the value of the function itself, but it is almost impossible to find ƒ(x) itself, knowing only the value of x. An example of such a function is the telephone directory of a large city, in which it is easy to find a person’s number if you know his last name and initials, but it is extremely difficult to find out the owner if you know the number.

Operating principle of asymmetric systems

Let's say there are two subscribers: A and B, and subscriber B wants to send an encrypted message to subscriber A. He encrypts the message using a public key and transmits it already encrypted over an open communication channel. Having received the message, subscriber A decrypts it using the secret key and reads it.

A clarification needs to be made here. When receiving a message, subscriber A must authenticate his identity to subscriber B so that an ill-wisher cannot impersonate subscriber A and replace his public key with his own.

Examples of asymmetrical fonts

  • RSA (Rivest-Shamir-Adleman, Rivest - Shamir - Adleman)
  • DSA (Digital Signature Algorithm)
  • Elgamal (El-Gamal Cipher System)
  • Diffie-Hellman (Diffie-Hellman Key Exchange)
  • ECC (Elliptic Curve Cryptography, elliptic curve cryptography)

Hash functions

Hashing (from the English hash) is the transformation of an initial information array of arbitrary length into a bit string of a fixed length.

There are many hash function algorithms, but they differ in their characteristics - cryptographic strength, bit depth, computational complexity, etc.

We are interested in cryptographically strong hash functions. These usually have two requirements:

  • For a given message C, it is almost impossible to find another message C with the same hash
  • It is almost impossible to find pairs of messages (SS") that have the same hash.

The requirements are called resistance to collisions of the first kind and second kind, respectively. For such functions, another requirement remains important: with a slight change in the argument, a significant change in the function itself must occur. Thus, the hash value should not provide information even about individual bits of the argument.

Examples of hash algorithms

  • Adler-32
  • SHA-1
  • SHA-2 (SHA-224, SHA-256, SHA-384, SHA-512)
  • HAVAL
  • N-Hash
    • RIPEMD-160
  • RIPEMD-256
  • RIPEMD-320
  • Skein
  • Snefru
  • Tiger (TTH)
  • Whirlpool
  • GOST R34.11-94 (GOST 34.311-95)
  • IP Internet Checksum (RFC 1071)

Cryptographic primitives

To give encrypted information greater cryptographic strength, relatively simple transformations - primitives - can be repeatedly used in a cryptographic system. Substitutions, permutations, cyclic shifts or gammas can be used as primitives.

Quantum cryptography

Cryptography in digital technologies

Story

Cryptography is an ancient science, and its original objects were text messages, which, with the help of certain algorithms, were rendered meaningless for anyone who did not have special knowledge of decrypting this message - the key.

Initially, methods were used that today are used only for puzzles, that is, in the opinion of a contemporary, the simplest. Such encryption methods include, for example, the replacement method, when each letter is replaced by another, spaced from it at a strictly defined distance in the alphabet. Or the permutation encryption method, when letters are swapped in a certain sequence within a word.

In ancient times, encryption was used mainly in military and commercial affairs, espionage, and among smugglers.

Somewhat later, historians determine the date of appearance of another related science - steganography. This science deals with masking the very fact of transmitting a message. It originated in antiquity, and an example here can be the receipt by the Spartan king Leonidas before the battle with the Persians of an engraved tablet with text, covered with a dry, easily washable solution. When cleaning, the marks left on the wax with the stylus became clearly visible. Today, sympathetic ink, microdots, microfilms, etc. are used to hide the message.

With the development of mathematics, mathematical encryption algorithms began to appear, but all these types of cryptographic information protection preserved statistical data to varying degrees and remained vulnerable. The vulnerability became especially noticeable with the invention frequency analysis, which was developed in the 9th century AD supposedly by the Arab encyclopedist al-Kindi. And only in the 15th century, after the invention of polyalphabetic fonts by Leon Battista Alberti (presumably), protection switched to qualitative new level. However, in the mid-17th century, Charles Babbage presented convincing evidence of the partial vulnerability of polyalphabetic fonts to frequency analysis.

The development of mechanics made it possible to create devices and mechanisms that facilitate encryption - devices such as the Trithemius square board and Thomas Jefferson's disk cipher appeared. But all these devices cannot be compared with those created in the 20th century. It was at this time that various encryption machines and mechanisms of high complexity began to appear, for example, rotary machines, the most famous of which is Enigma.

Before the rapid development of science in the 20th century, cryptographers had to deal only with linguistic objects, but in the 20th century the possibilities of using various mathematical methods and theories, statistics, combinatorics, number theory and abstract algebra opened up.

But the real breakthrough in cryptographic science came with the advent of the ability to represent any information in binary form, divided into bits using computers, which made it possible to create fonts with hitherto unprecedented cryptographic strength. Such encryption systems, of course, can be hacked, but the time spent on hacking is not worth it in the vast majority of cases.

Today we can talk about significant developments in quantum cryptography.

Literature

  • Barichev S.G., Goncharov V.V., Serov R.E. Fundamentals of modern cryptography. - M.: *Varfolomeev A. A., Zhukov A. E., Pudovkina M. A. Stream cryptosystems. Basic properties and methods of resistance analysis. M.: PAIMS, 2000.
  • Yashchenko V.V. Introduction to cryptography. St. Petersburg: Peter, 2001. .
  • GOST 28147-89. Information processing systems. Cryptographic protection. Cryptographic conversion algorithm. M.: USSR Civil Code according to standards, 1989.
  • GOST R 34.10-94. Information technology. Cryptographic information protection. *GOST R 34.11-94. Information technology. Cryptographic information protection. Hash function. M., 1995.
  • GOST R 34.10-2001 Information technology. Cryptographic information protection. Processes of generating and verifying electronic digital signatures. M., 2001.
  • Nechaev V.I. Elements of cryptography (Fundamentals of the theory of information security). M.: Higher School, 1999.
  • Zhelnikov V. Cryptography from papyrus to computer. M.: AVR, 1996.

Almost all cryptographic methods used involve breaking a message into a large number of parts (or characters) of a fixed size, each of which is encrypted separately, if not independently. This greatly simplifies the encryption task, since messages usually have different lengths.

There are three main encryption methods:: threading, block and using feedback.

The following four characteristic features of cryptographic methods are highlighted.

    Operations on individual bits or blocks.

    Dependence or non-dependence of the encryption function on the results of encryption of previous parts of the message.

3. Dependence or independence of the encryption of individual message characters on their position in the text. For example, in stream encryption, the different characters in a message are encrypted based on their position in the message. This property is called positional dependence or independence of the cipher.

4. Symmetry or asymmetry of the encryption function. This important property defines the essential difference between conventional symmetric (single-key) cryptosystems and asymmetric two-key (public key) cryptosystems. The main difference between the two is that in an asymmetric cryptosystem, knowledge of the encryption (or decryption) key is not sufficient to discover the corresponding decryption (or encryption) key.

Main characteristics of cryptosystems

cryptosystems

Operations with

bits or blocks

Dependence/independence on signs

messages

Positional dependence/independence

Symmetry/

asymmetry

In-line

encryption

does not depend

symmetrical

Block

encryption

does not depend

does not depend

symmetrical or asymmetrical

From the reverse

communication from

ciphertext

bits or blocks

does not depend

symmetrical

In a cryptosystem that has the property that the encryption function depends on the signs of the message, error propagation may occur. If, for example, a bit of the ciphertext is corrupted during transmission, then after decryption the plaintext may contain more corrupted bits. Insertion and dropout errors can also lead to catastrophic error propagation during decryption.

Stream ciphers. Stream encryption consists of adding plaintext bits modulo 2 with bits of a pseudo-random sequence.

To the benefits stream ciphers include no error propagation, simple implementation, and high speed encryption.

Disadvantage is the need to transmit synchronization information before the message header, which must be received before any message is decrypted. This is because if two different messages are encrypted with the same key, then the same pseudo-random sequence must be used to decrypt these messages. This situation can create a dangerous threat to the cryptographic strength of the system and therefore an additional, randomly selected message key is often used, which is transmitted at the beginning of the message and is used to modify the encryption key. As a result, different messages will be encrypted using different sequences.

Stream ciphers are widely used in military systems and other similar systems to encrypt data and digitized speech signals. Until recently, such applications were predominant for this method encryption. This is explained, in particular, by the relative simplicity of designing and implementing generators of good encryption sequences. But the main factor, of course, remains the absence of error propagation in the stream cipher.

Since relatively low-quality channels are used to transmit data and voice messages in tactical communication networks, any cryptographic system that increases the already high error rate is not applicable. In such cases, it is necessary to use a cryptosystem that does not propagate errors.

However, the proliferation of errors can also be a positive thing. Let, for example, encrypted data must be transmitted over a channel with a very low probability of error (for example, 10 5) and it is very important that the data is received absolutely accurately. This is a typical situation for computer networks, where an error in a single bit can lead to catastrophic consequences, and therefore the communication channel must be very reliable. In such a situation, one mistake is as dangerous as 100 or 1000 mistakes. But 100 or 1000 errors can be found more easily than one error. Therefore, in this case, error propagation is no longer a disadvantage of the cipher.

The standard method for generating sequences for stream encryption is the method used in the DES data encryption standard in output feedback mode.

Block ciphers. For block ciphers, the plaintext is first split into blocks of equal length, then a key-dependent encryption function is used to transform the plaintext block of length T bits into a ciphertext block of the same length. An important property of block ciphers is that each bit of a ciphertext block is a function of all (or almost all) of the bits of the corresponding plaintext block, and no two plaintext blocks can be represented by the same ciphertext block. The block cipher algorithm can be used in various ways. The four encryption modes in the DES standard actually apply to any block cipher.

These modes received the following names:

    direct encryption mode, or encryption using e-book ECB codes (Electronic code book),

    encryption with chaining of ciphertext blocks CBC (Cipher block chaining),

    encryption with feedback from CFB (Cipher feedback) ciphertext,

    encryption with feedback from the OFB output (Output feedback).

Main advantage direct block cipher (electronic code book) is that in a well-designed block cipher system, small changes in the ciphertext will cause large and unpredictable changes in the corresponding plaintext and vice versa.

However, the use of a block cipher in this mode is associated with serious shortcomings. The first of these is that, due to the fixed nature of encryption, even with a relatively large block length, for example 50-100 bits, “dictionary” cryptanalysis is possible in a limited form.

It is clear that a block of this size may be repeated in a message due to the large amount of redundancy in typical natural language text. This could result in identical plaintext blocks of length T bits in the message will be represented by identical ciphertext blocks, giving the cryptanalyst some information about the contents of the message.

Another potential disadvantage of this cipher is error propagation (this is one of the problems with all types of ciphers except stream ciphers). Changing just one bit in a received ciphertext block will result in the entire block being decrypted incorrectly. This in turn will result in 1 to T distorted bits in the restored source text.

Due to the noted disadvantages, block ciphers are rarely used in this mode to encrypt long messages. However, in financial institutions, where messages often consist of one or two blocks, block ciphers (specifically the DES algorithm) are widely used in this simple form. Since this application involves the possibility of frequent changes of the encryption key, the probability of encrypting two identical blocks of plaintext with the same key is very small. Block ciphers are most often used in encryption systems with feedback from the ciphertext.

Education is also possible mixed (hybrid) systems of stream and block encryption using the best properties of each of these ciphers. In such systems, stream encryption is combined with pseudo-random permutations. The plaintext is first encrypted as in normal stream encryption, then the resulting ciphertext is divided into blocks of a fixed size. In each block, a pseudo-random permutation is performed under the control of a key (different permutations for individual blocks are preferred).

The order of these two operations can be reversed without affecting the basic properties of the system. The result is a cipher that does not propagate errors, but has an additional property that a stream cipher does not have. This property means that the eavesdropper does not know which plaintext bit corresponds to the ciphertext bit. This makes the encrypted message more complex and difficult to crack. But it should be noted that this is no longer a true block cipher, in which each bit of the ciphertext is a function of only one, rather than all the bits of the plaintext.

A public key cryptosystem must be a block cipher system that operates on blocks of fairly large length. This is due to the fact that a cryptanalyst who knows the public encryption key could first calculate and create a table of correspondence between plaintext and ciphertext blocks. If the length of the blocks is small (for example, 30 bits), then the number of possible blocks will not be too large (with a length of 30 bits this is 2 30 -10 9) and a complete table can be compiled, allowing instant decryption of any encrypted message using a known public key .

Many different public key cryptosystems have been proposed, the most famous of which is RSA (Rivest, Shamir, Adleman). The cryptographic strength of this system is based on the difficulty of decomposing large numbers into prime factors and the choice of two large prime numbers for the encryption and decryption keys.

It is known that the RSA algorithm cannot be used for high-speed encryption. The most optimized software implementation of this algorithm turns out to be low-speed, and several hardware implementations provide encryption speeds from 10 to 100 Kbps (using prime numbers of the order of 2 7, which seems to be the minimum length to ensure the required cryptographic strength). This means that the use of RSA for block ciphering is limited, although its use for key distribution, authentication and digital signature generation presents interesting possibilities. Some currently known public key cryptographic algorithms allow faster encryption speeds than the RSA algorithm. However, they are not that popular yet.

Encryption systems with feedback. Closed-loop encryption systems come in various practical versions. As in block cipher systems, messages are divided into a number of blocks consisting of T bits, and to convert these blocks into ciphertext blocks, which also consist of T bit, special functions are used. However, while in a block cipher such a function depends only on the key, in closed-loop ciphers it depends on both the key and one or more previous ciphertext blocks. This general definition of closed-loop encryption includes as special cases a large number of different types of practically used systems.

The use of block cipher cryptosystems with feedback gives a number of important advantages. The first and most significant is the ability to use them to detect message manipulations carried out by active eavesdroppers. This takes advantage of the fact that errors propagate, as well as the ability of such systems to easily generate a MAC message authentication code (message aithentication code). The second advantage is that CTAK ciphers, used instead of block ciphers, do not require initial synchronization. This means that if the beginning of a message is skipped upon reception, then the rest of it can be successfully decrypted (after successful reception of successive t ciphertext bit. Note also that closed-loop encryption systems are used not only to encrypt messages, but also to authenticate them.

Block cipher cryptosystems with feedback are characterized by certain disadvantages. The main one is the propagation of errors, i.e. one erroneous bit during transmission can cause from 1 to sm + i errors in the decrypted text. Thus, the requirement to increase t to increase cryptographic strength, it contradicts system requirements associated with the propagation of errors. Another disadvantage is that the design and implementation of closed-loop encryption systems is often more difficult than for stream encryption systems. Although closed-loop encryption systems of various types have been widely used for many years, there are very few specific algorithms for such systems. In most cases, published algorithms are derived from block cipher algorithms modified for special applications.

The first conclusion that can be drawn from the analysis is that most practical cryptosystems use either stream encryption or feedback encryption algorithms. Most stream cipher cryptosystems use commercial algorithms (including proprietary algorithms or proprietary algorithms) or classified government algorithms. This situation will apparently continue in the coming years.

It is also possible that most closed-loop encryption systems will be based on the use of block cipher algorithms in special version, in particular, the most famous block cipher algorithm DES. Regarding other encryption methods, it can be said that, despite the rapid growth of publications on public key cryptosystems, only one of them, the RSA system, has stood the test of time.

But the system's algorithm has severe implementation limitations and is therefore unsuitable for some cryptographic applications. Of course, it can definitely be argued that public key cryptosystems have had a significant impact on data encryption technology. They are finding increasing use, mainly for generating digital signatures or for managing keys in conventional cryptosystems (such as key encryption).

Potential users of cryptography have the opportunity to choose between stream cipher systems and closed-loop cipher systems (possibly based on the use of block cipher algorithms). However, there are certain areas of application, such as financial transactions, where direct block encryption techniques ("electronic codebook") can be used. The choice of a cryptoalgorithm largely depends on its purpose. Some information that can guide you when choosing the type of encryption is given in the table.

Good day, dear user. In this article we will talk about topics such as: Encryption algorithms, Symmetric encryption algorithm basic concepts.

Most information security tools are based on the use of cryptographic ciphers and procedures encryption and decryption.

According to standard encryption GOST 28147-89 defines a cipher as a set of reversible transformations of a set of open data into a set of encrypted data, specified by a key and a cryptographic transformation algorithm.

A key is a specific secret state of some algorithm parameters cryptographic data conversion, ensuring the choice of only one option out of all possible for of this algorithm. IN symmetric cryptoalgorithms The same block of information (key) is used to encrypt and decrypt a message. Although the algorithm for influencing transmitted data may be known from to third parties, but it depends on a secret key that only the sender and recipient must have. Symmetric cryptographic algorithms transform a small block of data (1 bit or 32-128 bits) depending on the secret key in such a way that the original message can be read only if you know this secret key.

Symmetric encryption algorithm.

Symmetric cryptosystems allow, based on symmetric cryptoalgorithms encode and decode files of arbitrary length. Depending on the size of the information block symmetric cryptoalgorithms are divided into block ciphers and stream ciphers.

For block ciphers, the unit of encryption is a block of several bytes. The encryption result depends on all the original bytes in that block. Block encryption is used for packet transmission of information and file encoding. Block ciphers encrypt entire blocks of information (from 4 to 32 bytes) as a single whole - this significantly increases the resistance of transformations to brute-force attacks and allows the use of various mathematical and algorithmic transformations.

For stream ciphers, the encryption unit is one bit or one byte. The result usually depends on the encryption of the previous input stream. This encryption scheme is used in systems for transmitting information flows, that is, in cases where the transmission of information begins and ends at arbitrary points in time.

Feature symmetric block algorithms lies in the fact that in the course of their work they transform a block of input information of a fixed length and obtain a resulting block of the same size, but not readable by third parties who do not own the key. Thus, the operation scheme of a symmetric block cipher can be described by the functions:

Function

C = EK (M),
M = DK(C),
where M is the original (open) data block;
C – encrypted data block.

Key K is a parameter symmetric block cryptoalgorithm and represents a block binary information fixed size. The original M and encrypted C data blocks also have equal fixed bit depth (but not necessarily equal to the length of the key K).

The technique of creating chains of bytes encrypted with block algorithms allows them to encrypt information packets of unlimited length. The lack of statistical correlation between the bits of the block cipher output stream is used to calculate checksums data packets and password hashing. To date, quite a lot of strong block ciphers have been developed.

Crypto algorithm It is considered ideally secure if to read an encrypted block of data it is necessary to try all possible keys until the decrypted message turns out to be meaningful. In general, the strength of a block cipher depends only on the key length and increases exponentially with its growth.

Ideally strong cryptographic algorithms must satisfy another important requirement. If the original and encrypted values ​​of the block are known, the key used to perform this transformation can only be found out by completely enumerating its values.

Situations in which an outside observer knows part of the source text occur quite often. These can be standard inscriptions on electronic forms, fixed headers of file formats, long words or sequences of bytes often found in the text. Therefore, the above requirement is not excessive and is also strictly fulfilled by strong block ciphers.

According to Claude Shannon, to obtain strong block ciphers it is necessary to use two general principles: scattering and mixing.

Note

Diffusion represents the spread of the influence of one plaintext character over many ciphertext characters, which makes it possible to hide the statistical properties of the plaintext...

Note

Mixing involves the use of encryption transformations that complicate the restoration of the relationship between the statistical properties of plaintext and ciphertext. However, the cipher should not only make it difficult to crack, but also ensure ease of encryption and decryption if the secret key is known to the user...

A common way to achieve scattering and mixing effects is to use a compound cipher, that is, one that can be implemented as a sequence of simple ciphers, each of which contributes a significant amount of total scattering and mixing.

In compound ciphers, simple permutations and substitutions are most often used as simple ciphers. Permutation simply shuffles plaintext characters, with the specific type of shuffle determined by the secret key. In substitution, each plaintext character is replaced by another character from the same alphabet, and the specific type of substitution is also determined by the secret key. In a modern block cipher, the plaintext and ciphertext blocks are binary sequences typically 64 bits long. In principle, each block can take 2 to the 64th power of values. Therefore, substitutions are performed in a very large alphabet containing up to 2 to the power of 64 "characters".

By repeatedly alternating simple permutations and substitutions, controlled by a sufficiently long secret key, a very strong cipher with good scattering and mixing can be obtained.

All actions performed block cryptoalgorithm over data are based on the fact that the block being converted can be represented as a non-negative integer number from the range corresponding to its bit depth. For example, a 32-bit block of data can be interpreted as a number in the range 0 - 4294967295. In addition, a block whose bit depth is a "power of two" can be interpreted as a concatenation of several independent non-negative numbers from a smaller range (the 32-bit block above can be also represented as a concatenation of two independent 16-bit numbers from the range 0 – 65535 or as a concatenation of four independent 8-bit numbers from the range 0 – 255).

On these numbers, the block cryptoalgorithm performs the following actions according to a certain scheme:

1. Mathematical functions:
– addition X’ = X + V;
– “exclusive OR” X’ = X xor V;
– multiplication modulo 2N + 1 X’ = (X*V) mod (2N + 1);
– multiplication modulo 2N X’ = (X*V) mod 2N.
2. Bit shifts:
– arithmetic shift to the left X’ = X shl V;
– arithmetic shift to the right X’ = X shr V;
– cyclic shift to the left X’ = X rol V;
– cyclic shift to the right X’ = X ror V.
3. Table substitutions:
– S-box (English substitute) X’ = Table.

The V parameter for any of these transformations can be:

  • fixed number (for example, X' = X + 125).
  • the number obtained from the key (for example, X' = X + F(K)).
  • a number obtained from the independent part of the block (for example, X2’ = X2 + F(X1)).

Note

The latter option is used in a scheme called the Feistel network (named after its creator)…

Feistel Network.

The sequence of operations performed on the block, combinations of the above options V and the functions F themselves constitute distinctive features specific symmetric block cryptoalgorithm.

A characteristic feature of block algorithms is the repeated and indirect use of key material. This is determined primarily by the requirement that reverse decoding is impossible with respect to the key when the original and ciphertexts are known. To solve this problem, the above transformations most often use not the key value itself or its part, but some, sometimes irreversible, function of the key material. Moreover, in such transformations the same block or key element is used repeatedly. This allows, if the condition of invertibility of the function with respect to the value X is met, to make the function irreversible with respect to the key K.

A Feistel network is a scheme (method) of reversible text transformations in which the value calculated from one part of the text is superimposed on other parts. The Feistel network is a modification of the method of mixing the current part of the encrypted block with the result of some function calculated from another independent part of the same block. This technique fulfills the important requirement of reusing the key and the material of the original block of information. Often the network structure is designed in such a way that the same algorithm is used for encryption and decryption - the difference is only in the order in which the key material is used.

The American data encryption standard DES and our GOST 28147-89 are based on the Feistel network.

Basic modern encryption methods

Among the various encryption methods, the following main methods can be distinguished:

  • - Replacement or substitution algorithms - characters of the source text are replaced with characters of another (or the same) alphabet in accordance with a predetermined scheme, which will be the key of this cipher. Separately, this method is practically not used in modern cryptosystems due to its extremely low cryptographic strength.
  • - Rearrangement algorithms - characters of the original text are swapped according to a certain principle, which is the secret key. The permutation algorithm itself has low cryptographic strength, but is included as an element in many modern cryptosystems.
  • - Gamma algorithms - the characters of the source text are added to the characters of a certain random sequence.
  • - Algorithms based on complex mathematical transformations of the source text according to a certain formula. Many of them use unsolved math problems. For example, the algorithm widely used on the Internet RSA encryption based on the properties of prime numbers.
  • - Combined methods. Sequential encryption of the source text using two or more methods.

Let's take a closer look at algorithms built on complex mathematical transformations and combined methods, which are the most commonly used to protect data in modern information systems.

Algorithms based on complex mathematical transformations

RSA algorithm

The RSA algorithm (after the first letters of the last names of its creators Rivest - Shamir - Adleman) is based on the properties of prime numbers (and very large ones). Prime numbers are those numbers that have no divisors other than themselves and one. And coprime numbers are those numbers that have no common divisors other than 1.

First, you need to choose two very large primes (large primes are needed to construct large, strong keys. For example, the Unix program ssh-keygen generates 1024-bit keys by default). As a result of multiplying p and q, the parameter n is determined. Then select random number e, and it must be relatively prime with the number (n) = (p - 1)*(q - 1). A number d is found for which the relation is true

(e*d) mod (n) = 1.

Mod is the remainder of division, i.e. if e multiplied by d is divided by (n), then the remainder should be 1. In other words, the numbers (e*d - 1) and (n) should be divisible by an integer.

The public key is a pair of numbers e and n, and the private key is d and n. When encrypting, the source text is treated as a number series, and an operation is performed on each number that must be less than n

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

The result is the sequence C(i), which constitutes the cryptotext. Decoding of information occurs according to the formula

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

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

Let's look at an example using small numbers. Let p = 3, q ​​= 7. Then n = = p*q = 21. Let us choose e = 5. From the formula (d*5) mod 12 = 1 we calculate d = 17. Therefore, the public key is 17, 21, the secret key is 5, 21.

Let's encrypt the sequence "2345":

C 1 = 2 17 mod 21 = 11;

C 2 = 3 17 mod 21 = 12;

C 3 = 4 17 mod 21 = 16;

C 4 = 5 17 mod 21 = 17.

Cryptotext - 11 12 16 17. Let's check the decryption:

M 1 = 11 5 mod 21 = 2;

M 2 = 12 5 mod 21 = 3;

M 3 = 16 5 mod 21 = 4;

M 4 = 17 5 mod 21 = 5;

As you can see, the result coincided with the original plaintext.

The RSA cryptosystem is widely used on the Internet. When users connect to a secure server using the Secure Socket Layer (SSL) protocol, Secure Socket Layer is a protocol that guarantees the secure transmission of data over a network; combines a public key cryptographic system and block data encryption., installs a WebMoney certificate on your PC or connects to a remote server using Open SSH or SecureShell, most do not even suspect that all these programs use public key encryption using the ideas of the RSA algorithm.

Is this system really that reliable?

Since its inception, RSA has been subject to constant brute-force attacks. brute force") - an attack carried out by simply trying all possible or most frequently occurring keys (passwords). In the second case, brute force is often called a “dictionary attack.”). In 1978, the authors of the algorithm published an article where they presented a string encrypted using the method they had just invented. The first person to decipher the message was given a reward of $100, but this required dividing a 129-digit number into two factors. This was the first competition to crack RSA. The problem was solved only 17 years after the publication of the article.

RSA's cryptographic strength is based on the assumption that it is extremely difficult, if not impossible, to determine the private key from the 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 using analytical methods, and the RSA algorithm can only be cracked through brute force. Strictly speaking, the assertion that the factorization problem is difficult and that breaking the RSA system is difficult is also not proven.

The RSA company (http://www.rsa.ru) regularly holds competitions for cracking its own (and not only its own) ciphers. Previous competitions were won by the organization Distributed.net (http://www.distributed.net), which is an Internet community of volunteers.

Distributed.net members download a small client program to their PC, which connects to the central server and receives a piece of data for calculations. Then all data is uploaded to the central server, and the client receives the next block of initial information. And this happens until all combinations have been sorted out. Users, participants in the system, are united into teams, and the site maintains ratings of both teams and countries. For example, Distributed.net, a participant in the RC5-64 (RSA block cipher using a 64-bit key) cracking competition, managed to crack it after five years (1,757 days). During this time, 327,856 users participated in the project and more than 15,268 * 10 18 key options were sorted out. It turned out that the phrase “some things are better left unread” was encrypted (not without humor). General recommendations according to the RC5-64 cipher are as follows: the algorithm is strong enough for everyday needs, but it is not recommended to encrypt data with it that remains secret for more than five years.”

Probabilistic encryption

One type of public key cryptosystem is probabilistic encryption, developed by Shafi Golwasser and Silvio Minnelli. Its essence is to subordinate the encryption algorithm E to probabilistic models. What are the advantages of this approach? For example, in the RSA system, 0 and 1 are not “masked.” This problem is successfully solved by probabilistic algorithms, since they match the plaintext M not just with the cryptotext C, but with some element from the set of cryptotexts SM. Moreover, each element of this set is selected with a certain probability. In other words, for any plaintext M, the result of the algorithm E will be a random variable. It may seem that in this case it will be impossible to decrypt the information, but this is not at all the case. In order to make decryption possible, it is necessary that for different plaintexts M 1 and M 2, the sets CM 1 and CM 2 do not intersect. I would also like to say that probabilistic encryption algorithms are more reliable than deterministic ones. In this area, the most common are probabilistic encryption based on RSA functions and the El-Gamala cryptosystem.

Combined encryption methods

One of the most important requirements for an encryption system is its high cryptographic strength. However, increasing it for any encryption method leads, as a rule, to a significant complication of the encryption process itself and an increase in resource costs (time, hardware, reduction bandwidth etc.), and as a consequence - the operating time of cryptographic systems.

A fairly effective means of increasing encryption strength is the combined use of several in various ways encryption, i.e. sequential encryption of the original text using two or more methods.

As studies have shown, the strength of combined encryption is not lower than the product of the strengths of the methods used.

Strictly speaking, you can combine any encryption methods and in any quantity, but in practice the following combinations are most widespread:

substitution + gamma;

rearrangement + gamma;

gamming + gamming;

substitution + permutation;

A typical example of a combination cipher is the US National Data Encryption Standard (DES).

DES cryptographic standard

In 1973, the US National Bureau of Standards began developing a program to create a standard for computer data encryption. A competition was announced among development companies, which was won by IBM, which in 1974 presented an encryption algorithm known as DES (Data Encryption Standard).

In this algorithm, input 64-bit vectors, called plaintext blocks, are converted into output 64-bit vectors, called ciphertext blocks, using a binary 56-bit key K. The number of distinct keys of the DES algorithm is 2 56 .

The algorithm is implemented over 16 similar encryption cycles, where the i-th cycle uses the cyclic key Ki, which is an algorithmically generated sample of 48 of the 56 bits of the key Ki, i = 1,2,...,16.

The algorithm provides high robustness, but recent results have shown that modern technology allows you to create a computing device worth about 1 million US dollars, capable of opening a secret key using brute force in an average of 3.5 hours.

Because of small size key, it was decided to use the DES algorithm to close commercial information. The practical implementation of enumeration of all keys under these conditions is not economically feasible, since the costs of enumeration do not correspond to the value of the information hidden by the cipher.

The DES algorithm was the first example of widespread production and implementation technical means in the field of information security. The US National Bureau of Standards tests hardware implementations of the DES algorithm proposed by development companies on a special testing bench. Only after positive results After verification, the manufacturer receives a certificate from the National Bureau of Standards for the right to sell their product. To date, several dozen products made on various element bases have been certified.

High encryption speed has been achieved. It is 45 Mbit/s in the best products. Some hardware products cost less than $100.

The main areas of application of the DES algorithm:

storing data on computers (encrypting files, passwords);

message authentication (having a message and a control group, it is easy to verify the authenticity of the message;

electronic payment system (for transactions with a wide clientele and between banks);

Electronic exchange of commercial information (data exchange between buyers, seller and banker is protected from changes and interception.

Later, a modification of DES appeared - Triple DES (“triple DES” - since it encrypts information three times with the “regular” DES algorithm), free from the main drawback of the previous version - a short key; it is twice as long here. But, as it turned out, Triple DES inherited other weak sides its predecessor: lack of parallel computing capabilities during encryption and low speed.

GOST 28147-89

In 1989, the USSR developed a block cipher for use as a government data encryption standard. The development was accepted and registered as GOST 28147-89. The algorithm was introduced in 1990. And although the scope of application of this encryption algorithm is still being clarified, the beginning of its implementation, in particular in the banking system, has already been made. The algorithm is somewhat slow, but has very high cryptographic strength.

In general terms, GOST 28147-89 is similar to DES. The block diagram of the GOST algorithm differs from the block diagram of the DES algorithm only in the absence of an initial permutation and the number of encryption cycles (32 in GOST versus 16 in the DES algorithm).

The GOST algorithm key is an array consisting of 32-dimensional vectors X 1, X 2,…X 8. The cyclic key of the i-th cycle K i is equal to Xs, where the series of values ​​i from 1 to 32 corresponds to the following series of values ​​s:

1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,8,7,6,5,4,3,2,1.

The GOST cipher uses a 256-bit key and the volume of the key space is 2,256. None of the general-purpose computer systems currently existing or expected to be implemented in the near future can be used to select a key in less than many hundreds of years. Russian standard was designed with a large margin, its durability is many orders of magnitude superior to the American DES standard with its actual key size of 56 bits and a key space volume of only 2 56 , which is clearly not enough. The GOST cryptographic algorithm key is 32 bytes (256 bits) long and four times larger than the DES key. The time required to sort through all the keys increases not by four times, but by 256 32-8 = 256 24, which translates into astronomical figures). In this regard, DES may be of research or scientific interest rather than practical interest.

Conclusions on the use of modern encryption algorithms

Currently, the three main encryption standards most commonly used are:

  • - DES;
  • - GOST 28147-89 - a domestic method, characterized by high cryptographic resistance;
  • - RSA is a system in which encryption and decryption are carried out using different keys.

The disadvantage of RSA is the rather low encryption speed, but it provides personal electronic signature, based on a secret key unique for each user. The characteristics of the most popular encryption methods are shown in Table 1.

Table 1 Characteristics of the most common encryption methods