Aatbash, the cipher of Szital, the Cardano lattice - well-known ways to hide information from prying eyes. In the classical sense, a permutation cipher is an anagram. Its essence lies in the fact that the letters of plaintext change positions according to a certain rule. In other words, the cipher key is to change the sequence of characters in an open message. However, the dependence of the key on the length of the encrypted text has generated many inconveniences for using this type of cipher. But smart heads found interesting tricky solutions that are described in the article.
Inverted Groups
To familiarize yourself with encryption using the permutation method, we mention one of the simplest examples. Its algorithm consists in dividing the message into n blocks, which are then turned back and forth and swapped. Consider an example.
- "The day was leaving, and the sky was dark."
Divide this message into groups. In this case, n = 6.
- "They didn’t duke one day."
Now expand the groups, writing each one from the end.
- "Hyuned Waben Zo Methu Yin."
We rearrange them in a certain way.
- "ylido methu yyn huned waben zo."
For an ignorant person in this form, the message is nothing more than rubbish. But, of course, the one to whom the message is addressed knows the decryption algorithm.
Mid insert
The algorithm of this encryption is a bit more complicated than encryption using the permutation method :
- Divide the message into groups with an even number of characters.
- Insert additional letters in the middle of each group.
Let's look at an example.
"Earth creatures took to sleep."
"Earth ariu drive deceitfully."
"Zeamn yyabtv araiu voabdi lkoasnu."
In this case, alternating letters "a" and "ab" were inserted in the middle of the groups. The inserts may be different, in different numbers and not repeated. In addition, you can expand each group, mix them, etc.
Sandwich Cipher
Another entertaining and simple example of permutation encryption. To use it, you need to divide the plaintext into 2 halves and enter one of them character-by-character between the letters of the other. We show an example.
- "From their labors; I alone, homeless."
Divide into halves with an equal number of letters.
- "You will be able to do homelessness."
Now we write the first half of the message with a large interval between letters.
- "About t and h t r u d about in l and sh".
And in these spaces we place the letters of the second half.
- "Oyatoidhitnrbuedzodvolminshy".
Finally, group the letters into a kind of word (optional operation).
- "Oyatoi dhi tnrbuye zodvol minshy."
Encrypting text with this method is very easy. The uninitiated will have to unravel the resulting string of nonsense for some time.
Permutations on the "route"
This name was received by ciphers, widely used in antiquity. The route in their construction was any geometric figure. Clear text was recorded in such a figure according to a certain scheme, and was extracted in the opposite direction. For example, one of the options could be to write to the plaintext table according to the scheme: the snake creeps in the cells clockwise, and the encrypted message is compiled by writing off the columns in one row, from the first to the last. This is also permutation encryption.
We show an example of how to encrypt text. Try to determine the recording route and the cipher program route yourself.
We will record the message in a table measuring 3x9 cells. The dimension of the table can be determined based on the length of the message, or use some fixed table several times.
P | R | and | g | about | t | about | in | l |
R | e | d | s | in | I | from | l | I |
well | a | t | b | in | about | th | n | at |
We will compose the cipher starting from the upper right corner of the table.
- "Launvosoyoitovvygidtaerprzh".
The handling of the described steps is not difficult. Just do the opposite. This method is extremely convenient, because it makes it easy to remember the encryption and decryption procedure. It is also interesting, because you can use any shape for the cipher. For example, a spiral.
Vertical permutations
This type of cipher is also a variant of the route permutation. He is primarily interested in the presence of a key. This method was widespread in the past and also used tables for encryption. The message is written to the table in the usual way - from top to bottom, and the cipher program is written vertically, while following the order specified by the key or password. Let's look at a sample of such encryption.
We use a table with a dimension of 4x8 cells and write our message into it in the usual way. And for encryption we use the key 85241673.
and | from | t | I | g | about | from | t |
n | s | m | P | at | t | e | m |
and | from | from | about | from | t | R | a |
d | a | n | b | e | m | | |
The key is given below.
Now, using the key as an indication of the order, we write the columns in a row.
- Gusetmsntmayapysysottmserinid.
It is important to note that with this method of encryption, empty cells in the table should not be filled with random letters or characters, hoping that this will complicate the cryptogram. In fact, on the contrary, such an action will give enemies a clue. Because the key length will be equal to one of the message length divisors.
Reverse decoding of vertical permutation
Vertical permutation is of interest in that the decryption of the message is not a simple following of the algorithm from the opposite. Anyone who knows the key knows how many columns are in the table. To decrypt a message, you need to determine the number of long and short lines in the table. This will determine the beginning, where to start writing the cryptogram to the table in order to read plain text. To do this, divide the message length by the key length and get 30/8 = 3 and 6 in the remainder.
Thus, we became aware that in the table there are 6 long columns and 2 short, filled with letters not completely. Looking at the key, we see that the encryption started from the 5th column, and it should be long. So we find that the first 4 letters of the cryptogram correspond to the fifth column of the table. Now you can write down all the letters in places and read the secret message.
Cardano Lattice
This type refers to the so-called screen ciphers, but in essence is encryption using the character permutation method. The key is a stencil in the form of a table with cut holes in it. In fact, any shape can be a stencil, but most often a square or a table is used.
Cardano stencil is made according to the following principle: cut cells when turning 90 ° should not overlap each other. That is, after 4 turns of the stencil around its axis, the slots in it should not coincide even once.
We use for example a simple Cardano lattice (in the figure below).
Using this stencil, we encrypt the phrase "About Muse, I will appeal to you."
Fill the stencil cells with letters according to the rule: first from right to left, and then from top to bottom. When the cells run out, turn the stencil 90 ° clockwise. In this way we get the following table.
And once again, turn 90 °.
And the last turn.
After combining 4 tables into one, we get the final encrypted message.
I | ABOUT | M | M | G | FROM |
IN | ABOUT | At | B | ABOUT | R |
G | 3 | A | 3 | U | S |
IN | G | TO | G | A | At |
G | IN | G | N | G | A |
M | FROM | B | B | E | G |
Although the message may remain so, it will be more convenient for transmission to receive a familiar-looking cryptogram. To do this, empty cells can be filled with random letters and write columns in one line:
- "YAVGVGM OOZGVS MUAKG MBZGN HOSPITAL SRYUAG"
In order to decrypt this message, the recipient must have an exact copy of the stencil that was used for encryption. This cipher has long been considered fairly stable. He also has many variations. For example, the use of 4 Cardano lattices at once, each of which rotates in its own way.
Permutation Cipher Analysis
All permutation ciphers are vulnerable to frequency analysis. Especially in cases where the message length is comparable to the key length. And this fact cannot be changed by repeated use of permutations, no matter how complex they may be. Therefore, in cryptography only ciphers that use several mechanisms at once, in addition to permutation, can be stable.