# Efficient Secure Mechanisms for In-Vehicle Ethernet in Autonomous Vehicles
## 4 Simulation Experiment and Result Analysis
### Simulation Results of the Overall Security Mechanism  
This section details the simulation of the designed security scheme applied to the in-vehicle network, focusing on both control signal and multimedia signal security defenses. The integration of the algorithm ensures that all functions of the Ethernet system operate correctly, with reduced latency compared to traditional algorithms. To validate the system's security, various simulated attacks were conducted, including tampering, wrong command, and non-existing attacks, utilizing CANoe's built-in module functions to emulate hacker attack modes. The results of these attacks can be observed through CANoe's write window. In the absence of attack interventions, the window will display \"send successful\", indicating that the information transmission is successful, as shown in Figure 20. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Group**} & **Data Size** & **AES-128 Encryption** & **ECC Encryption** & **AES-ECC Encryption** \\  & **(Bytes)** & **Time (ms)** & **Time (ms)** & **Time (ms)** \\ \hline
1 & 100 & 243 & 300 & 360 \\
2 & 200 & 390 & 468 & 410 \\
3 & 300 & 487 & 590 & 505 \\
4 & 400 & 604 & 800 & 624 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Encryption times for AES-128, ECC, and AES-ECC algorithms. Figure 19: Encryption algorithm runtime comparison. * Control signal security defense: We conducted security testing against tampering attacks, non-existing attacks, and wrong command attacks. A tampering attack is when an attacker changes or replaces data during transmission, thus causing the receiver to receive incorrect information that may cause serious damage to the car. When the message data arrive at the receiving end, the system calculates the message digest and compares it with the received message digest. If the summaries are the same, the message is retained; if they are not, the message is discarded. When the receiver receives an error message, the write window displays an alert and requests the sender to resend the message. A deletion attack is where the attacker interferes with the normal operation of the receiving end by deleting useful messages. Since deletion attacks also need to be recognized by message digests, the write window also displays the same prompts as tampering attacks. As shown in Figure 21, for both attacks, the system displays a successful defense and asks for a re-transmission. Finally, there is the replay attack, in which the attacker repeatedly sends a piece of information in the data stream. This prevents the car from receiving the next correct information, leading to a delay in the transmission of information and adversely affecting the car's operations. When the receiver detects a replay attack, the write window displays \"send too many times\" and stops transmitting the message, as shown in Figure 22. Message <HU.can>MediaRead failed, result -1072875777 SEND too much times  
* Multimedia signal security defense: Multimedia signals, while not directly impacting vehicle control, are crucial for infotainment systems and driver assistance features. To safeguard these signals, the system is tested against deletion and replay attacks. Deletion attacks, which involve the removal of essential messages, are detected through the message digest comparison process, similar to tampering attacks. If a deletion is detected, the system requests a re-transmission, ensuring the continuity and integrity of multimedia content. If the multimedia signal defense is successful, normal video playback will occur. In the context of the in-vehicle network, the integrity and security of multimedia signals are crucial for the seamless functioning of infotainment systems and other media-related features. When the security measures in place effectively protect against potential threats such as tampering, deletion, or replay attacks, the multimedia system can reliably deliver uninterrupted and accurate content.