# Efficient Secure Mechanisms for In-Vehicle Ethernet in Autonomous Vehicles
## 4 Simulation Experiment and Result Analysis
### Performance Analysis of Data Encryption and Authentication Algorithms  
1. IAES-128 algorithm simulation result:  
The efficiency of the IAES-128 algorithm is analyzed by comparing its plaintext encryption rate with that of the traditional AES-128 algorithm. Four sets of Ethernet message data of varying sizes are selected for testing. The encryption times of both the traditional and IAES-128 algorithms are compared by running the program in the same environment. Each set of data is encrypted 5000 times to obtain an average encryption time, as depicted in Figure 17.  
The analysis of the experimental data shows that the improved IAES-128 algorithm is approximately 15.77% more efficient in plaintext encryption than the traditional AES-128 algorithm, as presented in Table 1. This improvement is evident in the enhanced efficiency of the AES algorithm, making it suitable for meeting the real-time requirements of in-vehicle Ethernet communication. Additionally, the AES-128 algorithm, when attacked by an exhaustive search, needs to handle 2128 possible keys, which is impractical given that in-vehicle information changes every second. Thus, the security of in-vehicle multimedia information can be effectively ensured by using the AES algorithm. 2. IMD5 algorithm simulation result:  
The performance and security enhancements of the IMD5 algorithm, an improved version of the MD5 algorithm, were analyzed through a series of avalanche effect experiments. The IMD5 algorithm incorporates advancements in the generation of the word for the iterative formula and the operation of two nonlinear functions, which are designed to enhance the security of the hash function. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Group**} & **Data Size** & **AES-128 Encryption** & **IAES-128 Encryption** & **Efficiency** \\  & **(Bytes)** & **Time (ms)** & **Time (ms)** & **Improvement** \\ \hline
1 & 100 & 293 & 240 & 18.12\% \\
2 & 500 & 473 & 376 & 20.53\% \\
3 & 1000 & 613 & 536 & 12.56\% \\
4 & 2000 & 759 & 664 & 11.88\% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Encryption times for AES-128 and IAES-128 algorithms. Figure 16: Trace of tampering attacks and malicious module attack results. Figure 17: Encryption algorithm runtime comparison with AES and IAES. The graphical representation in Figure 18 has been enhanced to include a scatter plot that illustrates the SAC ratio for each of the 1000 experiments conducted on the IMD5 algorithm. Each dot in the scatter plot represents the SAC ratio for a single experiment. The plot clearly shows the distribution of the SAC ratios, with the majority of points falling within the acceptable range of 0.4 to 0.6, indicating a strong avalanche effect. The experimental results demonstrate that the IMD5 algorithm maintains a robust avalanche effect, with a minimal number of bad points. This indicates that the IMD5 algorithm is effective in producing a significant change in the hash value in response to a single bit change in the input message, thereby enhancing the security of the hash function against pattern detection and potential compromises. By presenting these results in both tabular and graphical formats, this paper provides a clear and comprehensive comparison of the MD5 and IMD5 algorithms, highlighting the improvements in security and performance achieved by the IMD5 algorithm. The traditional MD5 algorithm has a bad point rate of 3.5%. Through 1000 experiments, it can be concluded that the improved MD5 algorithm has a bad point rate of 3.2%. This rate is less than 5% and lower than that of the traditional MD5 algorithm, demonstrating that the improved algorithm is safe and reliable. A significant improvement in the IMD5 algorithm is the reduction in the size of the hash value that requires authentication. While the traditional MD5 algorithm uses a 128-bit hash value, the IMD5 algorithm utilizes a 64-bit hash value. This reduction halves the number of bits that need to be authenticated, leading to a substantial decrease in authentication time.