## 4 Application of Blockchain Technology in the Internet of Vehicles
### Authentication Algorithm  
There are several authentication algorithms: authentication based on shared key, authentication based on biological features, and public key encryption algorithm. Different authentication methods also have different security levels. This paper adopted the authentication method based on the shared key, which means that the server side and the user share one or one set of passwords. When the user requires authentication, the user submits a password that is jointly owned by the user and the server, either by entering the password or through a device that holds the password. A set of vehicles in the Internet of Vehicles are set to V, obtaining:  
\[V=\left\{V_{1},V_{2},V_{3},\ldots V_{i},V_{j}\ldots V_{n}\right\}\]  
In the above formula, any vehicle source sending a message node is represented by \(V_{j}\) (source sending message node), and \(V_{i}\) (target receiving message node) represents the target receiving the message node. After \(V_{j}\) sends a message to \(V_{i}\), \(V_{i}\) carefully verifies the integrity of the message, and then produces a series of interactive behaviors with other entities in the network [22; 23]. If the alert message issued by \(V_{j}\) is acquired by \(V_{i}\), then \(V\) sends out the collected messages. The information is sent to the nearest roadside unit (RSU) in the communication range, and the RSU must identify the information and determine whether the information is legal. After the data package sent by \(V_{i}\) is received by RSU, the first step in judging the message's credibility is make an accurate judgment of whether \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Event ID** & **Event Type** & \
\begin{tabular}{c} **TTL**\({}_{\text{Event}}\) **(Lifecycle of** \\ **the Warning Message)** \\ \end{tabular} &
\begin{tabular}{c} **Ran\({}_{\text{msg}}\) **(Transmission** \\ **Range of the Alert Message)** \\ \end{tabular} \\ \hline I & Traffic congestion & Th\({}_{\text{I-I}}\) & Th\({}_{\text{d-I}}\) \\ II & Traffic accident & Th\({}_{\text{II-II}}\) & Th\({}_{\text{d-II}}\) \\ III & Road construction & Th\({}_{\text{III-III}}\) & Th\({}_{\text{d-III}}\) \\ IV & Road icing & Th\({}_{\text{t-IV}}\) & Th\({}_{\text{d-IV}}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Warning message report form. Figure 1: Schematic structure diagram. \(V_{i}\) has a legal identity [24; 25; 26; 27; 28; 29]. When combined with CA (authentication center in the network), the detailed authentication verification process is as follows:  
Step 1. For the RSU within the vehicle communication range, vehicle \(V_{i}\) transmits the request, based on which the message received from vehicle \(V_{j}\) is recognized [30]. Step 2. After the RSU receives the request, a pseudonym containing vehicle \(V_{i}\) is sent with a PID\({}_{v}\) instead. A random number (\(L\)) is reported to the nearest surrounding CA for authentication. \(L\) is randomly produced by a linear congruence generator (LCG). The LCG calculation is described as follows [30]:  
\[\left[ \begin{array}{l}L_{0}=\text{d}\\ L_{t+1}=(A\times L_{r}+Z)\text{mod}(M)\end{array} \right.\]  
In this formula, d represents the seed value, the current system time is its set initial value, the increment value is \(Z\), multiplier is \(A\), modulus size is \(M\), and \(Z\) and \(M\) are prime. Generally, \(M\) will take the power square of 2. Step 3. If the CA receives information from the RSU, the RSU will conduct a traceability search of the real situation of vehicle \(V_{1}\) using vehicle mapping, according to the pseudonym of vehicle \(V_{i}\) in the first step, and obtain the real vehicle identity information accordingly. An audit result (report) is produced after the search. In the audit results, if the false vehicle information is backed up in the results, then vehicle \(V_{1}\) is legal; if there is no record, then vehicle \(V_{i}\) is an illegal vehicle. Then, a random key, L, is encrypted using a private key (PR\({}_{\text{CA}}\)) to generate a session key \(K_{n}\).