# DSVN: A Flexible and Secure Data-Sharing Model for VANET Based on Blockchain
## 6 Experiment and Analysis
### Experimental Simulation
#### 6.2.2 Computational Cost  
We added 50 unique attributes to the system attribute set. During the key generation phase, users with various attribute sets are randomly generated. For each user, we evaluated the cost of key generation. The average results are shown in Figure 5. We use a zip file of size 1 MB as encrypted data in the encryption phase. Then, we tested the encryption cost of the access tree with a different number of attributes. The average results are illustrated in Figure 6. In the decryption phase, we test the decryption cost using different users that satisfy the access structure, and the average results are illustrated in Figure 7. In the attribute revocation phase, we tested the overhead of revoking a single attribute to update a different number of ciphertexts and the overhead of revoking multiple attributes to update a single ciphertext. The results are illustrated in Figure 8.  
Figure 5 shows that the time overhead of key generation increases as the number of user attributes increases. To know the key generation efficiency of this scheme, we tested the schemes [23; 24; 25]. When the number of user attributes is 10, the overhead of this scheme is 24 ms, and the overheads of schemes [23; 24; 25] are 42 ms, 67 ms, and 115 ms, respectively.  
Figure 8: (**a**) Cost of single attribute revocation (**b**) Cost of multi-attribute revocation.  
Figure 6: (**a**) Cost of user encryption. (**b**) Cost of RSU encryption [23; 24].  
Figure 7: (**a**) Cost of user decryption (**b**) Cost of RSU decryption [23; 24; 25].  
When the number of user attributes reaches 50, the overhead of the scheme [25] is nearly 500 ms, while the overhead of this scheme is only 99 ms. When the number of user attributes is large, the overhead of this scheme is the smallest.  
As shown in Figure 6a, the encryption overhead at the user side of this scheme and scheme [23] is not affected by the number of attributes in the access structure. While the encryption overhead at the user side of the scheme [24] increases with the number of attributes in the access structure. The overhead of this scheme is about 2 ms, and the scheme [23] is about 4.5 ms. As shown in Figure 6b, the encryption overhead at the outer packet side of the three schemes increases with the number of attributes in the access structure. When the number of attributes of the access structure is 5, the overhead of this scheme is 21 ms, and schemes [23; 24] are 37 ms and 27 ms, respectively. When the number of attributes of the access structure reaches 50, the overhead of this scheme is 190 ms which is better than schemes [23; 24]. There is no outsourcing in the encryption phase of the scheme [25], so it is not compared here.  
As shown in Figure 7a, the decryption overhead at the user side of each scheme is not affected by the number of user attributes. The decryption overhead of this scheme is maintained at 1.8 ms, while the overheads of schemes [23; 24; 25] are 4.3 ms, 1.8 ms, and 2.1 ms, respectively. As shown in Figure 7b, the decryption overhead of each scheme increases with the number of user attributes at the outer packet side. However, the decryption overheads of each scheme are very similar. When the number of user attributes is more than 30, the decryption overhead of this scheme is slightly less than the other schemes.  
As shown in Figure 8a, when revoking a single attribute, the revocation overhead increases with the number of updated ciphertexts. As shown in Figure 8b, when the revocation of a single attribute is updated with only one cipher, the overhead revocation increases with the number of attributes. From the above results, attribute revocation is mainly affected by the number of updated ciphertexts. When the number of updated ciphertexts required for an attribute is small, the overhead of revoking a single attribute is less than 100 ms.