A novel of substitution-box design using PLL algorithms in magic cube

In most modern symmetric ciphers, substitution boxes are non-linear core components that provide robust security and confusion. The construction of active S-boxes has been hot object among safely experts. The goal is at build a cryptographically active S-box, number of researchers have built an S-Box using RNA, DNA, chaotic systems, etc. In this article, we used new approach to generate multiple S-Boxes based on the Permutation of Last Layer algorithms (PLL) to replacement the place (permutation) of the pieces generated from the Magic Cube and instead of using static S-Boxes, we can generate dynamic S-Boxes to use various S-Boxes in every round to add to confusion. When comparing the proposed algorithm with other searches and tests on it. We found it has achieved a high percentage of success comparable to the S-Box from chaotic and etc. The proposed design passes S-Box test criteria effectively, these tests: invertibility, completeness, avalanche, strict avalanche, and balanced are among S-Box test criteria. The results of the analysis show that the novel S-Box overrun each of these statistical tests, has a good avalanche impact, and thus can protect against a wide range of attacks. Because S-Box and its reverse take but smaller milliseconds to construct it ability be applied in a variety of lightweight applications


Introduction
Individuals and organizations can use cryptography to protect their data. Various asymmetric and symmetric ciphers reign been intended for this purpose. Symmetric ciphers are simpler and more efficient than asymmetric ciphers, and they use fewer computational resources. Stream and block ciphers are the two major types of symmetric ciphers [1]. When compared to stream ciphers, block ciphers are easier to implement, extra public, while cryptographically stronger [2]. The block cipher is regarded accordingly one of the most very applied supply into data security [3]. All of the very recent and widely used symmetric ciphers, such as AES, DES, Blowfish, RC2, RC5, and IDEA, are block ciphers. Substitution and permutation procedures or the Feistel structure are used by the majority of block ciphers. A substitution operation uses a substitution box (S-Box) to swap one set of bits for a different set of bits (S-Box). The position of bits or bytes in the specified input block is changed by the process of flipping. The S-Box is one of the most basic techniques for creating candid confusion. The creation is complex association that should be confirmed between the plaintext and the cipher text is referred to as confusion [4].Many researchers have looked into new and innovative ways to design S-Boxes. AES is a popular block cipher that employs S-Boxes in the encryption and decryption processes. Sah. et al. [5] proposed an improvement to AES's security. It encrypts different plaintext blocks using multiple sub-keys. However, the new cipher is more complex and slower than AES [6][7][8][9]. There is a lot of research that indicates the development S-Boxes to AES's security such that [10][11][12][13]. DNA computing is another popular area of cryptography that has been suggested as a possible way to solve for resistant cipher styling. Kad. et al. [14] as well as Al-Wat.et al. [15] was using DNA processing to propose effective S-Boxes, examined the validity of the proposed ciphers using different factors, as well as proved that the ciphers passed a test. Several other researchers proposed and created cryptographic techniques using DNA computing. Like [16][17][18].Ciphers that use S-Boxes rely heavily on their security. M. K and Gn. [19] In 2016, he suggested an S-Box focused on pseudo-random-number-generators and able to share. It proved to be more efficient when the S-box dimensions are used and can be integrated into famous cryptographic techniques. Nas. et al [20] presented S-p-Boxes that are highly nonlinear in 2019; the proposed includes a great number of highly nonlinear S-P-Boxes. Because chaotic systems have the ownership of randomness, chaot cryptographic is one of the more motivating areas in the field of input scurry in the new time [21]. Garg et al. [22] investigated various techniques for designing S-Box as well as indicated that S-Boxes built to use a chaotic method have strong cryptographic properties. When compared to the original chaotic logistic map, Alz. et al [23] introduced a new 1D discrete-chaotic map with both a big chaotic scope and better chaos actions. They constructed efficient substitution-boxes using this improved chaotic map and hill climbing search technique (S-boxes). The test results offer that the created S-box has perfect cryptography force and is set up to be best than other S-boxes ready. Mer. et al [24] S-box generation algorithms established on the series created by the 1D chaotic logistic plan neutrallision . Several other researchers proposed and created block ciphers using DNA mathematics, like [7,[23][24][25][26][27]. In this article, used novel algorithm to produce the S-box established the Permutation of Last Layer algorithms (PLL) generated from the Magic Cube. The first PLL algorithm is responsible for generating the decimal symbol, whilst the second algorithm is taking charge of to generate the hexa token processing this hexa symbol to create the S-Box. When compared to other proposals, the propos S-Box is prepared in that a path that it takes little time to build while also having good statistical tests. The remainder of this article is as follows: part 2 present Magic Cube and part 3 present the propose way to build S-Box established on PLL algorithms. In part 4 present the test of this suggestion. The conclusion of this article is offered in part 5.

Magic cube (Rubik's cube)
Ern Rubik, a Hungarian sculptor and architecture professor, invented the Rubik's cube in 1974. The magic cube has three layers and six faces with different colors, each with nine cells with same color.
The magic cube also has a number of rotations (NR) is a possible rotation type. Popularly, in 3 × 3 × 3 cubes ,there are eighteen different rotations are potential [28].
Permutations of the authentic 3 × 3 × 3 Rubik's Cube is like being 8! × × (12! × 2) × This is nearly 43 quintillion. Because of the big number of possibility, solve the Rubik's cube becomes added difficult. As a result, it was intended to be using this difficulty in the suggested encryption system, that could allow obtaining the original message more difficult for hackers. Rubik cube can be rotated clockwise or anti-clockwise rotation, it has different layers like upper (UP), upper- (1) . Figure 1. The Rubik's cube and its unfolding structure based on face values [29] Rotation corner (RC): The corner of rotation of every layer is defined by the rotation corner, which can be 90°, 180°, 270°, or 360°. Because the rotation corner 360° residue constant as the corner begins to rotate, the cubes layer can be rotated at three various corners: 90°, 180°, and 270°. The rotate corner of 270° remains the same as the anti-clockwise rotation angle of 90° [30].

PLL algorithms (permutation of last layer)
It is an advanced technology of the Magic Cube which was Jessica Fridrich's progress entails memorizing a large number of algorithms, but there is a logical connection between them. The Petrus system and the Fridrich method (or full CFOP), which are used by the vast majority of speed cubes these days, must be mentioned when discussing advanced Rubik's Cube solving techniques. The advanced technique used by Jessica F. divide the puzzle into layers. and that you must help in solving the layer after layer in cube, Using algorithms at every step, without destroying the pieces that are actually see figure (2) [31][32][33].

Proposed substitution box
This article describes a new method for building S-Boxes that uses PLL algorithms to modification the positioning (permutation) on the pieces in the last layer without rotary them. After that, the cube would be solved. This step is split into two sections. As well: -Permutation of edges: It must permute the edges, which means changing their position but not orientation. It is necessary to consider the number of well-positioned edges.   The first and second stages in the above scheme use an algorithm PLL. It depends on solving the problem of different colors in the last layer of the cube by switching locations according to a certain movement and a certain direction as shown in algorithm 1.

End
In order to extract the original data, The S-Box inverse is used in the decryption process; algorithm 3 shows how to design the exact reverse for a novel S-Box. The initial value of the S-Box is implemented as follows: (FC). This value is divided in two numbers (F) to represent the address of the value in opposite S-Box (C). The row 0 and column 0 addresses of (FC) are obtained and combined to recognize the value that will be stored in the opposite S-Box. As a result, the value in row (F) and column (C) of the opposite S-Box is (00). Table (2) shows the results.

Algorithm (3): For the built S Box, use the opposite (Inverse) S -Box.
Input: S-Box array two dimension 16 Row and 16 Column.

Begin
For i=1 to 16 For j=1 to 16 Each number in S-Box should be separated into two numbers (to appear the address of the value in S-Box inverse).
The two numbers addresses are too obtained and joined to make the new value that will be stored in S-Box inverse.
Steps 2 to 3 are repeated until the inverted S-Box is completed successfully. End Table 1. PLL algorithm to produce S-box Table 2. The proposed Inverse algorithm to produce S-box

Performance comparison of the novel S-box
During this study, the S-Box was designed using the last layer permutation algorithms, and to prove the success of this proposal, it must pass the S-box criteria like avalanche, balanced, completeness, strict avalanche, invertability, that are compared to other S-boxes in related research and then shown below.

Bijection
Every S-box input value is set it to a single output value, essentially making the S-box a one-to-one function. Function. Such a property is required for the Inverse S-Box to correctly recover (back substitute) substitute values. Such as the letter C = 97 in ASCII code and letter C =43 in hexa cod, then the same latter is equal in proposed S-Box =A1, when, use the S-box inverse on A1, the 43 is output. Other words, the letter must return to the same value in the s-box, and this is one of the important factors to consider when designing the S-box: its ability to be reversible in require obtaining the main data.

Balanced criteria (BC)
Checking the diffusion of 0s and 1s in the output sequences is one of the most important S-box test criteria; this distribution should be balanced. [4,22]. The novel S-box is as seen in Table (3), that compares the BC test into two words used a novel S-box to different related research, it is balanced after this test in order to it has an equal or nearly equal number of 0s and 1s.

Completeness criteria (CC)
This is a measure; The input bits determine all of the output bits.. In the proposed algorithm, it depends on switching locations according to the use of 21 algorithms, where if an algorithm is used to change certain locations with other algorithms, I will get a new S-box, but if the locations of 21 algorithms are changed, I get a new S -box 100%100. Tables 3 and 4 show the results of these two examples. Table 4. The S-box produced by new permutation of position Table 5. The proposed Inverse algorithm to produce S-box

Avalanche criteria (AC)
A key standard in block ciphers is the avalanche property AC, which describes how well a small variation in the input bits tends for lead to a great (avalanche) variation at the value. Because of the result related to dispersion mathematics, this criterion, with such an optimal system of 0.5, is a likable feature to block cipher techniques. When design the block cipher, should commonly called result avalanche, which occurs when a single change in odd bit of input results in a fully various output. Compares the proposed method's AC value to the methods of Wan. et al. [5] and Bal. et al. [18] in table (4).

AE = (3)
The elements in the S-box algorithm most have a natural allocation between 0 and 1. This outcome is determined by the wherever you are, you must have a password. So according Equation, the letters should be distributed so at start of the algorithm (3). By calculating the above value for each letter A through Z and measuring ratio, this criterion is validated for our proposed method. Within case of a one-bit variation for every enter, Table (4) shows the example of how to evaluate the AC to use the proposed method and the methods that were compared.

Strict avalanche criteria (SAC)
If one bit in the input changes half of the output bits changes, the S-Box fulfills the strict avalanche set of criteria. [16,[34][35][36][37][38] is a phrase that can be used to describe a group of people In other words,SAC was achieved if both the completeness and avalanche criteria were met. The SAC is also achieved because the proposed technique meets these requirements. Table (5) shows an example of how to calculate the SAC using the proposed method and the compared methods if each entrant has a one-bit variation.

Conclusion
To encrypt data in our daily lives, the world of cryptography has become an important aspect of our daily lives, so a number of researchers have resorted to developing encryption algorithms Stream and Block cipher, as well as the development of the construction of the S-box used in the encryption algorithm. Where we discussed in this research the method of the Permutation last layer to build the S-box. The build the S-Box and its opposite in this proposal take only a few milliseconds. S-box tests such that savalanche, balance, strict avalanche, completeness, and invertablity were used to evaluate the novel S-box. These statistical exam were too compare to different studies in the field and get the dynamic S-box when change in the permutation of position by use permutation. These findings suggest the novel S-box has very good encryption ownership, allowing to secure communication, and that due to the speed with which S-box and its inverse are constructed, this S-box is appropriate into used in lightweight cryptography for appropriate devices. In the future work, we can use different Algorithm such first 2 layers to construct the S-box to growth the security level.