# SIMECK-T: An Ultra-Lightweight Encryption Scheme for Resource-Constrained Devices
## 2 Methodology
### Implementation
```
Input: Data array data of length len, key array key Output: Hash array hash with two 32-bit values
1\(\text{Pt}\leftarrow\{0,0\}\) ; // Initialize plaintext block
2\(\text{Ct}\leftarrow\{0,0\}\) ; // Initialize ciphertext block
3\(\text{K1},\text{K2}\leftarrow{0,0}\) ; // Initialize hash values
4 for\(i\gets 0\)to len \(-1\)do
5\(\text{Pt}[i\bmod 2]\leftarrow\text{Pt}[i\bmod 2]\oplus\left(\text{uint32}(data[i])\ll((i \bmod 2)\times 8)\right)\) ;
6 if\((i+1)\bmod 2=0\)then
7\(\text{simeckTeaECB}(\text{key},\text{Pt},\text{Ct})\) ; // Encrypt Pt using SIMECK-T
8\(\text{K1}\gets\text{K1}\oplus\text{Ct}[0]\) ;
9\(\text{K2}\leftarrow\text{K2}\oplus\text{Ct}[1]\) ;
10\(\text{Pt}\leftarrow\{0,0\}\) ; // Reset plaintext block
11 iflen mod \(2\
eq 0\)then
12\(\text{simeckTeaECB}(\text{key},\text{Pt},\text{Ct})\) ;
13\(\text{K1}\leftarrow\text{K1}\oplus\text{Ct}[0]\) ;
14\(\text{K2}\leftarrow\text{K2}\oplus\text{Ct}[1]\) ;
15 for\(j\gets 0\)to 15 do
16\(\text{K1}\leftarrow\text{K1}+\left((\text{K2}\wedge 3)\times 0\pi e3779b9 \right)\oplus\left((\text{K2}\gg 5)+0\pi e3779b9\right)\) ;
17\(\text{K2}\leftarrow\text{K2}+\left((\text{K1}\wedge 3)\times 0\pi e3779b9 \right)\oplus\left((\text{K1}\gg 5)+0\pi e3779b9\right)\) ;
18\(hash[0]\leftarrow\text{K1}\);
19\(hash[1]\leftarrow\text{K2}\);
```  
**Algorithm 3**MDC-2 Hash Function using SIMECK-T Cipher for Encryption  
```
Input: Password password with length password_len, Salt array salt with length salt_len, Number of iterations iterations iterations Output: Derived key array key
1\(\text{result}\leftarrow\{0,0\}\) ; // Initialize result hash values
2\(\text{temp}\leftarrow\{0,0\}\) ; // Temporary hash storage
3\(\text{temp}\_\text{buffer}\leftarrow\text{array of size 4}+\text{salt\_len}+4\) ; // Buffer for data preparation
4 for\(i\gets 1\)toiterationsdo // Prepare data for hash computation
5\(\text{memcpy}(\text{temp}\_\text{buffer},\&i,\text{sizeof}(\text{uint32\_t}))\) ; // Copy block index
6\(\text{memcpy}(\text{temp}\_\text{buffer}+\text{sizeof}(\text{uint32\_t}), \text{salt},\text{salt\_len})\) ; // Copy salt
7\(\text{memcpy}(\text{temp}\_\text{buffer}+\text{sizeof}(\text{uint32\_t})+ \text{salt\_len},\&i,\text{sizeof}(\text{uint32\_t}))\) ; // Copy block index again // Perform hash computation
8\(\text{MDC2\_Hash}(\text{temp}\_\text{buffer},\text{sizeof}(\text{TempBuffer}), \text{temp},(\text{const uint32\_t})\)password) ; // XOR result with temporary hash
9 result [0]\(\leftarrow\)result [0]\(\oplus\)temp [0] ;
10\(\text{result}\)[1]\(\leftarrow\)result [1]\(\oplus\)temp [1] ; // Copy the result to the derived key
11\(\text{memcpy}(\text{key},\text{result},2\times\text{sizeof}(\text{uint32\_t}))\) ;
```  
**Algorithm 4**PBKDF2 Key Derivation using MDC-2 based on SIMECK-T  
```
Input: Data array data of length len, key array key Output: Hash array hash with two 32-bit values
1\(\text{Pt}\leftarrow\{0,0\}\) ; // Initialize plaintext block
2\(\text{Ct}\leftarrow\{0,0\}\) ; // Initialize ciphertext block
3\(\text{K1},\text{K2}\leftarrow\{0,0\}\) ; // Initialize hash values
4 for\(i\gets 0\)to len \(-1\)do
5\(\text{Pt}[i\bmod 2]\leftarrow\text{Pt}[i\bmod 2]\oplus\left(\text{uint32}(data[i])\ll((i \bmod 2)\times 8)\right)\) ;
6 if

## 3 Encryption Evaluation

This section thoroughly presents the theoretical setup to evaluate the security of the encryption system. The randomness of the encrypted output produced by the proposed algorithm is assessed using standardized statistical tests. The cipher strength is also evaluated using cryptanalysis and statistical evaluation metrics. ### Randomness of the Output

In order to compare the new ciphers with different numbers of rounds, the National Institute of Standards and Technology (NIST) Statistical Test Suite [24; 71] and the AIS.31 [25; 26; 72] standard tests are used. The best cipher is selected and compared with the proposed SIMECK-T algorithm and against the TErrestrial Trunked RAdio (TETRA) TEA3 cipher [32], which produces random output when only four rounds are used.