# Securing IoT Devices against Differential-Linear (DL) Attack Used on Serpent Algorithm
## 4 Research Methodology
Generally, if an S-Box has N-bits of inputs and M-bits of output, then its _DLCT_ when constructed will be a 2\({}^{N}\)\(\times\) 2\({}^{M}\) matrix. Hence, the _DLCT_ of the first S-Box of Serpent, defined in Table 1, was said to be 24\({}^{\prime}\)\(\times\) 24. 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 [PERSON] et al. [6] and [PERSON] 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, Tables 1-8 were replaced with Tables 10-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. Figure 4: Schematic diagram of research methodology. \begin{table}
\begin{tabular}{c c c} \hline \hline \(X\) & \(S_{\mathbf{0}}(X)\) & \(InvS_{\mathbf{0}}(X)\) \\ \hline
0 & 411264f80 & 411264f80 \\
1 & 91377 da1f & 10 fc22f87 \\
2 & 1016b6c664 & 7128a6f79 \\
3 & 21038e4 da & e15c964 be \\
4 & 1b46544c5 & a13 ee8f72 \\
5 & 7128a6f79 & f16401a11 \\
6 & 61213 ba26 & 1016b6c64 \\
7 & c14 dbfa18 & 91377 da1f \\
8 & f16401a11 & 61213 ba26 \\
9 & e15c964 be & d1552 afb \\ A & 5119d04d3 & c14 dbfa18 \\ B & 31049a2d & 8130124 cc \\ C & 8130124 cc & b146544c5 \\ D & 10 fc22f87 & 21038e4 da \\ E & a13 ee8f72 & 5119d04d3 \\ F & d1552 af6b & 310a79a2d \\ \hline \hline \end{tabular}
\end{table} 
Table 10: New generated 32-bit output S-Box to replace Table 1. \begin{table}
\begin{tabular}{c c c} \hline \hline \(X\) & \(S_{\mathbf{1}}(X)\) & \(InvS_{\mathbf{1}}(X)\) \\ \hline
0 & 1016b6c664 & 1016b6c64 \\
1 & d1552 af6b & b146544c5 \\
2 & 310a79a2d & 21038e4 da \\
3 & 8130124 cc & e15c964 be \\
4 & a13 ee8672 & 61213 ba26 \\
5 & 10 fc22f87 & 411264f80 \\
6 & 61213 ba26 & 7128a6f79 \\
7 & b146544c5 & 10 fc22f87 \\
8 & 21038e4 da & 5119d04d3 \\
9 & c14 dbfa18 & a13 ee8f72 \\ A & f16401a11 & f16401a11 \\ B & b146544c5 & e15c964 be \\
7 & 1016b6c664 & f16401a11 \\
8 & e15c964 be & c14 dbfa18 \\
9 & 21038e4 da & 7128a6f79 \\ A & f16401a11 & 61213 ba26 \\ B & 5119d04d3 & 411264f80 \\ C & 10 fc22f87 & 8130124 cc \\ D & c14 dbfa18 & d1552 af6b \\ E & 61213 ba26 & b146544c5 \\ F & 310a79a2d & 10 fc22f87 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: New generated 32-bit output S-Box to replace Table 2.  
\begin{table}
\begin{tabular}{c c c} \hline \hline \(X\) & \(S_{\mathbf{2}}(X)\) & \(InvS_{\mathbf{2}}(X)\) \\ \hline
0 & 91377 da1f & 91377 da1f \\
1 & 7128a6f79 & 1016b6c664 \\
2 & 8130124 cc & 310a79a2d \\
3 & a13 ee8f72 & a13 ee8f72 \\
4 & 411264f80 & 5119d04d3 \\
5 & d1552 af6b & 21038e4 da \\
6 & b146544c5 & e15c964 be \\
7 & 1016b6c664 & \begin{table}
\begin{tabular}{c c c} \hline \hline \(X\) & \(S_{\mathbf{3}}(X)\) & \(InvS_{\mathbf{3}}(X)\) \\ \hline
0 & 1016b6 cf64 & 1552 af6b \\
1 & 61213 ba26 & a13 ee8f72 \\
2 & 310a9a2d & 1016b6 cf64 \\
3 & c14 dbfa18 & 5119d0d43 \\
4 & 5119d04d3 & c14 dbfa18 \\
5 & b146544c5 & f1640111 \\
6 & a13 ee8f72 & 21038e4 da \\
7 & d1552 af6b & 310 af9a2d \\
8 & 10 fc22f87 & 10 fc22f87 \\
9 & 41126480 & 411264f80 \\ A & f16401a11 & 7128 af679 \\ B & 91377d1 af1 & e155964 be \\ C & e15c964 be & 61213 ba26 \\ D & 7128a6f79 & 91377d1 af \\ E & 8130124 cc & b146544c5 \\ F & f16401a11 & 21038e4 da \\ \hline \hline \end{tabular}
\end{table} 
Table 13: New generated 32-bit output S-Box to replace Table 4.