# Rapidly Deployable IoT Architecture with Data Security: Implementation and Experimental Evaluation
## 5 Results and Discussion  
The various encryption algorithms presented in Section 4 were implemented on both 8-bit and 32-bit microcontrollers to evaluate their impact of their respective performance on memory utilization, computation time, and energy consumption. The results obtained are presented in Tables 4 and 5 for the 32-bit microcontroller and 8-bit microcontroller, respectively. As a primary focus of this research is implementing the encryption algorithm on off-the-shelf components, and identifying a solution with minimal dependence on battery power, dedicated hardware accelerators for encryption were also considered. As AES 256 hardware accelerator was available only for the 32-bit microcontroller, its performance was compared for software implementation, in addition to lightweight encryption algorithms such as XTEA and SEA in Table 4. From this data, it is evident that AES software (AES SW) implementation is by far the most resource heavy encryption in terms of execution time, memory space and energy. The hardware-accelerated AES (AES HW), on the other hand, performed most efficiently. As presented in Figure 10(a), AES SW took the most amount of time (281.5 ms) as encrypting and decrypting the data requires several computationally demanding operations such as rotate, XOR, multiplication and substitution from lookup tables. The AES HW took the least amount of time (0.5 ms), over 500x less than that of the AES SW on the 32-bit microcontroller, as the dedicated and custom hardware is not restricted by the sequential completion of the CPU. The advantage of the hardware accelerator is also apparent in terms of memory. The AES SW on the 8-bit microcontroller takes 7538 bytes of code space and 1105 bytes of RAM. While designing low-power IoT systems, it would be impractical to dedicate such large amount of program memory for microcontrollers as they are already severely constrained, whereby many 8-bit microcontrollers do not even have the memory capacity for AES to be implemented in the software. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **AES-128** & \multicolumn{2}{c}{**AES-256**} & \multirow{2}{*}{**XTEA**} & \multirow{2}{*}{**SEA**} \\ \cline{3-3} \cline{5-6}  & & **SW** & & & \\ \hline
**Size (bytes)** & 13609 & 16251 & 1258 & 1946 & 3765 \\
**RAM (bytes)** & 2956 & 3508 & 576 & 556 & 983 \\
**Time (ms)** & 237.3 & 281.5 & 0.5 & 1.196 & 1.23 \\
**Energy (m)** & 5.2 & 6.1 & 0.0109 & 0.026 & 0.03 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performance comparisons of encryption algorithms on 32-bit microcontrollers. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Component** & **Active Current (mA)** & **Sleep Current (mA)** \\ \hline
32-bit MCU & 4 & 0.8 \\ RFM95W & 50 & 0.8 \\ ADXL345 & 0.2 & 0.01 \\
**Total** & 54.2 & 1.6 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Current consumption in fall detection system. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **AES-128** & **AES-256** & **XTEA** & **SEA** \\ \hline
**Size (bytes)** & 6368 & 7538 & 1184 & 2296 \\
**RAM (bytes)** & 986 & 1105 & 99 & 126 \\
**Time (ms)** & 62.3 & 75.62 & 1.25 & 2.3 \\
**Energy (m)** & 1.27 & 1.45 & 0.024 & 0.03 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Performance comparisons of encryption algorithms on 8-bit microcontrollers. Accordingly, alternative lightweight encryption algorithms such as XTEA and/or SEA could be utilized at the expense of a slight reduction in security. Results in Table 4 and Figure 11 show that XTEA and SEA require only 556 and 983 bytes of memory, while consuming only 0.026 and 0.03 mJ of energy, respectively, highlighting their efficiency in comparison with AES SW implementations. As the 8-bit microcontroller does not have the AES HW accelerator, AES SW was implemented and found to take 60x more cycles than XTEA as in Figure 11(a). This is also reflected in Figure 11(b) where the AES SW consumed 60x more energy than XTEA and 48x more energy than SEA.