## 5 Experimental Results
### SCA Results with Different Key Replacement Frequencies  
In this study, a wireless loop antenna was employed to receive characteristic signals, SCAs were executed on an Arduino UNO microcontroller, and electromagnetic signals were captured under the experimental conditions depicted in Figure 9. Correlation analysis was utilized to assess the efficacy of the attack in compromising the cryptographic keys. Figure 12a presents the results of an SCA executed on the microcontroller during AES encryption, without any protective countermeasures in place. The x-axis represents the number of data traces required to carry out the attack, while the y-axis indicates the number of successfully recovered key bytes. Our findings reveal that, without protection, an attacker can fully recover all 16 subkeys of the AES-128 encryption algorithm with just approximately 55 traces.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**D-H Key Exchange Frequency** & **Every 1 Message** & **Every 1 Messages** & **Every 30 Messages** \\ \hline Total time for transmitting 3000 encrypted messages (ms) & 150,995 & 69,011 & 45,415 & 36,969 \\ Average time per message (ms) & 50 & 23 & 15 & 12 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Time efficiency comparison of different key replacement frequencies.  
To further evaluate the efficacy of the proposed dynamic key replacement mechanism, we executed SCAs at various intervals of encryption operations, modifying the encryption key at different frequencies. The results as shown in Figure 11(b)-e illustrate a significant reduction in the effectiveness of the SCAs as the frequency of key replacement increases. Table 6 summarizes these findings, underscoring the impact that key replacement frequency has on an attacker's ability to compromise the encryption keys.  
Figure 11(a): without any protection.  
Figure 11(b): when the key was replaced every 50 encryption operations, the attacker was able to successfully retrieve 12 subkeys.  
Figure 11(c): at a replacement interval of 30 encryption operations, only eight subkeys were compromised.  
Figure 11(d): reducing the key replacement interval to 10 encryption operations resulted in only two compromised subkeys.  
Figure 11(e): SCAs results of AES encryption with different key replacements.  
These results clearly demonstrate the inverse relationship between key replacement frequency and the success rate of SCAs. The more frequently the encryption key is replaced, the more difficult it becomes for the attacker to successfully compromise the cryptographic keys. Notably, the strategies of replacing the key after every one and ten encryption operations proved particularly effective in thwarting template attacks, which are often capable of breaching encryption with minimal traces.  
As reported by [PERSON] et al. (2018), deep learning and template attack techniques can allow attackers to recover encryption keys using only a small number of traces. However, the high-frequency key replacement mechanism proposed in this study has substantially reduced the number of subkeys that could be successfully retrieved by such attacks. The results provide compelling evidence that the dynamic key replacement mechanism significantly enhances the security of IoT devices, bolstering their resistance to SCAs and ensuring robust protection of sensitive data.