## 7 Weak Authentication
Seltge++ can support all possible hash bytes with minimum possible overhead even compared with the best case of the original Seltge (Figure 10). For the original Seltge, in the best case with the highest possible hash bytes (\(|H(. )|=11\)) and having the default Seltge settings (\(NPPP=48,B=72\)), it requires 25 overhead packets, while in the same situation, Seltge++ has an overhead of only one packet. In Figure 9, an analysis on both Seltge++ and the original Seltge using different hash block lengths has shown that Seltge++ needs a very lower number of overhead packets for its initial integrity and authentication check compared to the original Seltge, which has an exponential increase in the number

Figure 9: Overhead packets using different hash block lengths (from 40-bit to 256-bit). of required packets. The disappearance of Seluge's line in this diagram shows no support for the larger block length. Figure 10 illustrates the fact that Seluge++ has full coverage of all hash algorithms with any block length, but the original Seluge support ends in a hash algorithm with a maximum block length of 11 bytes. The original Seluge has a 25 packet overhead for only a hash block length with 11 bytes, while for the same value, Seluge++ has only one byte of overhead. ### Overall Energy Consumption

As previously mentioned, the main difference between Seluge++ with Seluge is the process of sending hash values in page 0. We have analyzed this difference in different ways (e.g., security, performance). To compare the energy consumption caused by changes made on Seluge's design, the energy consumption of each component is calculated, and, then, an overall comparison is presented. Every complete propagation of the code update in both schemes consists of two phases: _Phase 1_ is the initialization process, which includes sending the hash packets of page 0; and _Phase 2_ is sending image data (data transmission). In Seluge, the overall energy cost of Phase 1 (Seluge-init) can be calculated by measuring the energy required to create the Merkle tree and sending its packets over a network. Note that the energy required for signing an authentication packet is not considered in this phase, because each scheme can choose to use different authentication mechanisms. For each node in the Merkle tree, Seluge needs to execute a hash function. Therefore, the energy required in this part is \((2^{k}-1+2^{k})\times E(SHA1)\). The energy for sending all packets caused by the Merkle tree is equal to \((O1+NP0)\times B\times E(Tx)\). For Phase 2 in Seluge (Seluge-data), we can use \(E(SHA1)\times(ImageSize/(B-|SHA1|))\) to calculate the energy required for sending all of the image data, including their hash dependency values and the energy required for creating the hash dependency. On the other side, in Phase 1 of Seluge++ (Seluge++-init), the overall energy consumption is calculated by measuring the energy required for executing the HMAC function for every packet in page 0 and transmitting these packets \((I\times E(HMAC))+(I\times B\times E(Tx))\). Additionally, an

Figure 10: Range support of Seluge and Seluge++ for a range of sequential hash block lengths. ECDH mechanism will need a specific amount of energy that has to be considered \(E(ECDH)\). The energy calculation of Phase 2 in Seltge++ (Seltge++-data) is almost the same as Seltge, but having an additional value of encrypting the whole image data (\(ImageSize/8\times E(SkipJack)\)). In summary, for computing the overall energy required for each of these schemes, the equations can be written as shown in Table 11.

Since HMAC specification in RFC-2104 shows that computing HMAC over some _data_ using a secret key (\(K\)) is defined like \(H(K\ \oplus\ opad,\ H(K\ \oplus\ ipad,\ data))\), therefore the approximate energy required for HMAC execution can be denoted as two times the energy required for its underlying hash function. As we use the SHA-1 hash function in Seltge++, therefore the energy required for HMAC (\(E(HMAC)\))) is considered to be equal to \(2\times 43.68\ \mu J=87.36\ \mu J\).