The main purpose of this study was to secure Serpent found on IoT devices against DL attacks. The original 4-bit output S-Boxes of Serpent were replaced with new generated 32-bits output S-Boxes. A new mathematical function called Blocker was developed using three magic numbers. A new 32-bit output S-Boxes and Blocker were inserted on Serpent’s infrastructure in order to obtain better encryption and decryption processes with resistance to DL attacks. After inserting new 32-bits output S-Boxes and Blocker in Serpent’s infrastructure, a newly modified Serpent was developed. In this study, the new modified Serpent, with a new S-Boxes and Blocker, was coined Magic Serpent (Mag_Serpent). The functionality of Mag_Serpent was found to be very different compared to the original Serpent since the encryption process, strength, and the resistance of the DL attacks were stronger than the original Serpent found on IoT devices. The research study was conducted as follows:
The Serpent’s S-Boxes were found to be 4 × 4, meaning that they had 4-bit inputs and 4-bit outputs. It was easy to construct
DLCT using these kinds of S-Boxes. The
DLCTs of original Serpent’s S-Boxes were tables of
×
matrix with high-probability elements for discovering secret keys. Generally, if an S-Box has N-bits of inputs and M-bits of output, then its
DLCT when constructed will be a
×
matrix. Hence, the
DLCT of the first S-Box of Serpent, defined in
Table 1, was said to be
×
. A C++ program code was written to construct
DLCT of the original first S-Boxes defined in
Table 1 using Equation (
2). It was proven that it is an easy method to attack Serpent using
DLCT, as discussed by Bar-On et al. [
6] and Canteaut et al. [
7]. In order to block the DL attack, the new 32-bit output S-Boxes were generated to replace Serpent’s original S-Boxes. For instance,
Table 1,
Table 2,
Table 3,
Table 4,
Table 5,
Table 6,
Table 7 and
Table 8 were replaced with
Table 10,
Table 11,
Table 12,
Table 13,
Table 14,
Table 15,
Table 16 and
Table 17, respectively. The Blocker Function was constructed from three magic numbers using C++ code given in
Figure 1. The magic numbers were
Q = 4,302,746,963,
P = 4,559,351,687, and
M = 4,294,967,296.
4.1. A Blocker Function
In this study, a new function described as a Blocker is added (refer to
Figure 1). A Blocker Function is an a new generated C++ function implemented solely to develop DL attack blockages on the Serpent algorithm required on IoT devices. This function is developed after the S-Boxes of the Serpent algorithm are transformed to produce 32-bit output S-Boxes. The main purpose of a Blocker Function is to ensure that newly generated 32-bit output S-Boxes suit Serpent’s algorithm infrastructure. In simple terms, a Blocker Function regulates all new 32-bit output S-Boxes efficiently utilized throughout the encryption and decryption processes of the newly adjusted Serpent algorithm. A Blocker Function offers a new 32-bit S-Box suitable for the new Magic Serpent Algorithm. A Blocker Function confuses the intruder since it contains many mathematical random numbers. Additionally, most random numbers are irreversible. Without a Blocker Function, a new generated 32-bit output S-Box will not be placed in the algorithms. This Blocker Function has distinct characteristics for ensuring that a DL attack is obstructed. These characteristics are defined as follows:
- 1.
The output of a Blocker Function is not fixed unlike in S-Boxes where a look-up table is implemented with defined inputs and outputs.
- 2.
The output of a Blocker Function is secreted and calculated unlike in the Serpent S-Boxes where the output is remarkable on a look-up table.
- 3.
A Blocker Function is inevitable. If one recognizes an output of a Blocker Function that does not signify an input, it can be reversely estimated and retrieved. The intention is that a Blocker Function is composed of several quantities of random numbers and XOR operators.
- 4.
Chosen magic numbers (such as
P,
Q, and
M) used in a Blocker Function are unfactorizable. Refer to
Figure 1.
- 5.
All functions appropriated to comprise a Blocker Function are non-linear.
- 6.
The input of a Blocker Function is 32-bit long, and the intruder cannot easily create the DLCT of using a computer or any processor since a lot of memory is required.
- 7.
A Blocker Function acquires the output of 32-bit S-Boxes and manipulates them as its input. Then, an outstanding output value is produced in order to be utilized in the Magic Serpent algorithm. A new distinct output value is unpredictable; hence, it confuses the intruders.
- 8.
The output of 32-bit S-Boxes is determined as
. A Blocker Function receives this output as its input and returns an unpredictable variable called
. Refer to
Figure 1.
- 9.
After executing a Blocker Function, all functions in the Serpent algorithm recalling S-Boxes have to identify or employ a Blocker Function because S-Boxes are mathematically preserved and unalterable in a Blocker Function.
- 10.
A Blocker Function provides tamper-proof 32-bit output S-Boxes. Let us suppose that the positions of 32-bit output S-Boxes are altered or the 32-bit S-Boxes are displaced. In that case, Mag_Serpent will not produce the anticipated results.
This study applies a Blocker Function to create a new 32-bit S-Box suitable for the new Magic Serpent Algorithm, and this distracts the attacker since it contains many mathematical random numbers and XOR operators. Additionally, most mathematical random numbers and XOR operators are irreversible. Unlike the traditional S-Boxes employed in Serpent algorithms, a Blocker Function has supplemented robustness against a DL attack. A Blocker Function works favorably in both and is suitable with respect to the new 32-bit S-Boxes and prevents a DL attack of a new Magic Serpent algorithm. Mathematically, a Blocker Function is created as follows.
Assign: M = 4,294,967,296
Perform: Change the value of , using as the value of the following:
where is an input of a Blocker Function from 32-bit S-Box.
Check if the value of is greater than M. If > M, open a first loop of statement. Assign the following:
Q = 4,559,351,687;
P = 4,302,746,963.
is a random number with the range up to a value of (). This number is with the magic numbers in the entire Blocker Function. is a random number, and it is unpredictable and irreversible. Close a first loop of statement.
Check if this the value of is less than or equal to M. If < or =M, open a second loop of or statement. Assign the following: is a random number with the range up to . Assign and , where is the left round shifting of the number of bits, for example, five in decimal notation = 0101 in binary notation. If 0101 is round left-shifted one (by one), then 0101 will be 1010 in binary notation, which equals 10 in decimal notation or A in hexadecimal notation. Therefore, is represented in decimal notation. Assign the following:
;
;
;
.
Change the values of M, P, and Q into random numbers in a range from 0 to iSecret; mathematically, this can be expressed as follows:
the where operation is the mathematical operator that returns the remainder of a division random number x denoted by and iSecret. In this study, x can be M, P, or Q. Close a second loop of or statement.
Recollect all the declared values calculated from the first and second statements. If the recollected values pass a variable Q greater than zero, then create a variable called .
Assign the following: . where and are mathematically bitwise operators. Note that operator returns negative numbers increased by one if an input is a positive integer. For instance, , , , and so on.
Assign the following: , where is an absolute operator. An absolute operator converts every negative variable to a positive variable. For instance, .
Assign the following:
;
.
Assign the following: .
Note that the creation of always decreases the value of Q continuously until Q is less than zero. A Blocker Function also checks if Q is greater than zero. If Q is more significant than zero, recur the third loop until Q is less than zero or change Q, P, and M values into random numbers with a range of zero to the value of .
Transfer or replace the new value of that will be used by different Serpent functions or other building blocks used on the Serpent algorithm.
Close the third loop.
Close a Blocker Function.
A Blocker Function uses a 32-bit output value from S-Box as
and delivers a new value
value as an output. A Blocker Function also turns
P value,
M value, and
Q value into unfactorizable polynomials. Random numbers and XOR operators are utilized for complexity and confusion to prevent reverse engineering for attackers. The XOR operator and
change the values of the variables inside a Blocker Function. The random numbers and XOR operators also provide a problematic input range when invaders reverse a Blocker Function to calculate the exact information utilized in that situation. The value of
M,
P, and
Q are also continually maintained as unfactorizable polynomial variables, which are non-linear and hard to reverse, in order to construct
DLCTs using any machine or computer. The random numbers and XOR operators include inventing hidden, unseen, and unchangeable variables for intruders. A Blocker Function produces a unique 32-bit S-Box suitable for the new Magic Serpent Algorithm. A Blocker Function distracts the attacker since it comprises many mathematical random numbers and XOR operators. Additionally, most mathematical XOR operators and random numbers are irreversible. For more mathematical characteristics of a Blocker Function and C++ explanations, refer to
Figure 1. For more detail of a Blocker Function and flowchart, refer to
Appendix A Figure A1.
4.3. Experimental Contribution of DL Attack on a Newly Generated Mag_Serpent
Mag_Serpent used a new 32-bit S-Box, which declined to execute C++ DLCT from various computers and machines due to memory limitations on diverse computers and machines. No computers and machines could compute the DLCT of × = 16 × 429,4967,296 matrix, which is presumed to carry 68,719,476,736 entities. Without DLCT, it was impracticable to conduct a DL attack on a newly generated 4 × 32 S-Boxes of Mag_Serpent algorithm. No rounds out of 32 were attacked using the DL attack due to the new 32-bit output S-Boxes, which obstructed the development of the DLCT due to memory constraints.
A review of how
DLCT was theoretically developed was examined and programmed experimentally in C++ code for validation, testing, confirmation, and verification. On the Serpent, the results revealed that the DL attack was possible. The main building blocks that performed all possibilities of the DL attack were the size of the S-Boxes. The Serpent’s S-Boxes were 4 × 4, indicating 4-bit inputs and 4-bit outputs. The experiment determined that it was straightforward to build
DLCT utilizing the 4 × 4 Serpent S-Boxes (refer to
Table 9 and
Figure 7).
The experiment used a C++ program to generate the
DLCT of 4 × 4 and 4 × 32 S-Box. The code validation was examined by using a 4 × 4 Serpent S-Boxes and a newly generated 4 × 32 S-Box of Mag_Serpent algorithm. The purpose of validating the code was to confirm the correctness of the written C++ experimental output
DLCT compared to the theoretical outputs. Note that the
DLCT of 4 × 4 S-Box is a matrix of
×
= 16 × 16 matrix with 256 entities (refer to
Table 9 and
Figure 7).
The experiment continued on a newly developed 4 × 32 S-Box of Mag_Serpent algorithm. The program malfunctioned after five hours before the
DLCT was executed. No computer or machine could compute the
DLCT of
×
= 16 × 4,294,967,296 matrix, which is expected to contain 68,719,476,736 entities. Without the
DLCT, conducting a DL attack on a newly developed 4 × 32 S-Box of Mag_Serpent algorithm was impracticable (refer to
Table 9 and
Figure 7).
DLCT of 4 × 4 S-Box had the first integer 16, which is
considering the S-Box required four bits output as the most distinguished parameter. Sixteen is a byte that was donated as 00010000 in binary notation. If each 4 × 4 S-Box
DLCT was treated as a byte, then the memory required to construct 4 × 4 S-Box
DLCT is 8 bits × 256 = 256 bytes. Note that 256 is the number of items displayed on a 4 × 4 S-Box
DLCT. A machine or computer can efficiently handle 4096 bytes (refer to
Table 9 and
Figure 7).
From the above computations, the S-Box required thirty-two bits as the first parameter. The study presumed that the
DLCT of 4 × 32 S-Box would have the first number item as 4,294,967,296, which is
. The 4,294,967,296 number is a triple-word comprising 5 bytes donated as 00000000100000000000000000000000000000000 in binary notation. If each 4 × 32 S-Box
DLCT element were treated as a triple-word, then the memory required to build 4 × 32 S-Box
DLCT would be
= 343,597,383,680 bytes. Note that 343,597,383,680 was an expected number of entities displayed on a 4 × 32 S-Box
DLCT. A machine or computer could not easily handle a computation memory of 343,597,383,680 bytes of each item. Hence, C++
DLCT of the 4 × 32 S-Box program malfunctioned before execution (refer to
Table 9 and
Figure 7).
DLCT of the Serpent S-Box was a table with
rows ×
columns with high probabilities of comprehending a key. The experiment used the C++ program to generate the
DLCT of 4 × 4 Serpent S-Box. After examining the method, the results confirmed that attacking the Serpent algorithm using
DLCT was achievable. The study applied the newly created 32-output-bit S-Boxes on Serpent found on IoT devices in order to block a DL attack (refer to
Table 9 and
Figure 7).
Table 9 was presumed
DLCT, and
Figure 7 was the experimentally analyzed
DLCT performed by running a C++
DLCT code. A C++
DLCT code was used to prove and confirm that the study of building a
DLCT was conducted with all methods of a DL attack on a Serpent.
The code was also implemented in both Serpent and Mag_Serpent in order to examine whether a DL attack was possible. All results were presented, and the results completely explain the development of the
DLCT that came before; after a novel approach of utilizing 32 bits, S-Boxes were implemented. The study employed a Blocker Function to create a new 32-bit S-Box suitable for the new Mag_Serpent algorithm and distracted the intruder. The random numbers and XOR operators also provide a problematic input range when attackers reverse a Blocker Function to determine accurate information used in that situation. The values of
M,
P, and
Q are also continually maintained as unfactorizable polynomial variables, which are non-linear and hard to reverse, in order to construct
DLCT using any machine or computer. The random numbers and XOR operators include inventing hidden, unseen, and unchangeable variables for intruders. A Blocker Function produces a unique 32-bit S-Box suitable for the new Magic Serpent Algorithm. A Blocker Function distracts the attacker since it comprises many mathematical random numbers and XOR operators. Additionally, most mathematical XOR operators and random numbers are irreversible. For more mathematical characteristics of a Blocker Function and C++ explanations, refer to
Section 4 and
Figure 1.
In this study, Mag_Serpent was resistant to a DL attack and created a new 4 × 32 S-Box. The study used a Blocker Function to insert the new 32-bit S-Boxes that are suitable for the new Mag_Serpent algorithm. The study used a Blocker Function to confuse the attacker since it comprises many mathematical random numbers and XOR operators. Additionally, most mathematical XOR operators and random numbers are irreversible. The new Mag_Serpent successfully decrypted and encrypted information after adopting a Blocker Function and the new 4 × 32 S-Boxes. The code of the new Mag_Serpent algorithm is obtainable upon request. The C++ code confirmed that a DL attack was permissible to a standard Serpent on several rounds, including round 12 before applying a Blocker Function and the new 4 × 32 S-Boxes. Nevertheless, after applying a Blocker Function and the new 4 × 32 S-Boxes as a novelty, the C++ code confirmed that the study blocked the DL attack successfully on Mag_Serpent. Additionally, creating a DLCT matrix with rows and columns was not straight forward due to the memory constraints of the computer.