# Analysis of Lightweight Cryptographic Algorithms on IoT Hardware Platform +
## 3 Method and Experimental Setup
### Measuring Concepts and Metrics  
Measurements for lightweight cryptography study were gathered depending on related works and other similar research studies that analyzed and compared lightweight cryptography ciphers. These measuring concepts and their metrics are summarized in Table 3.  
Below is the briefing and the equations used in Table 3:  
\begin{tabular}{l l l}
1. & Arduino IDE is used during the uploading phase of C codes onto Arduino Board to measure: \\  & * ROM occupation: by observing \"program storage space\" where the Arduino sketch is stored. \\  & * RAM occupation: by observing the unused space for local variables, then the used space would indicate the \"global variable\" of dynamic memory that is the SRAM (static random-access memory), which is where the sketch creates and manipulates variables when it runs.  
\begin{table}
\begin{tabular}{l l l l} \hline \hline
**Measurement** & **Metrics (in)** & **Tool of Measuring for Arduino** & **Tool of Measuring for Raspberry Pi** \\ \hline Key size & bits & Algorithm specs & Algorithm specs \\ \hline Block size & bits & Algorithm specs & Algorithm specs \\ \hline \multirow{2}{*}{Rounds number} & number of & \multirow{2}{*}{Algorithm specs} & \multirow{2}{*}{Algorithm specs} \\  & rounds & & \\ \hline ROM occupation & bits or bytes & Arduino IDE & Size command \\ \hline RAM occupation & bits or bytes & Arduino IDE & Valgrind \\ \hline Code size & Kbytes & Size occupied on memory & Size occupied on memory \\ \hline Encryption (ENC) or & \multirow{2}{*}{Bytes/s} & Programming + & Programming + \\ decryption (DEC) & & Equation (1) & Equation (1) \\ speed throughput & & & \\ \hline ENC or DEC & \multirow{2}{*}{cycle/Block} & Programming + & Programming + \\ speed latency & & Equation (3) & Equation (3) \\ \hline Key schedule & \multirow{2}{*}{Bytes/s} & Programming + & Programming + \\ speed throughput & & Equation (2) & Equation (2) \\ \hline Key schedule & \multirow{2}{*}{cycle/Block} & Programming + & Programming + \\ speed latency & & Equation (4) & Equation (4) \\ \hline ENC or DEC & \multirow{2}{*}{joules/s} & Current (power) sensor & Current (power) sensor \\ power (throughput) & & & \\ \hline ENC or DEC & \multirow{2}{*}{joules/bit} & Current (power) sensor + & Current (power) sensor + \\ energy (latency) & & Equation (7) & Equation (7) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Measurement of LWC and their metrics.  
2. Encryption and decryption speed throughput are measured in bytes/s in both platforms through programming loops and Equation (1). \[\frac{Ps}{\tau}(\text{bytes/s})\] (1) \(Ps\) is the size of text in ENC or DEC in bits. \(\tau\) is the time taken during one ENC or DEC. 3. Key schedule speed throughput concerning key expansion and Equation (2). \[\frac{Ks}{\tau}(\text{bytes/s})\] (2) \(Ks\) is the size of text in expanded key in bits. 4. ENC and DEC speed latency are measured in B/s (cycles/block) by using speed throughput Equation (2): \[\frac{f}{(1)/Bs}(Cycles/Block)=\frac{f*Bs*\tau}{Ps}(Cycles/Block)\] (3) \(f\) is the processor frequency in hertz. \(Bs\) is the block size of the algorithm in bytes. 5. Key scheduling speed latency derived from Equation (2): \[\frac{f*K*\tau}{Ks}(Cycles/Block)\] (4) \(K\) is key size of the algorithm in bytes. 6. ENC and DEC power (throughput) measured in joules/s (j/s) by using a current sensor (power sensor). 7. ENC and DEC energy (power **latency**) in joules/bit is measured by using energy throughput and speed throughput as: \[\frac{ETh(j/s)}{(1)*8}(Jouls/bit)=\frac{ETh*\tau}{Ps*8}(Jouls/bit)\] (5) \(ETh\) is energy throughput in j/s of ENC and DEC.