# Securing IoT Devices against Differential-Linear (DL) Attack Used on Serpent Algorithm
## 5 Results and Analysis
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Name of Algorithm** & **Time Complexity** & **Data Complexity** & **Rounds Attacked** \\ \hline Serpent & \(2^{115.5}\) & \(2^{101.2}\) & \(10\) \\ \hline Serpent & \(2^{231.7}\) & \(2^{249.4}\) & \(11\) \\ \hline Mag\_Serpent & \(\infty\) & \(\infty\) & \(0\) \\ \hline \hline \end{tabular}
\end{table} 
Table 18: Results of DL Attack. obtain a method called the Strict Avalanche Criterion (SAC) for examining the encryption robustness of an algorithm [22]. SAC is achieved if a particular input bit, either the plaintext or the key, returns the transformation of ciphertext output bits of 50% probability [22]. The experiment utilized the Avalanche Effect on Serpent and Mag_Serpent in order to obtain SAC. The results showed that the Serpent and a newly generated Mag_Serpent algorithm had better SAC characteristics. The Avalanche Effect of Mag_Serpent and Serpent on both key and plaintext was approximately 50% probability compared to SAC characteristics (refer to Table 21 and Figures 9-14). Figure 9: Experimental Avalanche Effect of Serpent when one bit of a key was flipped. Figure 10: Experimental Avalanche Effect of Serpent when one bit of a plaintext was flipped. Figure 11: Experimental Avalanche Effect of Mag_Serpent when one bit of a key was flipped. Figure 12: Experimental Avalanche Effect of Mag_Serpent when one bit of a plaintext was flipped. In cryptography, the memory required to install an algorithm is one of the most needed parameters before installation. If an algorithm requires higher memory than the platform or environments installed, that algorithm is neglected irrespective of encryption strength. The study measured the memory of both Serpent and Mag_Serpent using the C++ program. The results showed a memory of 11181 bytes and 13206 bytes for Serpent and Mag_Serpent, respectively (refer to Table 22 and Figures 15-17). \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Name of Algorithm**} & **Key Avalanche Effect in** & **Plaintext Avalanche Effect in** \\  & **Percentage** & **Percentage** \\ \hline Serpent & 49.8657 & 50.3842 \\ \hline Mag\_Serpent & 50.5340 & 49.7985 \\ \hline \hline \end{tabular}
\end{table} 
Table 21: Avalanche Effect of key and plaintext when one bit was flipped. Figure 14: Experimental plaintext Avalanche Effect in percentage. Figure 13: Experimental key Avalanche Effect in percentage. Encryption and decryption of Serpent and Mag_Serpent were experimentally conducted to verify if both algorithms functioned splendidly for the encryption and decryption. The study used an image to test the encryption and decryption of Serpent and Mag_Serpent using the C++ program. The results demonstrated that both encryption and decryption of Serpent and Mag_Serpent were working as expected (refer to Figure 18). \begin{table}
\begin{tabular}{c c} \hline \hline
**Name of Algorithm** & **Memory Required in Bytes** \\ \hline Serpent & 11,181 \\ \hline Mag\_Serpent & 13,206 \\ \hline \hline \end{tabular}
\end{table} 
Table 22: Memory required for installation of algorithms. Figure 16: Experimental memory of Mag_Serpent for installation. Figure 17: Memory required for installation in bytes. Figure 15: Experimental memory of Serpent for installation.