## 3 System Model
### Join the Network
\[g^{Prk_{jn_{i}}}=\prod_{j=1}^{l}w_{j}^{ID_{i}^{j}}\ mod\ p\] (10) Step 8: If verification is successful, JV adds all the partial secret to calculate its private key \(ID_{jvprk}\) using Equation (11). \[ID_{jvprk}=Prk_{jn_{0}}+Prk_{jn_{1}}+\ldots+Prk_{jn_{i_{i}}}\] (11)After successfully joining the V2X network, the vehicle computes its private key for this network using Equation (11). In addition, it can calculate the public key (\(Pk_{ov}\)) of any other vehicle (OV) in the V2X network by using OV's Id. The network information as shown in Equation (12). \[Pk_{ov}=\sum_{k=0}^{d}\ (\ \prod_{j=1}^{t}w_{k_{j}}^{ID_{ov}^{i}}\bmod p\ ) \tag{12}\]

### Key Establishment

Any two entities joined to the V2X network can establish a shared key (Session Key), which can then be used with any symmetric encryption algorithm. Suppose A and B want to establish a session key. Given that A knows about the unique id of B (\(ID_{b}\)), it calculates the public key of B (\(Pk_{b}\)). Given that B knows about unique id of A (\(ID_{a}\)), it calculates the public key of A (\(Pk_{a}\)). Then, A calculates session key (\(S_{ab}\)) using Equation (13), and B also calculates the session key (\(S_{ba}\)) using Equation (14). Here, \(pri_{a}\) and \(pri_{b}\) represent the partial secret shares of A and B, respectively. \[S_{ab}=Pk_{b}{}^{Pri_{a}}=g^{Pri_{b}.Pri_{a}}\bmod p \tag{13}\]

\[S_{ba}=Pk_{a}{}^{Pri_{b}}=g^{Pri_{a}.Pri_{b}}\bmod p \tag{14}\]

From this, we confirm \(S_{ab}=S_{ba}\). Hence, given two entities, the shared key or session key can be established without any interaction. On the other hand, a broadcast encryption scheme requires a key which the broadcaster and all receiving vehicles can compute. Assume that vehicle J wants to broadcast a message. The message can be received by any other vehicle or RSU within the wireless range. In our broadcast encryption scheme, the message is encrypted using its private key (\(Prk_{j}\)). Then, any legitimate entity could compute the corresponding public key \(Pk_{j}\) using network information already received when joining the network. This allows any message broadcast from a legitimate entity to be decrypted by any other legitimate entity. In practice, a random session key (\(PS_{j}\)) was generated to improve the scheme's efficiency, and the message was encrypted using the AES algorithm with the \(PS_{j}\) as an encryption key. Then, the \(PS_{j}\) will be encrypted using the ElGalm

Figure 3: Join the network. with \({\it Prk}_{j}\) as encryption key. Once an entity receives an encrypted message, the decryption key (\({\it DK}_{j}\)) is calculated in Equation (15) as follows. \[{\it DK}_{j}=\prod_{i=1}^{t}w_{i}^{UID_{j}^{i}}\bmod p \tag{15}\]

A potential drawback of this approach is that if a legitimate entity is compromised, an intruder can retrieve network information through that entity. The intruder would be able to eavesdrop on every broadcast message. However, it will not be able to act as a legitimate entity and send messages since it did not receive a partial secret from the V2X network. Hence any message encrypted by the intruder will not be able to be decrypted by legitimate entity. ## 4 Simulator Design, Performance Evaluation and Results

As discussed in the system model, our proposed V2X network required cloud servers and computation, a 5G network, static RSU with ad hoc Wi-Fi, and moving vehicles with 5G/Wi-Fi ad hoc access. Building a simulator for all of them is complicated and time-consuming. Additionally, our proposed changes are only at RSU, vehicle and cloud-based servers. Therefore, we decided to set up our simulator as a hybrid system: the cloud platform and 5G network parts use the actual implementation, and RSU and Vehicles are in simulated environments. The system architecture of the proposed system is shown in Figure 4 and described in the next subsection. ### System Architecture

The NS-3 simulator is a network simulator used primarily for research and education in Wi-Fi, LTE, and 5G.