# Multibyte Electromagnetic Analysis Based on Particle Swarm Optimization Algorithm
## 5 Experimental Results  
In our experiment, we use the universal test board called Sakura-G, which is designed for research and development on hardware security to standardize the security evaluation method. Experimental platform is shown in Figure 4. We implemented the AES-128 cryptographic algorithm on the Field Programmable Gate Array (Xilinx SPARTAN-6) board with Hamming Distance leakage. The computer sent random messages to the board and the board returned ciphertexts after encryption. The electromagnetic radiation traces corresponding to random messages were measured by an oscilloscope and stored by the computer. The computer also was given an automated setup for data collection and communication. We also used a low noise amplifier to amplify the electromagnetic radiation signal because the original signal was very small. In our experiment, we focus on the nonlinear \(SubBytes\) step of the last round to recover the key. Success rate is known as an effective measure to evaluate the performance. Consequently, we use the success rate to test the performance of different parameters. Success rate is defined as:  
Figure 4: Experimental platform for Particle Swarm Optimization—Correlation Electromagnetic Analysis. \[SR=Pr\{F(K_{g})=K_{c}\}=\frac{\sum_{i=1}^{m}\{F(K_{g}[i])=K_{c}[i]\}}{m} \tag{14}\]  
where \(Pr\) is the successful probability, \(F\) is the key recovery function, \(K_{g}[i]\) is the \(i\)th byte in the guess key, \(K_{c}[i]\) is the \(i\)th byte in the correct key, and \(m\) is the byte length of key. The influence of iteration was studied and experimental results were shown in Figure 5. We perform many experiments to test the influence of iteration on the success rate. When iteration is less than 10, the success rate increased rapidly and then gradually flattened out. When the iteration is 25, we have almost recovered the secret key and reached a stable level. The result shows that, with the increasing of iterations, we achieved a higher success rate. However, if the iteration is very large, it doesn't provide any further help to recover the secret key. We also tested the influence of initial particles number, and the result was shown in Figure 6. From the figure, we know that, when the number of particles is less than 50, the success rate increases along with the number of particles until recovering the secret key correctly. Thus, we can conclude that iteration and particle number don't need to be set too large. They will increase computation time if they are very large. We compare the performance of PSO-CEMA with or without mutation operation in Figure 7. PSO-CEMA can achieve a better performance than PSO-CEMA without mutation. Figure 5: The relationship between success rate and iterations. Figure 6: The relationship between success rate and particle number. Whilst PSO-CEMA recovers the secret key with a 100% success rate, PSO-CEMA without mutation still needs more than 1000 electromagnetic traces to recover the key correctly. We also compare the performance of single byte and multiple bytes optimized by PSO to verify our method efficiency. The performance is shown in Figure 8. The experimental result shows that the success rate of multiple bytes optimized by PSO is much better than single bytes optimized by PSO. It require approximately 7000 traces for multiple bytes to achieve a 100% success rate. With the same number of electromagnetic traces, the success rate of single byte is approximately 90%. It still needs about 2000 extra traces to achieve a 100% success rate. The multibyte key performance is shown in Figure 9. If only a single byte is used, the correlation coefficient is approximately 0.05. If all 16 bytes are used, the correlation coefficient is approximately 0.25. Figure 9 demonstrates that the more bytes we have, the larger the correlation coefficient will be. There is a positive relationship between correlation coefficient and the number of right key bytes. This proves that more useful information is contained in multiple bytes. Thus, it is best if all bytes of the key are used.