# Design of a Lightweight Cryptographic Scheme for Resource-Constrained Internet of Things Devices
## 3 Block Cipher SLA
### Permutation Layer  
The permutation layer creates a mixed 32-bit output from a 32-bit input. At the 32-bit number bit position, a 32-bit-sized bit is replaced by bit x. The diffusion function can be expressed as a bit permutation level of 1-bit words using the equations below. Appendix A contains a 32 by 32 one-to-one permutation matrix and its inverse. The permutation matrix performs the binary permutation operation in (1) as  
\[\mathrm{P_{\bar{q}}}=\mathrm{P_{\bar{i}}}\mathrm{X_{\bar{q}}} \tag{1}\]  
The reason for using a one-to-one permutation matrix is to scramble the key. The desire is to rearrange the values in the key so that it looks like someone knows the original key. In a one-to-one permutation matrix, the values of the key do not change; the values only change position. A one-to-one permutation matrix is very fast because one-to-one swapping of the position is fast. For example, if the RaspberryPi device tests a 10 \(\times\) 10 number, it takes more time to perform 10 multiplications by 10 in the microcontroller; however, a one-to-one permutation matrix is very fast. Algorithm 1 summarizes the encryption process outlined in Sections 3.1-3.3. ``` Input: Plaintext \(\mathrm{STATE_{64}}\rightarrow\mathrm{s_{63}}\mathrm{s_{6



\[[k_{63}k_{62}k_{61}k_{60}k_{59}]=[k_{63}k_{62}k_{61}k_{60}k_{59}]\bigoplus\ \ RC^{i} \tag{5}\]

For 0 to 16 rounds, five bits of the round counter i are XOR-ed with the five bits of key register KEY, i.e., from \(k_{59}\) to \(k_{63}\). 2. Scheduling of 128-bit key

The key register KEY contains the 128-bit key provided by the user, specified as \(\text{KEY}=k_{127}k_{126}\cdots k_{0}\). From the round i, 64-bit sub-keys least significant bit (LSB), \(\text{K}_{i}=k_{63}k_{62}\cdots k_{0}\) obtained in (6):

\[\text{K}^{i}=k_{63}k_{62}\cdots k_{0} \tag{6}\]

The register KEY is updated after obtaining the 64-bit key obtained in (7-10):

\[\text{KEY}<<<13; \tag{7}\]

\[[k_{3}k_{2}k_{1}k_{0}]=\text{S}[k_{3}k_{2}k_{1}k_{0}]; \tag{8}\]

\[[k_{7}k_{6}k_{5}k_{4}]=\text{S}[k_{7}k_{6}k_{5}k_{4}]; \tag{9}\]

\[[k_{63}k_{62}k_{61}k_{60}k_{59}]=[k_{63}k_{62}k_{61}k_{60}k_{59}]\bigoplus \ RC^{i}. \tag{10}\]

### The Decryption Process

The decryption process is the reverse of the encryption procedure. Each layer is reversible. The subkeys are generated in reverse order by the key schedule by using the transformation round keys. The decryption process involves the same number of rounds of encryption, where its processes are performed in each round. They are, however, the reverse of each other. In the add_round_key layer, the inverse is achieved by XORing the same round key to the block. In the S-box, and in the permutation layer, the inverse function is used in the decryption process, using the result that \(A\bigoplus A\bigoplus B=B\). ## 4 Evaluation of SLA Scheme

### Security Evaluation

1. Linear cryptanalysis

Linear cryptanalysis [25; 26] is one of the most widely used techniques for breaking block ciphers. To evaluate the difficulty of the linear cryptanalysis of the SLA scheme, we present a minimal bound on the number of so-called \"active\" S-boxes defined in a linear characteristic. Table 3 presents the linear characteristic for the SLA scheme, and Table 4 shows the minimal number of active S-boxes in the linear characteristic. **Theorem 1**. : _For sixteen rounds of SLA, it features 48 active S-boxes, and a maximum probabilistic bias linear characteristic is \(2^{-55}\)._

Theorem 1 is formally proved in Appendix C.

Walsh transform. The Walsh transform of the Boolean function \(f:\mathbb{F}_{2}^{n}\rightarrow\mathbb{R}\) with \(n-\) variables is defined as

\[a\rightarrow\varepsilon(f+\varphi_{a})=\sum_{x\in\mathbb{F}_{2}^{n}}(-1)^{f(x) +a.x} \tag{11}\]

The Walsh coefficient of \(f\) at point \(a\) is denoted by the value \(\varepsilon(f+\varphi_{a})\), and the Walsh spectrum of \(\mathbb{F}\) is denoted by the multiset consisting of all Walsh coefficients of \(f\). Walsh transform.