# PetroBlock: A Blockchain-Based Payment Mechanism for Fueling Smart Vehicles
## 5 Performance Evaluation
### Security Analysis  
We analyze the security of PetroBlock against the following attacks:  
Figure 16: Latency in query transaction.  
Figure 15: Latency in invoke transaction.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Type** & **Name** & **CPU (max)** & **CPU (avg)** & **Memory (max)** & **Memory (avg)** & **Traffic In** & **Traffic Out** \\ \hline Process & local-client.js & 14.64\% & 8.76\% & 105.2 MB & 90.5 MB & - & - \\ Docker & peer1.pump1.com & 12.44\% & 5.59\% & 106.6 MB & 98.5 MB & 1 MB & 421.3 KB \\ Docker & peer0.pump2.com & 17.09\% & 6.24\% & 105.7 MB & 96.7 MB & 1.6 MB & 666.7 KB \\ Docker & peer0.pump1.com & 15.02\% & 4.56\% & 89.5 MB & 82.3 MB & 697 KB & 287.6 KB \\ Docker & peer1.pump2.com & 0.00\% & 6.54\% & 112.8 MB & 105.8 MB & 819 B & 0 B \\ Docker & order.com & 14.95\% & 6.75\% & 93.6 MB & 88.7 MB & 5 MB & 5.6 MB \\ Docker & ca\_nodeDepartment1 & 0.00\% & 0.00\% & 5.5 MB & 5.5 MB & 546 B & 0 B \\ Docker & ca\_nodeDepartment2 & 0.00\% & 0.00\% & 0 B & 0 B & - \\ \hline \hline \end{tabular}
\end{table}
Table 5: Resource utilization analysis of the proposed system.  
* _Key attack:_ PetroBlock uses elliptic curve encryption to generate the key pair, and the attacker cannot compute the private key as solving the elliptic curve logarithm problem is difficult which ensures the key security. In addition, a different temporary private key is generated for each session agreement between nodes. In this way, the leakage of one private key will not affect: (a) during the session, the attacker cannot compute a session key of an already established session between two nodes, and (b) after the session is terminated, the leaked private key becomes useless.
* _Replay attack:_ PetroBlock employs a separate temporary private key for each session agreement between nodes. As private keys have bounded lifetime, the replay attack cannot succeed and can be easily detected.
* _Impersonation attack:_ This attack could only be successful if the attack can obtain the private key. As PetroBlock uses elliptic curve encryption and a separate temporary private key for each session agreement, this attack cannot succeed.
* _Sybil attack:_ There are various ways to mitigate the effect of Sybil attack on PetroBlock: (a) raise the cost of creating a new identity. This resource requirement limits the number of attackers that attempt to create fake identities, (b) adoption of two-factor authentication mechanism, or (c) collecting the I.P. and MAC addresses of participants, which allows detecting those who have different identities that map to the same address.
* _False data injection attack:_ In blockchains, consensus algorithms are executed before validating the records. Each node can verify the integrity of the received record when a positive consensus is reached.
* _Tampering attack:_ Public key cryptosystem is used to encrypt and sign the transactions. This means that a tampering node cannot tamper with the transaction as it does not have the private key of the signer node. In addition, as shown above, PetroBlock is resilient against key attacks, and hence, the private key cannot be exploited by adversaries.
* _Modification attack:_ As shown above, this attack is not possible as adversaries cannot exploit the private keys.
* _Hiding blocks attack:_ In PetroBlock, each record has its sequence number. The requested vehicles must provide their records in case others request them. If any node refuses to provide records, it will be isolated, and no one will interact with others.
* _Man-in-the-middle attack:_ PetroBlock ensures mutual authentication among nodes, as it uses temporary private keys for each session agreement, and hence it can prevent man-in-the-middle attacks.