# Efficient Secure Mechanisms for In-Vehicle Ethernet in Autonomous Vehicles
## 3 Automotive Ethernet Security Protocol
### Design of Data Encryption and Authentication Algorithms for In-Vehicle Multimedia Signals
#### 3.2.1 Improved AES-128 Encryption Algorithm Design (IAES-128)  
Before introducing the improved AES-128 encryption algorithm, it is important to understand the basics of the traditional AES-128 algorithm. AES-128 is a symmetric key encryption technique that operates on a 128-bit block of data with a key length of 128 bits. It consists of several rounds of transformations, including byte substitution (SubBytes), row shifting (ShiftRows), column mixing (MixColumns), and round key addition (AddRound-Key). Each round contributes to the diffusion and confusion properties that enhance the security of the encrypted data, as illustrated in Figure 4 on the left, which shows the four processes of the traditional AES-128. Figure 3: General framework diagram of in-vehicle Ethernet network security. In an in-vehicle environment, encryption and decryption operations can be resource-intensive, potentially adding to the computational burden of the in-vehicle system. Therefore, ensuring that these processes are fast enough is crucial to prevent communication delays and maintain communication efficiency [36]. The traditional AES-128 encryption algorithm comprises nine rounds of complete transformations, including byte substitution, row shift transformation, column confusion transformation, and round key addition transformation. The computational complexity of these operations, particularly in resource-constrained automotive systems, can lead to latency issues that are detrimental to real-time communication [37]. To address these challenges, the IAES-128 encryption algorithm proposed in this paper aims to enhance algorithm efficiency by simplifying the encryption process. This is achieved by consolidating the row shift (ShiftRows) and column confusion (MixColumns) transformations of the traditional encryption algorithm into a single step known as the row-column transform, as shown in Figure 4 on the right. This optimization reduces the number of computational steps required for each round of encryption, which could potentially decrease the overall encryption and decryption time. By streamlining these steps, the improved algorithm not only enhances encryption efficiency but also maintains the security of encryption. This makes it more suitable for high-speed real-time data transmission applications in in-vehicle Ethernet networks, where rapid and secure communication is paramount. The right side of Figure 4 illustrates the improved algorithm, highlighting the changes made to the ShiftRows and MixColumns steps, while no improvements have been made to the SubBytes and AddRoundKey steps, ensuring that the core security features of the original AES-128 algorithm are preserved. We have made no improvements to the SubBytes step and the AddRoundKey step, and the following descriptions are only for the ShiftRows and MixColumns:  
The state of the matrix \(S\) after SubBytes step is  
\[S= \begin{pmatrix}S_{00}&S_{01}&S_{02}&S_{03}\\ S_{10}&S_{11}&S_{12}&S_{13}\\ S_{20}&S_{21}&S_{22}&S_{23}\\ S_{30}&S_{31}&S_{32}&S_{33}\end{pmatrix}  \tag{1}\]  
Then, we conduct a row-column transformation, which integrates the ShiftRows and the MixColumns into a single step. First, we multiply the \(S\) matrix by a fixed matrix to obtain \(S^{\prime}\), as shown in Equation (2). Figure 4: Rotation optimization flow chart. \[S^{\prime}= \begin{pmatrix}{S_{00}}^{\prime}&{S_{01}}^{\prime}&{S_{02}}^{\prime}&{ S_{03}}^{\prime}\\ {S_{10}}^{\prime}&{S_{11}}^{\prime}&{S_{12}}^{\prime}&{S_{13}}^{\prime}\\ {S_{20}}^{\prime}&{S_{21}}^{\prime}&{S_{22}}^{\prime}&{S_{23}}^{\prime}\\ {S_{30}}^{\prime}&{S_{31}}^{\prime}&{S_{32}}^{\prime}&{S_{33}}^{\prime}\\ \end{pmatrix} = \begin{pmatrix}2&1&3&1\\ 1&2&1&3\\ 3&1&2&1\\ 1&3&1&2\\ \end{pmatrix} \times \begin{pmatrix}{S_{00}}&{S_{01}}&{S_{02}}&{S_{03}}\\ {S_{11}}&{S_{12}}&{S_{13}}&{S_{10}}\\ {S_{22}}&{S_{23}}&{S_{20}}&{S_{21}}\\ {S_{33}}&{S_{30}}&{S_{31}}&{S_{32}}\\ \end{pmatrix}  \tag{2}\]  
The result after multiplication is as shown in Equation (3).