How to set up smartphones and PCs. Informational portal
  • home
  • Programs
  • Classical permutation ciphers. Simplest private key encryption methods

Classical permutation ciphers. Simplest private key encryption methods

The transformations from this cipher consist in the fact that the original text is entered into the figure along the course of one "route", and then, along the other, it is written out from it. This cipher is called route permutation.

For example, you can enter the original message in a rectangular table by choosing the following route: horizontally, starting from the upper left corner, alternately from left to right and from right to left.

We will write the message along a different route: vertically, starting from the upper right corner and moving alternately from top to bottom and bottom to top.

When decrypting, it is necessary to determine the number of long columns, i.e. the number of letters in the last line of the rectangle. To do this, divide the number of buoys in the message by the length of the numeric key. The remainder of the division will be the desired number.

Cipher "Scytala" " .

One of the earliest encryption devices was a wand (Szitala), which was used during the war of Sparta against Athens in the 5th century BC. NS.

It was a cylinder on which a narrow papyrus tape was wound (without gaps and overlaps), and then the text necessary for transmission was written on this tape along its axis. The tape was unwound from the cylinder and sent to the addressee, who, having a cylinder of exactly the same diameter, wound the tape around it and read the message. It is clear that this encryption method permutes the letters of the message.

Cipher `` Scytala '' ‘implements no more n permutations ( n- message length).

Indeed, this cipher, as it is easy to see, is equivalent to the following routing permutation cipher: a message is written line by line into a table consisting of columns, after which letters are written out column by column. The number of involved table columns cannot exceed the message length.

There are also purely physical limitations imposed by the implementation of the Scitala cipher. It is natural to assume that the diameter of the wand should not exceed 10 centimeters. With a line height of 1 centimeter, no more than 32 letters (10p< 32). Таким образом, число перестановок, реализуемых ``Сциталой"", вряд ли превосходит 32.

Code "Swivel grille".

To use a cipher called a pivoting lattice, a stencil is made from a rectangular sheet of checkered paper in the size of cells.

Stencil cut 2 m x 2 k cells so that when applied to a blank sheet of paper of the same size in four possible ways, its cutouts completely cover the entire area of ​​the sheet.

The letters of the message are sequentially entered into the cutouts of the stencil (line by line, in each line from left to right) at each of its four possible positions in a predetermined order.

  1. Replacement ciphers. Mathematical model. Examples.

Stream Ciphers (Caesar)

Block Ciphers (Port and Pfeiffer)

The base is a rectangular table in which a systematically mixed alphabet is written.

Encryption rule:

Bigram letters ( i,j), i ¹ j are in this table. When encrypting a bigram ( i,j) is replaced by the bigram ( k,l), where they are defined with the rules:

  1. If i and j do not lie in one row or one column, then their positions form opposite vertices of the rectangle. Then k and l- another pair of vertices, and k–A vertex on the same line as i.
  2. If i and j lie in one line, then k and l- letters of the same line, located immediately to the right of i and j respectively. Moreover, if one of the letters is the last in a line, then it is considered that its "right neighbor" is the first letter of the same line.
  3. Similarly if i and j lie in the same column, then they are replaced by "bottom neighbors."

Example Playfair cipher.

Let the cipher use a 5x6 rectangle containing a systematically mixed Russian 30-letter alphabet based on the keyword "commander".

As a "dummy" we will use a rare letter f.

Let's represent the phrase as a sequence of bigrams:

AV TO RO MF ME TO YES YAV LYA ET SYA UI TS TO NF

Ciphertext:

VP ZD ZR OH DB ZD KN EE YOU TSh ShD Thyroid ZhT ZD OCH

Cryptanalysis of the Playfair cipher relies on the frequency analysis of bigrams, trigrams and four-grams of ciphertext and the peculiarities of replacing cipher values ​​with cipher designations associated with the location of the alphabet in a rectangle.

Essential information about substitutions is provided by the knowledge that a systematically shuffled alphabet is used.

  1. Permutation ciphers. Mathematical model. Examples.

A cipher, transformations from which only change the order of the characters in the original text, but do not change them themselves, is called a permutation cipher.


Example
Consider a message intended for encrypting a message of length n characters. It can be represented using a table

where i1- the number of the place of the ciphertext to which the first letter of the original message falls with the selected transformation, i2- place number for the second letter, etc.

The top line of the table contains the numbers from 1 to in order, and the bottom line contains the same numbers, but in no particular order. Such a table is called power substitution n... Knowing the substitution defining the transformation, it is possible to perform both encryption and decryption of the text.

Knowing the substitution defining the transformation, it is possible to perform both encryption and decryption of the text. For example, if the transformation uses the substitution

and in accordance with it the word MOSCOW is encrypted,

you get COSVMA.

Number of different transformations of a permutation cipher designed to encrypt messages of length n, less than or equal n!(this number also includes a conversion option that leaves all characters in their places!).

  1. Gamming codes. Mathematical model. Examples.

Gamma is a symmetric encryption method based on the "imposition" of a gamma sequence on a plain text. Usually this is a summation in some finite field.

The principle of encryption consists in the formation of a cipher gamut by a pseudo-random number generator (PRNG) and the imposition of this gamut on open data in a reversible way, for example, by adding modulo two. The process of decrypting data boils down to re-generating the cipher gamma and applying the gamma to the encrypted data. The encryption key in this case is the initial state of the pseudo-random number generator. With the same initial state, the PRNG will generate the same pseudo-random sequences.

  1. Principles of building block ciphers. Feistel's scheme.

Feistel network:

The Feistel network is a general method for transforming an arbitrary function F into a permutation on a set of blocks. It consists of cyclically repeating cells - rounds. Within each round, the plaintext block is split into two equal parts. Round function

takes one half (right in the figure), transforms it using a key K i and XORs the result with the other half. This key is set by the original key K and is different for each round. Then the halves are swapped (otherwise only one half of the block will be transformed) and served for the next round. The Feistel network transformation is a reversible operation.

For function F there are certain requirements:

Its work should lead to an avalanche effect

Must be non-linear with respect to the XOR operation

If the first requirement is not met, the network will be susceptible to differential attacks (similar messages will have similar ciphers). In the second case, the actions of the cipher are linear and for breaking it is enough to solve a system of linear equations.

This design has a tangible advantage: the encryption / decryption procedures are the same, only the keys derived from the original are used in the reverse order. This means that the same blocks can be used for both encryption and decryption, which certainly simplifies the implementation of the cipher. The disadvantage of this scheme is that only half of the block is processed in each round, which leads to the need to increase the number of rounds.

Swap encryption consists in the fact that the characters of the plain text are rearranged according to a certain rule within a certain block of this text. Consider a permutation designed to encrypt a message of length n characters. It can be represented with using the table

where i 1 the number of the place of the ciphertext to which the first letter of the plaintext falls in the selected transformation, i 2 - the number of the place for the second letter, etc. The top line of the table contains numbers from 1 to n, and at the bottom are the same numbers, but in no particular order. Such a table is called a degree permutation n.

Knowing the permutation defining the transformation, it is possible to carry out both encryption and decryption of the text. In this case, the permutation table itself serves as the encryption key.

Number of different transformations of a permutation cipher designed to encrypt messages of length n, less than or equal n! (n factorial). Note that this number also includes a conversion option that leaves all characters in their places.

With an increase in the number n meaning n! grows very quickly. For practical use, such a cipher is not convenient, since at large values n you have to work with long tables. Therefore, ciphers have become widespread that use not the permutation table itself, but a certain rule that generates this table. Let's consider a few examples of such ciphers.

Permutation cipher "wandering". It is known that in the 5th century BC, the rulers of Sparta, the most militant of the Greek states, had a well-developed system of secret military communications and encrypted their messages using wandering, the first simplest cryptographic device that implements the simple permutation method.

The encryption was performed as follows. A strip of parchment was wound on a cylindrical rod called skitala in a spiral (turn to turn) and several lines of message text were written on it along the rod (Fig. 1.2). Then a strip of parchment with the written text was removed from the rod. The letters on this strip turned out to be randomly located.

Rice. 1.2. "Skital" cipher

The same result can be obtained if the letters of the message are written in a circle not in a row, but after a certain number of positions until the entire text is exhausted. Message " GET STARTED"when placed along the circumference of the rod, three letters each gives the ciphertext:" NUTAPESA_TY".

To decrypt such a ciphertext, you need not only to know the encryption rule, but also to have a key in the form of a rod of a certain diameter. Knowing only the type of cipher, but not having the key, it was not easy to decipher the message.

Encryption tables. Since the beginning of the Renaissance (the end of the XIV century), cryptography also began to revive. In the permutation ciphers developed at that time, cipher tables were used, which, in essence, set the rules for the permutation of letters in a message.

The following are used as a key in encryption tables:

    table size;

    a word or phrase defining a permutation;

    features of the structure of the table.

One of the most primitive table permutation ciphers is a simple permutation, for which the size of the table is the key. This encryption method is similar to the wandering cipher. For example, the message " TERMINATOR ARRIVES SEVEN AT MIDNIGHT"is written into the table one by one column by column. The result of filling a table of 5 rows and 7 columns is shown in Fig. 1.3.

After filling the table with the text of the message by columns to form the ciphertext, read the contents of the table by rows. If the ciphertext is written in groups of five letters, you get the following encrypted message: " TNPVE GLEAR ADONR TIEEV OMOBT MPCHIR YSOOO".

Rice. 1.3. Populating an encryption table of 5 rows and 7 columns

Naturally, the sender and receiver of the message must agree in advance on a common key in the form of a table size. It should be noted that the combination of letters of the ciphertext into 5-letter groups is not included in the cipher key and is carried out for the convenience of writing nonsense text. When decrypting, the actions are performed in the reverse order.

The encryption method called single key permutation... This method differs from the previous one in that the table columns are rearranged by a keyword, phrase, or a set of numbers as long as a table row.

Let's use as a key, for example, the word " PELICAN", and take the message text from the previous example. Figure 1.4 shows two tables filled with the message text and a keyword, with the left table corresponding to filling before the swap, and the right table to filling after the swap.

Rice. 1.4. Cipher tables filled with keyword and message text

The key is written in the top line of the left table, and the numbers under the key letters are determined in accordance with the natural order of the corresponding key letters in the alphabet. If identical letters were found in the key, they would be numbered from left to right. In the table on the right, the columns are rearranged according to the ordered letter numbers of the key.

When reading the contents of the right table line by line and writing the ciphertext in groups of five letters, we get an encrypted message: " GNVEP LTOOA DRNEV TEIO RPOTM BCHMOR SOYYI".

For additional secrecy, you can re-encrypt a message that has already been encrypted. This encryption method is called double permutation. In the case of double permutation of columns and rows of the table, permutations are defined separately for columns and separately for rows. First, the text of the message is written to the table, and then the columns are alternately rearranged, and then the rows. When decrypting, the order of permutations must be reversed.

An example of performing encryption using the double permutation method is shown in Fig. 1.5. If you read the ciphertext from the right table line by line in blocks of four letters, you get the following: " TYUAE OOGM RLIP OSV".

Rice. 1.5. An example of performing encryption using the double permutation method

The key to the double permutation cipher is the sequence of column numbers and row numbers of the original table (in our example, the sequences are 4132 and 3142, respectively).

The number of double permutation options grows rapidly as the size of the table increases:

    36 options for a 3x3 table;

    for 4x4 table 576 options;

    for a 5x5 table there are 14,400 options.

Encryption using magic squares. In the Middle Ages, magic squares were also used for permutation encryption. ... Magic squares are called square tables with sequential natural numbers inscribed in their cells, starting from 1, which add up the same number for each column, each row and each diagonal.

The encrypted text was inscribed in magic squares in accordance with the numbering of their cells. If you then write out the contents of such a table line by line, you get a ciphertext formed by rearranging the letters of the original message.

An example of a magic square and filling it with a message " ARRIVING THE EIGHT"is shown in Fig. 1.6.

Rice. 1.6. An example of a 4x4 magic square and filling it with a message

The ciphertext, received when reading the contents of the right table line by line, looks quite mysterious: " ORM EOSYU VTAT LGOP".

The number of magic squares increases rapidly with the size of the square. There is only one 3x3 magic square (not counting its rotations). The number of 4x4 magic squares is already 880, and the number of 5x5 magic squares is about 250,000.

Magic squares of medium and large sizes could serve as a good basis for meeting the encryption needs of that time, since it is almost impossible to manually enumerate all the options for such a cipher.

A variety of route permutation - vertical permutation - has become widespread. This cipher also uses a rectangular table in which the message is written line by line from left to right. A cipher is written vertically, with the columns selected in the order specified by the key.

OPEN TEXT: Route Swap Example

KEY: (3, 1, 4, 2, 5)

CRYPTOGRAM: rmuptkmrnprrrysviateaieshoeo

It is impractical to fill in the last row of the table with "non-working" letters, since the cryptanalyst who received this cryptogram receives information about the length of the numeric key.

Vertical permutation code. It is a variation of the previous cipher. The features of the cipher include the following:

The number of columns in the table is fixed and determined by the length of the key;

The route of entry is strictly from left to right from top to bottom;

The cipher program is written out in columns according to their numbering (key).

Figure 5.5. Example of using the vertical permutation cipher

You can use a word or phrase as a key. Then the order of writing out the columns corresponds to the alphabetical order of the letters in the key. For example, if the keyword is "UNCLE", then the letter present in it A gets number 1, D- 2, etc. If a letter appears in a word several times, then its occurrences are numbered sequentially from left to right. In the example, the first letter D gets number 2, second D – 3.

When encrypting the message "ABRAMOV ILYA SERGEEVICH", the result will be "OYAE_AV_ERIEIALRCHMG_B_SV".

(see also )

The works of the American mathematician Claude Shannon, which appeared in the middle of the 20th century, greatly influenced the development of cryptography. In these works, the foundations of information theory were laid, and a mathematical apparatus was developed for research in many fields of science related to information. Moreover, it is generally accepted that information theory as a science was born in 1948 after the publication of K. Shannon's work "Mathematical theory of communication".

In his work "Theory of communication in secret systems" Claude Shannon summarized the experience accumulated before him in the development of ciphers. It turned out that even in very complex ciphers, such simple ciphers as replacement ciphers, permutation ciphers or combinations thereof.

As the primary criterion by which the classification of ciphers is carried out, the type of transformation carried out with the plain text during encryption is used. If fragments of plain text (individual letters or groups of letters) are replaced by some of their equivalents in the ciphertext, then the corresponding cipher belongs to the class replacement ciphers... If the letters of the plaintext during encryption only change places with each other, then we are dealing with permutation cipher... In order to improve the reliability of the encryption, the ciphertext obtained by using some cipher can be encrypted again using another cipher.


Rice. 6.1.

All kinds of such compositions of various ciphers lead to the third class of ciphers, which are usually called composition ciphers... Note that the composition cipher may not be included in either the replacement cipher class or the permutation cipher class (Fig. 6.1).

6.3 Permutation codes

The permutation cipher, as the name implies, converts the permutation of letters in plain text. A typical example of a permutation cipher is the "Scital" cipher. Typically, the plaintext is split into segments of equal length, and each segment is encrypted independently. For example, let the length of the segments be equal to and be a one-to-one mapping of the set into yourself. Then the permutation cipher works like this: a piece of plaintext is converted into a piece of ciphertext.

A classic example of such a cipher is a system using a card with holes - lattice, which, when applied to a sheet of paper, leaves only some of its parts open. When encrypted, the letters of the message fit into these holes. When decrypting the message, it fits into a diagram of the required dimensions, then a lattice is applied, after which only plain text letters are visible.

Other variants of the permutation cipher are also possible, for example, columnar and double permutation ciphers.

6.3.1 Column permutation cipher

During decryption, the letters of the ciphertext are written column by column in accordance with the sequence of key numbers, after which the original text is read line by line. For the convenience of memorizing the key, the table columns are rearranged by a keyword or phrase, all the symbols of which are assigned numbers determined by the order of the corresponding letters in the alphabet.

When solving tasks for cryptanalysis of permutation ciphers, it is necessary to restore the initial order of the letters of the text. For this, a character compatibility analysis is used, which can be helped by a collation table (see).

Table 6.1. Combination of letters of the Russian language
G WITH Left On right G WITH
3 97 l, d, k, t, v, r, n A l, n, s, t, p, v, k, m 12 88
80 20 i, e, y, and, a, o B o, s, e, a, p, y 81 19
68 32 i, t, a, e, u, o V o, a, i, s, s, n, l, r 60 40
78 22 p, y, a, u, e, o G o, a, p, l, u, b 69 31
72 28 p, i, y, a, i, e, o D e, a, u, o, n, y, p, v 68 32
19 81 m, i, l, d, t, r, n E n, t, r, s, l, v, m, and 12 88
83 17 p, e, u, a, y, o F e, i, d, a, n 71 29
89 11 oh, e, a, and 3 a, n, v, o, m, d 51 49
27 73 p, t, m, i, o, l, n AND s, n, v, i, e, m, k, z 25 75
55 45 b, b, f, o, a, i, c TO o, a, u, p, y, t, l, e 73 27
77 23 r, v, s, i, e, o, a L u, e, o, a, b, i, u, u 75 25
80 20 i, s, a, i, e, o M i, e, o, y, a, n, n, s 73 27
55 45 d, b, n, o, a, i, e N o, a, i, e, s, n, y 80 20
11 89 p, n, k, v, t, n O v, s, t, p, i, d, n, m 15 85
65 35 c, c, y, a, i, e, o NS o, p, e, a, y, u, l 68 32
55 45 u, k, t, a, p, o, e R a, e, o, i, y, i, s, n 80 20
69 31 s, t, v, a, e, u, o WITH t, k, o, i, e, b, s, n 32 68
57 43 h, y, i, a, e, o, s T o, a, e, i, b, b, p, c 63 37
15 85 n, t, k, d, n, m, r Have t, n, s, d, n, u, f 16 84
70 30 n, a, e, o, and F i, e, o, a, e, o, a 81 19
90 10 y, e, o, a, s, and X o, u, s, n, v, p, r 43 57
69 31 e, u, n, a, and C u, e, a, s 93 7
82 18 e, a, y, u, o H e, u, t, n 66 34
67 33 b, y, s, e, o, a, and, in NS e, i, n, a, o, l 68 32
84 16 f, b, a, i, u SCH e, u, a 97 3
0 100 m, r, t, s, b, c, n NS L, x, e, m, i, v, s, n 56 44
0 100 n, s, t, l B n, k, v, n, s, e, o, and 24 76
14 86 s, s, m, l, d, t, r, n NS n, t, p, s, k 0 100
58 42 b, o, a, i, l, y NS d, t, sch, c, n, p 11 89
43 57 o, n, p, l, a, u, s I AM v, s, t, p, d, k, m, l 16 84

When analyzing the compatibility of letters with each other, one should bear in mind the dependence of the appearance of letters in the plain text on a significant number of preceding letters. To analyze these patterns, the concept of conditional probability is used.

The famous Russian mathematician A.A. Markov (1856-1922). He proved that the appearance of letters in plain text cannot be considered independent of each other. In this regard, A.A. Markov noted another stable pattern of open texts associated with the alternation of vowels and consonants. He calculated the frequency of occurrence of vowel-vowel bigrams ( r, r), vowel-consonant ( r, s), consonant-vowel ( s, g), consonant-consonant ( s, s) in Russian text with length in characters. The calculation results are reflected in the following table:

Table 6.2. Alternating vowels and consonants
G WITH Total
G 6588 38310 44898
WITH 38296 16806 55102

Example 6.2 The plain text, keeping spaces between words, was written into the table. The beginning was in the first line, the text was written from left to right, moving from one line to the next, encryption consisted in rearranging the columns. Find plaintext.

Cipher Text:

D V NS T
G O E R O
Have B D Have B
M M I AM NS R NS

Solution. Let's assign numbers to the columns in the order they appear. Our task is to find such a column order in which the text will be meaningful.

Let's make a table:

1 2 3 4 5 6
1 NS
2 NS
3 NS
4 NS
5 NS
6 NS

A cell (,) in this table means that the numbered column follows the numbered column. We mark impossible cases with an "X".

Combinations of columns 1, 2 and 5, 2 are not possible, since a vowel cannot appear before a soft sign. The succession of columns 2, 1 and 2, 5 is also impossible. Now from the third line it follows that 1, 5 and 5, 1 are impossible, since UU is a bigram uncharacteristic for the Russian language. Further, two spaces in a row cannot be in the text, which means we put an "X" in cells 3, 4 and 4, 3. Let's turn to the third line again. If column 2 followed column 4, then the word would start with a soft sign. We put "X" in cells 4, 2. From the first line: the combination of 4, 5 is impossible, and 3, 5 is also impossible. The result of our reasoning is presented in the table:

1 2 3 4 5 6
1 NS NS NS
2 NS NS NS
3 NS NS NS
4 NS NS NS NS
5 NS NS NS
6 NS

So, after column 6, column 5 must necessarily follow. But then we put "X" in cell 6, 2 and we get: column 2 follows column 3. Next, we crossed out 5, 1 and 2, 1, therefore, we need to check the options:. . 6532 ... and ... 65432 .... But (4, 3) was deleted earlier. So, the options for the arrangement of the columns remain:

  • 1, 6, 5, 3, 2, 4
  • 6, 5, 3, 2, 4, 1
  • 4, 1, 6, 5, 3, 2
  • 1, 4, 6, 5, 3, 2

Let's write 6, 5, 3, 2 columns in a row:

6 5 3 2
T NS - v
O R O G
b at d b
NS R I am m

Trying to put column 1 in front of column 6 will result in an MT bigram in the last row and a combination of DTA in the first. The remaining options are: 653241, 146532.

Answer: 653241 - key, plaintext: you \ _in \ _the road \ _be \ _ stubborn (a line from a song popular in the 1970s).

Here is another example of cryptanalysis of the column permutation cipher.

Example 6.3 Decrypt: SORRY \ _EDPSOCOKAIZO

Solution. The text contains 25 characters, which allows it to be written into a 5x5 square matrix. It is known that encryption was performed column by column, therefore, decryption should be performed by changing the order of the columns.

Permutation cipher "wandering". In the V century. BC. the rulers of the Greek state of Sparta had a well-developed system of secret military communications and encrypted their messages with the help of the wander, the first simple cryptographic device that implements the method of simple permutation (Fig. 1.6).

Rice. 1.6.

The encryption was performed as follows. A strip of leather was wound in a spiral (coil to coil) onto a cylindrical rod called skitala and several lines of message text were written on it along the rod. Then they removed the strip from the rod - the letters on it turned out to be located at random.

The messenger used to hide the message using a leather band as a belt, i.e. in addition to encryption, steganography was also used. To get the original message, a strip of leather must be wrapped around a wrap of the same diameter. The key of this cipher is the diameter of the rod - from the cipher. Knowing only the type of cipher, but not having the key, it is not easy to decipher the message. The "wandering" cipher was improved many times in subsequent times.

The way to break this cipher was proposed by Aristotle. It is necessary to make a long cone and, starting from the base, wrap it with a tape with an encrypted message, gradually moving it towards the top. At some point, chunks of the message will begin to be viewed. The diameter of the cone at this point corresponds to the diameter of the wandering.

Encryption tables. One of the most primitive table permutation ciphers is a simple permutation, for which the size of the table is the key. This encryption method in its simplest form is similar to the "wandering" cipher. For example, the text message is written to a table of a certain size in a column, and read in rows.

Let's write the phrase "Terminator arrives on the seventh at midnight" in a 5x7 table (Fig. 1.7) but columns. Having written out the text from the table line by line, we get the code: "tnnweglearadonrtie'vobtmnchirysooo".

Rice. 1.7.

The sender and receiver of the message must agree in advance on a common key in the form of a table size. When decrypting, the actions are performed in the reverse order (line-by-line writing, reading by columns).

This cipher can be somewhat complicated: for example, the columns can be rearranged in a certain sequence determined by the key. Possible double permutation - columns and rows.

Cardano grille. A Cardano grid (pivot grid) is a rectangular or square card with an even number of rows and columns 2k X 2t. Holes are made in it in such a way that with successive reflection or rotation and filling of the open cells of the card, all the cells of the sheet will be gradually filled.

The card is first reflected about the vertical axis of symmetry, then about the horizontal axis, and again about the vertical one (Figure 1.8).

If the Cardano lattice is square, then another variant of its transformations is possible - rotation by 90 ° (Fig. 1.9).


Rice. 1.8.


Rice. 1.9.

When writing in the usual way (from left to right and from top to bottom) the phrase "text encryption" (without spaces) in the free cells of the rotary lattice shown in Fig. 1.9, we get the text in the form of a table (Fig. 1.10), or, having written the text in one line, - "kshiioesvtafatren".

Rice. 1.10.

The recipient must know the stencil and apply it in the same sequence as when encrypting. The key is the selected type of lattice movement (reflection or rotation) and the stencil - the location of the holes, which for a square lattice are 2t NS 2k can be selected in 4 "" * ways (taking into account the initial orientation of the stencil). In this case, among the stencils considered to be different, there will be those that are mirror images or rotations of other stencils, i.e. stencils differing only in the initial location (orientation). If we neglect the initial position of the stencil, then, obviously, there will be 4 times less different stencils - 4 "" * "

For example, for 4X4 grids, there are 256 possible stencil options (based on initial orientation) or a total of 64 different stencils.

Despite the fact that the number of stencils for large lattices is quite large (about 4 million (4-10 e)), it is still significantly less than the number of random permutations of table elements, the number of which is (2t? 2k).

For example, for a 4x4 table, the number of random permutations is on the order of 2? 10 13, and for 8x8 tables - about 10 89.

Cardano lattices, like cipher tables, are special cases of routing permutation ciphers.

Top related articles