# Securing IoT Devices against Differential-Linear (DL) Attack Used on Serpent Algorithm
## 4 Research Methodology  
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:  
1. Serpent was collected from IoT devices (such as smart cards, sensors, and 8-bit processors). 2. The correctness of Serpent was checked and tested by using test vectors given by Serpent developers' reports. 3. All the implemented procedures on Serpent during the process of DL attacks were tested and analyzed using C++. 4. All the original 4-bit output S-Boxes of Serpent were replaced by the newly generated 32-bit output S-Boxes. 5. Three magic numbers were used to generate a new function called Blocker inserted in Serpent infrastructure using C++ implementation. Refer to Figure 1.
6. All functions retrieving S-Boxes of 4-bits output from original Serpent were changed to retrieve a Blocker Function with 32-bit output S-Boxes. Let us examine the following example. \[Output=S_{i}(x)\] (3) Note: \[S_{i}(x)\] on Equation (3) is 4-bit output S-Box. Equation (3) is replaced to retrieve Equation (4). \[Blocker(S_{i}(x),Output)\] (4) \[S_{i}(x)\] on Equation (4) is a 32-bits output S-Box since all original 4-bit output S-Boxes were replaced with new 32-bit output S-Boxes. Upon key generation, defined in Figure 3, the Golden ratio \[\phi=9E3779B9\] is also replaced by magic number \[M=4,294,967,296.\]
7. The possibility for DL attacks was verified with respect to whether it was still successful after new S-Boxes and Blocker had been applied or inserted. If it was still possible, steps three and four are repeated. 8. If a DL attack was blocked on steps three, four, and five, then a new algorithm inserted with new 32-bit output S-Boxes and Blocker was accepted as a Magic Serpent (Mag_Serpent). As a result, Mag_Serpent was found to be resistant to DL attacks. The research methodology was conducted on how to make _DLCT_ more unmanageable with respect to preventing attackers from discovering Serpent's keys after a DL attack is applied. It was already stated that the security of Serpent depends on the size of the S-Box output bits. The original output bits of Serpent's S-Boxes were found to be short (4-bit). It is easy for attackers to attack such a type of algorithm. New generated 32-bit output S-Boxes were used to replace all 4-bit output S-Boxes in order to increase the size of output bits so that Serpent is secured against DL attacks. It was found that the new 32-bit output S-Boxes worked successfully in preventing DL attacks, while the Blocker Function worked successfully to block the construction of _DLCT_. The research methodology is summarized using the schematic diagram in Figure 4. The results used successfully to obstruct the construction of _DLCT_ and yielded a complicated process for conducting DL attacks on Serpent. The Serpent's S-Boxes were found to be 4 \(\times\) 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 _DLCT_s of original Serpent's S-Boxes were tables of 24\({}^{4}\)\(\times\) 24 matrix with high-probability elements for discovering secret keys.