You get a bonus - 1 coin for daily activity. Now you have 1 coin

Symmetric cryptosystems

Lecture



Symmetric cryptosystems (also symmetric encryption, symmetric ciphers) (англ. symmetric-key algorithm) — are a class of cryptographic systems in which the same key is used both for encrypting and for decrypting messages. This means that both parties, the sender and the recipient, share a common secret key. Before the invention of the asymmetric encryption scheme, symmetric encryption was the only method that existed. The algorithm's key must be kept secret by both parties, and measures must be taken to protect access to the channel along the entire path of the cryptogram, or by the interacting parties via crypto-objects and messages, if this communication channel is marked «Not for use by third parties». The encryption algorithm is chosen by the parties before the exchange of messages begins.

Basic information

Data encryption algorithms are widely used in computer technology in systems for concealing confidential and commercial information from malicious use by third parties. The main principle behind them is the condition that the transmitter and the receiver know the encryption algorithm in advance, as well as the key to the message, without which the information is merely a set of characters with no meaning.

Symmetric cryptosystems

Classic examples of such algorithms are the symmetric cryptographic algorithms listed below:

  • Simple transposition
  • Single columnar transposition with a key
  • Double transposition
  • «Magic square» transposition

Simple transposition

Simple transposition without a key is one of the simplest encryption methods. The message is written into a table by columns. After the plaintext has been written in columns, it is read off by rows to form the ciphertext. To use this cipher, the sender and receiver need to agree on a shared key in the form of the table's dimensions. Grouping the letters is not part of the cipher key and is used only for convenience in writing down meaningless text.

Single columnar transposition with a key

A more practical encryption method, called single columnar transposition with a key, is very similar to the previous one. It differs only in that the columns of the table are rearranged according to a keyword, phrase, or set of numbers whose length equals a row of the table.

Double transposition

For additional secrecy, a message that has already been encrypted can be encrypted again. This method is known as double transposition. To do this, the size of the second table is chosen so that the lengths of its rows and columns differ from the lengths in the first table. It is best if they are coprime. In addition, in the first table the columns can be rearranged, and in the second the rows. Finally, the table can be filled in a zigzag, a snake pattern, a spiral, or some other way. Such methods of filling the table, even if they do not strengthen the cipher's security, make the decryption process considerably more entertaining.

«Magic square» transposition

Magic squares are square tables whose cells are filled with consecutive natural numbers starting from 1, such that the sum is the same for every column, every row, and every diagonal. Such squares were widely used for entering the text to be encrypted according to the numbering inscribed in them. If the contents of the table were then written out row by row, the result was a cipher formed by letter transposition. At first glance it may seem that there are very few magic squares. Nevertheless, their number grows very quickly as the size of the square increases. For example, there is only one magic square of size 3 x 3, not counting its rotations. There are already 880 magic squares of size 4 x 4, and the number of magic squares of size 5 x 5 is around 250,000. Therefore, magic squares of larger sizes could serve as a good basis for a reliable encryption system of that era, because manually brute-forcing all key variants for this cipher was unthinkable.

In a square of size 4 by 4, the numbers from 1 to 16 were entered. Its magic consisted in the fact that the sum of the numbers along the rows, columns, and full diagonals was equal to the same number — 34. These squares first appeared in China, where they were attributed a certain «magical power».

16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1

Encryption using the magic square was carried out as follows. For example, suppose we need to encrypt the phrase: «ПриезжаюСегодня.» («I am arriving today.»). The letters of this phrase are entered sequentially into the square according to the numbers written in it: the position of the letter in the sentence corresponds to the ordinal number. A period is placed in the empty cells.

16. 3 и 2 р 13 д
5 з 10 е 11 г 8 ю
9 С 6 ж 7 а 12 о
4 е 15 я 14 н 1 П

After this, the encrypted text is written out in a line (reading is done from left to right, row by row):
.ирдзегюСжаоеянП

During decryption, the text is entered into the square, and the plaintext is read off in the sequence of numbers of the «magic square». The program must generate «magic squares» and select the required one based on the key. The size of the square is larger than 3x3.

Symmetric cryptosystems

Requirements

Complete loss of all statistical regularities of the original message is an important requirement for a symmetric cipher. For this, the cipher must have an «avalanche effect» — a strong change in the ciphertext block must occur with a 1-bit change in the input data (ideally, 1/2 of the bits of the ciphertext block should change).

Another important requirement is the absence of linearity (that is, the condition f(a) xor f(b) == f(a xor b)), since otherwise the application of differential cryptanalysis to the cipher is made easier.

General scheme

At present, symmetric ciphers are:

  • block ciphers. They process information in blocks of a fixed length (usually 64 or 128 bits), applying the key to the block in a set order, typically through several cycles of mixing and substitution called rounds. The result of repeating the rounds is the avalanche effect — a growing loss of correspondence between the bits of the plaintext and encrypted data blocks.
  • stream ciphers, in which encryption is performed on each bit or byte of the original (plaintext) using keystream generation (gamma masking). A stream cipher can easily be built on the basis of a block cipher (for example, GOST 28147-89 in keystream-generation mode), run in a special mode.

Most symmetric ciphers use a complex combination of a large number of substitutions and permutations. Many such ciphers are executed over several passes (sometimes up to 80), using a «round key» on each pass. The set of «round keys» for all passes is called the «key schedule». As a rule, it is generated from the key by performing certain operations on it, including permutations and substitutions.

A typical way of building symmetric encryption algorithms is the Feistel network. The algorithm builds the encryption scheme based on a function F(D, K), where D is a portion of data half the size of the encryption block, and K is the «round key» for the given pass. The function is not required to be invertible — its inverse function may be unknown. The advantages of the Feistel network are that decryption almost completely coincides with encryption (the only difference being the reverse order of the «round keys» in the schedule), which greatly simplifies hardware implementation.

The permutation operation shuffles the bits of the message according to some rule. In hardware implementations it is trivially realized as a rearrangement of wires. It is precisely the permutation operations that make it possible to achieve the «avalanche effect». The permutation operation is linear — f(a) xor f(b) == f(a xor b)

Substitution operations are performed as replacing the value of some part of the message (often 4, 6, or 8 bits) with a standard value hard-wired into the algorithm, by referring to a constant array. The substitution operation introduces nonlinearity into the algorithm.

Often the strength of the algorithm, especially against differential cryptanalysis, depends on the choice of values in the substitution tables (S-boxes). At the very least, it is considered undesirable to have fixed points S(x) = x, as well as the absence of influence of some bit of the input byte on some bit of the result — that is, cases where the result bit is the same for all pairs of input words differing only in that bit.

Algorithm parameters

There are many (at least two dozen) symmetric cipher algorithms, whose essential parameters are:

  • strength
  • key length
  • number of rounds
  • length of the processed block
  • complexity of hardware/software implementation
  • complexity of the transformation

Types of symmetric ciphers

block ciphers

  • AES (Advanced Encryption Standard) — the American encryption standard
  • GOST 28147-89 — the Soviet and Russian encryption standard, also a CIS standard
  • DES (Data Encryption Standard) — the data encryption standard in the USA
  • 3DES (Triple-DES)
  • RC2 (Rivest Cipher, or Ron’s Cipher)
  • RC5
  • Blowfish
  • Twofish
  • NUSH
  • IDEA (International Data Encryption Algorithm)
  • CAST (from the initials of its developers Carlisle Adams and Stafford Tavares)
  • CRAB
  • 3-WAY
  • Khufu and Khafre
  • Kuznechik

stream ciphers

  • RC4 (a variable-key-length encryption algorithm)
  • SEAL (Software Efficient Algorithm)
  • WAKE (World Auto Key Encryption algorithm)

Comparison with asymmetric cryptosystems

Advantages

  • speed
  • simplicity of implementation (due to simpler operations)
  • shorter required key length for comparable strength
  • maturity of study (due to greater age)

Disadvantages

  • complexity of key management in a large network
  • complexity of key exchange. To use it, one must solve the problem of reliably delivering the keys to each subscriber, since a secure channel is needed to transmit each key to both parties

To compensate for the drawbacks of symmetric encryption, a combined (hybrid) cryptographic scheme is now widely used, in which a session key is transmitted using asymmetric encryption, and this key is then used by the parties to exchange data via symmetric encryption.

An important drawback of symmetric ciphers is the impossibility of using them in mechanisms for generating digital signatures and certificates, since the key is known to each party.

See also

  • asymmetric cipher

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "information security - Cryptography and Cryptanalysis. Steganography. Information protection"

Terms: information security - Cryptography and Cryptanalysis. Steganography. Information protection