# Virtual Pseudonym-Changing and Dynamic Grouping Policy for Privacy Preservation in VANETs
## 4 Proposed Solution
### Vehicle Grouping  
Once a GH has been selected, its identity is verified with the help of the certificate provided at the time of registration. The selection of GH vehicle detail is given in Algorithm 2. The GH-selection notification and group communication are shown with the help of Figure 5. The GH selection is announced in the vicinity, and the transmission range vehicles request to GH to join the group. Before joining the group, GH authenticates vehicles through a signature scheme (certificates assigned to vehicles by TA). GH prohibits the joining of any vehicle with an invalid certificate. In this way, vehicles with malicious intent could not join the group. A group identity (\(G_{ID}\)) is created and distributed through the group. All the communication in the group is verified with \(G_{ID}\). The GH informs the members of the group about the pseudonym change process. For this purpose, a flag is set to 1, which means ready for pseudonym change. When all the group members change pseudonyms, and the flag is set to 0, the pseudonym is changed successfully. The detail of the vehicle group formation protocol is given in Algorithm 3. First, the vehicles in the transmission range identified. Next, the signature verification process is started for vehicles joining in the group. Out of range vehicles will not take part in the group formation and communication process.  
Figure 4: The block diagram of the proposed scheme.  
```
1:\(V_{i}\): Any vehicle \(i\) moving on the road, \(GH\): Group Head, \(T_{x}\): Transmission range, \(G_{ID}\): Group identification, \(VL_{R}\): Vehicle velocity range, \(D\): Direction, \(PseudoExpiry(V_{i})\): Vehicle pseudo \(id\) expiration, \(Verification(GH)\): Verification of group head, \(NeighvehicleRange(i)\): Neighbor vehicle \(i\) is in transmission range, \(Sign(V_{i})\): Signature of vehicle \(i\), \(Valid(\mathbb{C})\): Certificate validity, Group \((V_{i})\): Grouping of vehicle \(i\), Discard-joining \((V_{i})\): Discard-joining of vehicle \(i\) in the group
2:\(VL_{R}\), \(T_{x}\), \(D\)
3:Group formation and communication process
4:for all\(V_{i}=1\to n\)do
5: Check \(PseudoExpiry(V_{i})\)
6:\(GroupHead()\)
7: Set flag to 1
8:\(Verification(GH)\)
9:\(NeighborFunction()\)
10:for each\(Vehicle(i)\in VL_{R}\)do
11:if\(NeighborvehicleRange(i)\leq T_{x}\)then
12: Process of authentication
13:if\(Sign(V_{i})\in Valid(\mathbb{C})\)then
14:\(GH\) allows joining \(V_{i}\)
15:\(GH\) distribute \(G_{ID}\) to \(V_{i}\)
16: Group \((V_{i})\)
17:else
18: Invalid-certificate
19: Discard-joining \((V_{i})\)
20:endif
21:else
22: Out of range
23:endif
24:endfor
25: Return (Members)
26:Ready for Pseudonym change process
27:endfor
```  
**Algorithm 2** Group Head Selection  
**Initialization**: \(Vehicle(i)\): Any vehicle on the road, \(PseudoExpiry(i)\):Pseudonym expiration of vehicle \(i\), \(GH\): Group Head, \(SendGHselction(i)\): Send vehicle \(i\) to TA for GH selection  
**Input**: Vehicle pseudonym  
**Output**: Selection of \(GH\)  
**Algorithm 3** Vehicle Grouping  
**Initialization**: \(V_{i}\): Any vehicle \(i\) moving on the road, \(GH\): Group Head, \(T_{x}\): Transmission range, \(G_{ID}\): Group identification, \(VL_{R}\): Vehicle velocity range, \(D\): Direction, \(PseudoExpiry(V_{i})\): Vehicle pseudo \(id\) expiration, \(Verification(GH)\): Verification of group head, \(NeighvehicleRange(i)\): Neighbor vehicle \(i\) is in transmission range, \(Sign(V_{i})\): Signature of vehicle \(i\), \(Valid(\mathbb{C})\): Certificate validity, Group \((V_{i})\): Grouping of vehicle \(i\), Discard-joining \((V_{i})\): Discard-joining of vehicle \(i\) in the group  
**Input**: \(VL_{R}\), \(T_{x}\), \(D\)  
**Output**: Group formation and communication process