{'fraction_non_alphanumeric': 0.03880733944954128, 'fraction_numerical': 0.009339449541284404, 'mean_word_length': 4.41167709264224, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
HERMES: Scalable, Secure, and Privacy-Enhancing Vehicle Access System

We propose HERMES, a scalable, secure, and privacy-enhancing system, which allows users to share and access vehicles. HERMES outsources the vehicle access token generation to a set of untrusted servers, utilizing several cryptographic primitives with secure multi-party computation efficiently. It conceals the vehicle secret keys and transaction details from the servers such as vehicle booking details, access token information, and user-vehicle identities. It also provides user accountability in case of disputes. We prove that HERMES meets its security and privacy requirements. Moreover, we demonstrate that HERMES scales for a large number of users and vehicles, making it practical for real-world deployments. To achieve high-performance computations, we evaluate HERMES over two different multiparty computation protocols for Boolean and arithmetic circuits. We provide a detailed comparison of their performance, together with other state-of-the-art access provision protocols. Through a proof-of-concept implementation, our performance analysis demonstrates that HERMES requires only approx 61ms for a single-vehicle access provision. At the same time, it handles 546 and 84 access token generations per second from a single-vehicle owner and large branches of rental companies with over a thousand vehicles, respectively.


I. INTRODUCTION
Vehicle-sharing is an emerging smart mobility service leveraging modern technology to enable users to share their vehicles with others or access shared vehicles. The service has been gaining popularity in recent years. Statistics demonstrate an increase of the worldwide number of users of vehicle-sharing services from 2012 to 2014 by 170% (total 5 million) [1], with a tendency to reach a total of 26 million by 2021 1 [2]. Moreover, several companies, including Volvo [3], BMW [4], Toyota [5], and Apple [6], have been already investing in vehicle-sharing services.
For instance, Apple announced the "CarKey" API in the first quarter of 2020. The API allows users to (un)lock and start a vehicle using an iPhone or Apple Watch. "CarKey" can also be shared with other people, such as family members, enabling vehicle-sharing [7], [8]. With the use of in-vehicle telematics and omnipresent portable devices, such as smartphones, vehicle owners can distribute temporary digital keys, a.k.a. Access Tokens (ATs), to 1 Note that these predictions were made in pre-COVID -19 times. been tested on how it scales in a real-world setting with a large number of vehicles per user. Hence, to the best of our knowledge, there is no VSS solution in the literature that provides security and privacy guarantees while at the same time being scalable. This work fills this gap.
We present HERMES, an efficient, secure, and privacy-enhancing system for vehicle access provision that supports dispute resolution while protecting users' privacy. HERMES is based on SePCAR [22], but fundamentally differs in certain design choices to make it scalable and more efficient. Specifically, the contributions of this work are: 1) HERMES deploys multiparty computation primitives to ensure that ATs are generated without the VSS learning vehicle-sharing details and vehicle secret keys. With the use of a public ledger, it also ensures the unlinkability of any consumer's two requests, keeps the consumer's identity and the vehicle anonymous, and indistinguishable between sharing operations while generation, update, or revocation. Besides that, HERMES also supports dispute resolution without compromising users' private information while keeping users accountable. We also prove that the HERMES is secure and meets its appropriate security and privacy requirement.
2) We demonstrate that HERMES is highly efficient under real-world settings of VSSs. Our design and implementation is tailored to supporting a VSS with users ranging from private individuals with only a few vehicles to large branches in car-rental scenarios with over a thousand vehicles per branch. Our implementation and performance evaluation demonstrates that HERMES requires only ≈ 61ms for a single-vehicle access provision while it can handle multiple access token generations per second for individuals and branches of rental companies. We also tested and evaluated our results using two MPC instantiations for Boolean and arithmetic circuits, and we provide a comparison. We also analyze the complexity of these two protocols independently, provide a comparison, and motivate the two choices.
The rest of the paper is organized as follows: Section II provides the system model and preliminary information of HERMES. Section III describes the cryptographic building blocks used in the design of HERMES, and Section IV describes the system in detail. Section V provides the security and privacy analysis of HERMES, and Section VI evaluates its theoretical complexity and practical efficiency. Section VII gives an overview of the state-of-the-art related work. Section VIII concludes our work.

II. SYSTEM, ADVERSARIAL MODELS AND REQUIREMENTS
We describe the system model of VSS and specify the adversarial model and assumptions we use in our design, as well as, the functional, security, privacy and performance requirements which the system needs to satisfy. 1) System model: The VSS infrastructure, that comprises users, vehicles, their manufacturers, and authorities, is illustrated in Fig. 1. It considers two types of users: owners (u o ), individuals or vehicle rental companies willing to share (rent out) their vehicles, and consumers (u c ), individuals using vehicles available for sharing; both use portable Devices (PDs), such as smartphones to interact with VSS entities and each other. The On-Board Unit (OBU) is a hardware/software component that enables vehicle connectivity [24]. It has a wireless interface such as Bluetooth, NFC, or LTE and is part of the secure access management system of a vehicle [25]. The VM is responsible for managing the digital keys that enable access into each vehicle. These keys are used for enabling vehicle sharing in VSS as well. The VSSP is a cloud infrastructure that facilitates the vehicle AT generation, distribution, update  K u c tag u c 's session key K u c tag enc , K u c tag mac used for generating of the AuthT ag generated from K u c and counter + 1/counter + 2 (kdf output) The authentication tag of Time-stamp of u c accessing the shared vehicle, a record published (publish) on the PL submitted by S i and revocation. It consists of servers that collaboratively generate ATs and publish them on the PL. PL serves as a public bulletin board that guarantees the integrity of the data [26]. The booking details are typically agreed upon by the owner and consumer prior to each vehicle-sharing session commences. We denote M B , AT vehicleo , and K vehicleo as Booking Details (BD), an Access Token (AT) for a vehicle, and for the vehicle secret key, respectively.
2) Adversarial Model: For our system design, we use the following adversary model. The communication channels are secure and authenticated among entities such as using SSL-TLS and NFC. The authorities are trusted entities. The VSSP, the VM and the PL are considered honest-but-curious entities. They execute the protocol correctly, but they may attempt to extract private information about users. Owners can be passive adversaries, as they hold information booking but they will not aim to alter the protocol. Consumers and outsiders can be active adversaries aiming to illegally access a vehicle, alter the booking information and hide on incidents. The vehicle, specifically its OBU, is trusted and designed to resist deliberate or accidental physical destruction (i.e., it serves as black box). User PDs are untrusted as they can get stolen, lost, or broken.
3) Assumptions: For HERMES, we make the following assumptions. There is a Public Key Infrastructure (PKI) infrastructure [27] in place and each entity has its private/public-key pair with their corresponding digital certificates.
The OBU is equipped with a Hardware Security Module (HSM) [27], [28] that supports secure key storage and Before each evaluation, the Booking Details (BD) are agreed upon by the owner and consumer. Both keep the BD confidential against external parties. In BD, the identities of vehicle, owner and consumer, the location and time duration of the reservation can be specified. HERMES is agnostic to the specificities of BD drawing from the analogy of VSS.

4) System Design Requirements:
A VSS should satisfy the following functional, security, privacy, and performance requirements [9], denoted as FR, SR, PR, and PSR, respectively.
Functional requirements: • FR1 -Offline access provision. Access provision should be provided for locations where vehicles have limited (or no) network connectivity.
• FR2 -Access token update and revocation by u o . No one but u o can initiate AT update and revocation.
Security requirements: • SR3 -Confidentiality of AT vehicleo . No one but the shared vehicle and u c should have access to AT vehicleo .
• SR4 -Confidentiality of K vehicleo . No one but vehicle o and VM should hold a copy of K vehicleo .
• SR5 -Backward and forward secrecy of AT vehicleo . Compromise of a key used to encrypt any AT vehicleo should not compromise other tokens (future and past) published on the PL for any honest u c .
• SR6 -Non-repudiation of origin of AT vehicleo . u o should not be able to deny it agreed to the terms of M B , and initiated the generation of the corresponding AT vehicleo .
• SR7 -Non-repudiation of delivery of AT vehicleo . u c should not be able to deny it has obtained and used AT vehicleo to open the vehicle (once it has done so).
• SR8 -Accountability of users (i.e., owners and consumers). The VSSP should be able to provide authorities with the transaction details of an access provision to a vehicle at the request of law enforcement without violating the privacy of other users.
Privacy requirements: should be able to distinguish between AT vehicleo generation, update and revocation.
Performance requirement: • PSR1 -Scalability. VSS should maintain its efficiency when it supports a large number of vehicles per user.

III. CRYPTOGRAPHIC BUILDING BLOCKS
1) Cryptographic Primitives: HERMES uses the following cryptographic building blocks. The suggested instantiations are used in our proof-of-concept implementation.
• σ ← sign(Sk, m) and true/false ← verify(P k, m, σ) are public-key operations for signing and verification respectively. These can be implemented using RSA as defined in the PKCS #1 v2.0 specification [30].
• K ← kdf(K, counter) is a key derivation function using a master key and a counter as inputs. It can be based on a Pseudo-Random Function (PRF) and implemented using CTR mode with AES [31]. 3 • c ← enc(P k, m) and m ← dec(Sk, c) are public-key encryption and decryption functions. These can be implemented using RSA as defined in the RSA-KEM specifications [33].
• c ← E(K, m) and m ← D(K, c) are symmetric key encryption and decryption functions. These can be implemented using CTR mode with AES.
• z ← hash(m) is a cryptographic hash function. This function can be implemented using SHA-2 or SHA-3.
• t ← mac(k, m) is a cryptographic Message Authentication Code (MAC) which outputs an authentication tag t given a key k and a message m. These can be implemented using CBC-MAC-AES or HtMAC-MiMC (see below). 3 In our case, the message input is small, i.e., 2 64 blocks for AES in CTR, and the generation is performed with side channel attacks not to be a concern [32].
Furthermore, we use z ← query(x, y) to denote the retrieval of the xth value from the yth database DB (to be defined in Sect. IV), and z ← query an(y) to denote the retrieval of the yth value from the PL through an anonymous communication channel such as Tor [34], aiming to anonymously retrieve a published record submitted using the publish(y) function.
2) Multiparty Computation: MPC allows a set of parties to compute a function over their inputs without revealing them. Following the seminal papers of Yao for the two-party case [35] and by Goldreich, Micali and Wigderson in the multiple parties setting [36], secure MPC has gained much traction in the past years with many open-source frameworks [37].
To reason about the MPC protocol that fits our setting, one has to pinpoint various parameters such as network settings, security model, or a number of parties. For more details on adversary capabilities, the reader can refer to the survey by Lindell [38]. In order to keep the protocol simple, we consider a fast network (10 Gbps LAN) and a passive adversary for three-party replicated secret sharing scheme [39], [40]. However, if one wants to upgrade to other MPC protocols secure against malicious parties, this can be done fairly simple by changing the way external parties provide inputs or get outputs using known techniques [41]. To evaluate a function on secret inputs using MPC, one needs to unroll the function to a series of additions and multiplications in a field. A core contribution of the paper is the integration of two different modes of operations for the secrecy of AT generation considering honest-but-curious set of servers in VSSP: one mode that uses HtMAC which works over a large field [40], while the other mode uses CBC-MAC-AES over a binary field [39].
Our algorithms use building blocks whose instantiation depends on the protocol type. However, they can be treated generically. This is also called an arithmetic black-box functionality [42] .The functionality mainly in use consists of: • [x] ← share(x) secret shares an input x to all parties. The underlying secret sharing scheme is described in detail in Araki et al. [39]. . For the F 2 case, E is implemented using AES in counter mode. Concretely, the AES circuit description is the one from SCALE-MAMBA [43], which has 6400 AND gates. For the F p case, MiMC is used as a PRF in counter mode as presented in [44] to take advantage of PRF invocations done in parallel. the comparison is done with perfect security (i.e. no sec parameter). The equality operator is implemented using the latest protocols of Escudero et al. [45].

A. Overview of HERMES
We provide a brief overview of HERMES, which is also illustrated in Fig. 2. We consider a single owner, consumer, and a shared vehicle for simplicity and without loss of generality.
Before HERMES commences, there are vehicle key distribution and establishing the details for the vehicle booking prerequisite steps. Considering VM as a TP for VSS, it holds all the secret keys of vehicles that produce.
By vehicle owners registering their vehicles, the VSSP using the owner's identity retrieves the vehicle's identity and the corresponding key. Both the identity and vehicle key are transferred from VM to VSSP in a secret shared form, and thus preserving the secrecy of both towards the VSSP. For each commences of HERMES, the BD is established between the owner and the consumer, specifying information for vehicle sharing, such as the duration of the vehicle's reservation and location.
HERMES consists of four steps: session keys generation and data distribution, access token generation, access token distribution and verification, and vehicle access. During the session key generation and data distribution, three-session keys are generated by the consumer. One of these keys will be used to encrypt the generated AT at the VSSP servers so that only the consumer has access to it, while the other two keys will be used to generate an authentication tag of the BD such that the consumer can identify and retrieve the AT from the PL as well as verify that the beforehand agreed BD are included in the AT. Since the consumer considers the owner and the VSSP as honest-but-curious entities, it will conceal and forward the session keys towards the VSSP in secret shared form. To protect its identity from being leaked to the VSSP, the consumer avoids direct contact with the VSSP and forwards the session keys' shares the owner. Together with the concealed session keys, the owner forwards to VSSP the BD and its signature in a shared form to each S i server. Upon the VSSP receiving the session keys and the booking details, the access token generation step commences. The vehicle key is retrieved from the database in each S i server using an equality test over MPC, preserving the key's secrecy. The AT is generated under the vehicle's encryption, such that only the vehicle itself can retrieve the BD. Moreover, the consumer session keys are used to encrypt the AT and create an authentication tag, such that only the consumer can identify and access the AT. Each of the servers S i then forwards the encrypted AT and its authentication tag to the PL. The PL serves as a bulletin board and notifies the VSSP upon publishing the information. At the access token distribution and verification step, the consumer can identify and retrieve the corresponding AT. Since the consumer considers the PL as honest-butcurious, it can hide its identity (i.e., IP address), querying the PL using an anonymous communication channel. It will also retrieve the AT, and the AT will be used by the vehicle to verify and allow access to the consumer for the predefined booking duration at the last step of vehicle access.

B. HERMES in detail
Below we discuss HERMES in detail, with a general overview picture given in Fig. 9. We first describe the prerequisite steps, and we complete the section with an overview of the possible additional operations after HERMES: access token update and revocation and accountability of users. Table I lists the notation used throughout the paper. A detailed overview of HERMES, along with additional material, can be found at the online full version [46].

1)
Step 1 -Session key generation and data distribution: While u o signs the booking details, i.e., M B , u c generates session keys for encryption and data authentication, i.e., K uc enc and K uc tag = (K uc tagmac , K uc tagenc ), respectively. The generated material by u c and u o are sent via u o to each S i , such that the AT can be generated.
Prerequisite steps: Before HERMES commences, two prerequisite steps need to take place: vehicle key distribution and establishing the details for the BD. a) Vehicle key distribution: It takes place immediately after the xth owner, ID uo x , has registered her yth vehicle, ID restrictions on locations, time period), AC uc are the access control rights under which u c is allowed to access the vehicle and ID B is the booking identifier. Recall that it is assumed that an owner and a consumer agree on the booking details beforehand.
Step 1: session keys generation and data distribution.

2)
Step 1 -Session key generation and data distribution: While u o signs the booking details, i.e., M B , u c generates session keys for encryption and data authentication, i.e., K uc enc and K uc tag , respectively. The generated material by u c and u o are sent via u o to each S i , such that the AT can be generated.
In detail, as it is illustrated in Fig. 3, u o sends a session-keys-generation request, SES K GEN REQ, along with ID B to u c . Upon receipt of the request, u c generates the session keys, K uc enc and K uc tag . K uc enc will be used by the VSSP servers, S i , to encrypt the AT, such that only u c has access to it. Note that each S i does encryption evaluations in a secret shared way. K uc tag is used to generate an authentication tag which will allow u c to verify that the AT contains M B which was agreed upon, during the vehicle booking. It utilizes a kdf() function instantiated by u c 's master key, i.e., K uc master and a counter. For K uc tag , two session keys are generated and stored: one for encryption, K uc tagenc (i.e., K uc tag [0] = K uc tagenc ), and one for authentication, K uc tagmac (i.e., K uc tag [1] = K uc tagmac ). Then, u c transforms these keys into secret shares, [K uc enc ] and [ K uc tag ], one for each S i in such a way that none of the servers will have access to the keys but that they can jointly evaluate functions using the shares of these keys securely.

3)
Step 2 -Access Token Generation: The servers generate an AT and publish it on the Public Ledger (PL).
In detail, as shown in Fig. 4, upon receipt of AT GEN REQ from u o , the servers obtain the session keys in Each S i decrypts C Si using its private key. Session keys are for encrypting an AT used to access a vehicle by u c and for generating an authentication tag used by u c to verify the data authenticity of Public Ledger (PL)) S1 . . . Si . . . Sl  i.e., where we recall that K uc tag = (K uc tagmac , K uc tagenc ). Here, we note that for the efficiency over MPC, we perform Encthen-Hash-then-MAC. The reason is that, following [44] encryption, i.e., E, can be done in parallel and separately (so efficient), and then the hash does not need to be done in MPC and the MPC parties can apply the hash function locally. Essentially, we trade "parallel MPC encryption" for "having to evaluate a hash function on large input in MPC". 4 Finally, each S i sends to PL an access-token-publication request, AT PUB REQ, along with C uc and AuthT ag M B .

4)
Step 3 -Access Token Distribution and Verification: The PL publishes the encrypted AT which is then retrieved by u c . u c then can obtain the AT and use it to access the vehicle. In detail, as shown in Fig. 5, upon receipt of AT PUB REQ, PL publishes C uc , AuthT ag M B and T S P ub , which is the time-stamp of the publication of the encrypted token. User u c monitors PL for concurrent and following T S P ub to identify the corresponding C uc using AuthT ag M B . Upon identification, C uc queries and anonymously retrieves C uc from PL using query an(), such that PL cannot identify u c . Then, u c decrypts C uc using K uc enc to obtain the AT and the vehicle identity, {AT vehicle , ID vehicle }.
Note that, in a parallel manner and for synchronization purposes, PL sends an acknowledgment of the publication, AT PUB ACK, along with T S P ub i to at least one S i which it forwards it to u o who, in turn, forwards it to u c . Upon receipt of AT PUB ACK, u c uses T S P ub i to query PL. In the same manner, it uses query an() to anonymously retrieve C uc and AuthT ag M B . u c verifies the authentication tag C B locally using the mac() function with K uc tagmac and M B as inputs. In the case of successful verification, u c is assured that the token contains the same details as the ones agreed during vehicle booking. Then, u c decrypts C uc using K uc tagenc to obtain the access token and the vehicle identity, {AT vehicle , ID vehicle }.

5)
Step 4 -Car Access: The consumer uses the AT AT vehicleo , and ID vehicle , Cert uc , to obtain access to the vehicle using any challenge-response protocol based on public key implementations [47], [16] (see Fig. 6). A detailed representation of the last step can be found at the online full version of HERMES [46] and in [22].

V. SECURITY AND PRIVACY ANALYSIS
We prove that HERMES satisfies the security and privacy requirements of Sect. II, provided that its underlying cryptographic primitives are sufficiently secure. The theorem statement and the proof given below are informal, in a similar sense by [22]. A complete formal description of the semantic security models and the stand-alone proofs are given in the online version of the system [46].
Theorem 1. Assume that communication takes place over private channels. If: • the MPC is statistically secure [44], • the signature scheme sign is multi-key existentially unforgeable [48], • the key derivation function kdf is multi-key secure [49], • the public-key encryption scheme enc is multi-key semantically secure [50], • the symmetric key encryption scheme E is multi-key chosen-plaintext secure [51], • the hash function hash is collision resistant [52], and • the MAC function mac is multi-key existentially unforgeable [48], then HERMES fulfills the security and privacy requirements of Sect. II.
Note that, indeed, for each of the keyed cryptographic primitives we require security in the multi-key setting, as these are evaluated under different keys. For example, sign is used by all owners, each with a different key; enc is used for different keys, each for a different party in the VSSP, and E and mac are used for independent keys (i.e., session keys) for every fresh evaluation of the protocol. We refer to Bellare et al. [50] for a discussion on generalizing semantic security of public-key encryption to multi-key security; the adaptation straightforwardly generalizes to the other security models.
Proof sketch. We treat the security and privacy requirements, and discuss how these are achieved from the cryptographic primitives, separately. We recall that the consumer and owner have agreed upon the booking details prior to evaluating HERMES. Hence they know each other.
both of which reveal nothing about M B to a malicious outsider due to the assumed security of mac, E, and the independent uniform drawing of the keys K uc enc and K uc tag = (K uc tagenc , K uc tagmac ). The nested encryption E does not influence the analysis due to the mutual independence of the keys K uc enc and K c) SR3 -Confidentiality of AT vehicleo : The AT is generated by the VSSP servers obliviously (as the MPC is statistically secure), and only revealed to the public in encrypted form, through C uc of (7). Due to the uniform drawing of the key K uc enc (and the security of the public-key encryption scheme used to transmit this key), only the legitimate user can decrypt and learn the AT. It shares it with the vehicle over a secure and private channel.  (7), encrypted under symmetric key K uc enc . Every honest consumer generates a fresh key K uc enc for every new evaluation. It uses a key derivation function kdf utilizing a PRF for each key generation and every new evaluation of the protocol, and that is secure. This implies that all session keys are drawn independently and uniformly at random. In addition, the symmetric encryption scheme E is multi-key secure. Concluding, all encryptions C uc are independent and reveal nothing of each other. Note that nothing can be said about ATs for malicious users who may deviate from the protocol and reuse one-time keys. h) SR8 -Accountability of users (i.e., owners, and consumers): In the case of disputes, the information related to a specific transaction (and only this information) may need to be reconstructed. Reconstruction can be done only if the VSSP servers collude and reveal their shares. In our setting, these servers have competing interests. Thus they would not collude unless law authorities' request. Due to threshold secret sharing properties, the private inputs can be reconstructed by a majority coalition. This is, if the VSSP consists of three parties, it suffices two of party-shares required to reconstruct the secret.
i) PR1 -Unlinkability of any two requests of u c for any vehicle o (s): The only consumer-identifiable data is in the consumer's certificate included in the booking details. Note that these are agreed upon and between the consumer and the owner, so the owner learns the consumer's identity by default. Beyond that, the consumer only communicates with the vehicle, which is supposed to learn the consumer's identity to perform proper access verification. The consumer consults the PL over an anonymous communication channel [34]. The booking details are transferred to and from the VSSP, but these are encrypted and do not leak by virtue of their confidentiality (security requirement SR1). j) PR2 -Anonymity of u c and the vehicle o : The reasoning is identical to that of PR1. k) PR3 -Indistinguishability of AT vehicleo operations: Access token generation, update, or revocation is performed using the same steps and the same type of messages sent to the VSSP and PL. Hence, outsiders and system entities cannot distinguish which operation has been requested.

VI. PERFORMANCE EVALUATION
We take a different approach to [22] as we implement our protocols in a fully-fledged open-sourced MPC framework, i.e., MP-SPDZ [53]. The framework supports more than 30 MPC protocols carefully implemented in C ++ . In addition, a Python front-end compiler allows the expression of circuits in a relatively simple way. For MP-SPDZ, the compiler reduces the high-level program description to bytecode or set of instructions for which the parties then run an optimized virtual machine written in C ++ to execute the protocols. In our case, two versions of HERMES were benchmarked: one with CBC-MAC tailored for binary circuits, while the other one uses HtMAC, which is tailored for arithmetic circuits. For our benchmark we use the following settings: ||M uc || = ||AT vehicle || = 10 · 128 bits, whereas ID vehicle ≤ 2 32 , which thus fits into one 128 bit-string, and ||M B || = 6 · 128 bits.
Environment Settings: We benchmarked our protocols of VSSP servers using three distinct computers connected on a LAN network equipped with Intel i7-7700K CPU and 32GB of RAM over a 10Gb/s network switch and 0.5ms Round Trip Time (RTT). 5 1) Theoretical Complexity: Measuring the complexity of an MPC protocol usually boils down to counting the number of non-linear operations in the circuit and the circuit depth. We consider the case where a protocol is split into two phases. An input-independent (preprocessing) phase, where the goal is to produce correlated randomness.
Additionally, an input-dependent (online) phase where parties provide their inputs and start exchanging data using the correlated randomness produced beforehand. One secret multiplication (or an AND gate for the F 2 case) requires one random Beaver triple (correlated randomness) [54] from the preprocessing phase and two open() operations in the online phase.
Note that, in our case, the two versions of HERMES are benchmarked using the following two executables: replicated-bin-party.x (F 2 case, CBC-MAC) and replicated-field-party.x (F p case, HtMAC). The first executable is the implementation of Araki et al.'s binary based protocol [39], while the latter is for the field case. Next, we analyze the complexity of these two separately and motivate the two choices.
2) CBC-MAC-AES -case for binary circuits: This solution is implemented to have a baseline comparison with SePCAR [22] using MP-SPDZ [53]. The equality check is implemented using a binary tree of AND operations with a log n depth where n is the number of vehicles (see Fig. 4). Obtaining the corresponding vehicle key [K vehicle ] assuming there are n vehicles per user has a cost of 159 · n Beaver triples assuming 32 bit length vehicle IDs.
When evaluating the operations depicted in Fig. 4 in MPC, the most expensive part is computing since that requires encrypting 10 · 128 bits, calling AES 10 times, which has a cost of 6400 · 10 AND gates. In the next step, (in line 8 in Fig. 4), AES is called 11 times, while the operation computing CBC-MAC-AES (from line 10) takes only 6 AES calls. Given the above breakdown, the theoretical cost for generating an access token has a cost of 159 · n + 6400 · 28 AND gates.
3) HtMAC-MiMC -case for arithmetic circuits: Recent results of Rotaru et al. [44] showed that, when considering MPC over arithmetic circuits, efficient modes of operation over encrypted data are possible if the underlying PRF is MPC-friendly. We integrate their approach into SePCAR, and results from Table II show that it is at least 16 times faster than using MPC over binary circuits with CBC-MAC-AES. This might come as a surprise since comparisons are more expensive to do in arithmetic circuits and although they weigh a good chunk of the overall cost. Recent improvements using edaBits [45] made comparisons much faster, which, in turn, improved the MPC protocols used by HERMES. To summarize, we breakdown the cost into the following: • 10 calls to MiMC to encrypt M uc (excluding one call for computing the tweak according to [44]), • 11 more calls to compute C uc -encrypting the concatenation of AT vehicleo and ID vehicleo . Note that since we are using a different key than the first step we need to compute another tweak (one extra PRF call), • 6 calls to compute AuthT ag M B , one more PRF call for computing the tweak N = E K uc tag [0] (1) and a final PRF call E K uc tag [1] (hash (ct)) where ct are the opened ciphertexts from encrypting M B and hash (·)) is a truncated version of a SHA-3 where we keep the first 128 bits hash [44].
If we include the PRF calls to compute the tweaks, there are 31 calls to a PRF, so one can think that the Boolean case is more efficient than the arithmetic case. In practice, we see that HtMAC construction is faster than CBC-MAC-AES, albeit with a factor of two communication overhead (see Table II). One reason for this is that HtMAC is fully parallelizable, resulting in an MPC protocol with fewer rounds than CBC-MAC-AES.
One of the main benefits of HtMAC construction is that it can be instantiated with the Legendre PRF, which can make the number of communication even lower. We chose the MiMC based PRF as that is demonstrated to be faster on a LAN [44] and to have a lower communication overhead -although a higher number of communication rounds than the Legendre based PRF.

4) Benchmark results:
We vary the number of vehicle IDs (i.e., the numbers of vehicles registered per owner) and compute the communication rounds, data sent between the VSSP servers, and the total throughput meaning the total number of ATs generated per second from Fig. 4. In Table II, we report the performance for a low number of vehicle IDs (i.e., 1, 2, 4), representing individuals, but also for a large number (i.e., 256, 512, 1024), representing large branches of vehicle-rental companies.  We can see that the throughput of the AT generation when instantiated using CBC-MAC-AES remains constant, whereas, for HtMAC-MiMC, it is decreasing. The reason for this is that when scaling the number of vehicles, the number of comparisons is increasing as well. For the case of arithmetic circuits, the comparisons become costly operations, whereas, for Boolean circuits, comparisons can be made efficiently. However, the throughput for HtMAC-MiMC is always better than CBC-MAC-AES, and this is because MiMC-based PRF is more lightweight -requiring fewer multiplications -and has a smaller circuit depth. We report the full range of experiments for varying the number of vehicle IDs regarding the communication sent between the parties in Fig. 7 as well the throughput in Fig. 8.

5) Comparison with SePCAR [22]
: SePCAR reports 1.2 seconds for generating the access token, see Table 2 in [22]. Note that SePCAR uses a single-vehicle ID when reporting [22]. When benchmarked on similar hardware we get a throughput of 33 access tokens per second, which demonstrates the benefits of integrating our solution in a fully-fledged MPC framework such as MP-SPDZ [53]. This makes HERMES with the CBC-MAC-AES construction roughly 40 times faster than SePCAR. Switching from CBC-MAC-AES to HtMAC offers a throughput of 546 ATs per second, which makes it ≈ 16.5 times better than CBC-MAC, making it around 600 times faster than original timings in SePCAR [22]. We stress that our implementation of SePCAR was faster due to writing CBC-MAC-AES using a mature MPC framework such as MP-SPDZ rather than using custom code as in [22].

6) Total time: SePCAR reports on
Step 1 and Step 3 taking 0.22 seconds and 0.05 seconds, respectively, were the major bottleneck produces the RSA signatures (50ms per signing operation) [22]. However, when benchmarking the OpenSSL [55] RSA signatures on our computer, one RSA signature takes 0.5ms. Plugging in the RSA signature time to the estimations done in SePCAR, Step 1 should take ≈ 4ms.
Step 3 could probably be improved by storing the data in memory instead of fetching it from a database. Using our RSA signature time, Step 1 and Step 3 from SePCAR should take ≈ 59ms, while Step 2 of our protocol takes 1.83ms in the batched setting (see Table II) as HtMAC-MiMC has a throughout of 546 ops/s. This might look surprising, but in our solution, the non-MPC part is the bottleneck, making the approximated total time of 61ms being around 25 times faster than [22].

VII. RELATED WORK
Our work is closely related to the SePCAR protocol proposed by [22]. They initially performed security and privacy analysis on vehicular-sharing systems [9], and designed a solution for privacy-preserving access provision protocol [22]. Their solution design considers untrusted servers for the generation and distribution of ATs. They utilize MPC in combination with several cryptographic primitives. With their work, they also consider malicious users, and SePCAR considers accountability revealing a user's identity in case of wrongdoings. However, the protocol is not tested on how it scales to multiple evaluations of equality checks -essentially to vehicular-fleet and multi-vehicle owners. Moreover, in terms of efficiency, HERMES is proven to run significantly faster than SePCAR due to optimized MPC constructions, making it efficient enough to support a fleet of vehicles.
State of the art on vehicle-sharing also focuses on either a trusted service provider, on complementary operations to access provision, or fulfills a subset of properties for a solution design. Initially, Dmitrienko and Plappert [16] were the first to design a secure free-floating vehicle sharing system. In contrast to HERMES, their protocol assumes a fully trusted vehicle sharing provider who has access to the master key of smart-vehicles and collects and stores all the information exchanged between the vehicle provider and their users for every vehicle access provision. Huang et al. [56] proposed a privacy-preserving identity management protocol focusing on authentication while verifying users' misbehavior. They utilize decentralized entities and a centralized vehicle sharing service provider. However, the service provider is trusted and can know who is sharing, which vehicle, with whom. Madhusudan et al. [57] and De Troch [58] proposed privacy-preserving protocols for booking and payments operations on vehicle sharing systems. Their protocols utilize smart contracts on the Ethereum blockchain. Trust is placed on cryptographic primitives and blockchain instead of a centralized party. De Troch [58] also considers accountability in case of misbehavior, which malicious behavior is tracked and punished by the loss of privacy and deposit.
Considering secure vehicular communications, Papadimitratos [59] analyzed the security challenges in vehicular communication systems while Jin et al. [60] extend the analysis to the privacy landscape. Raya et al. [61] described the need for a vehicular PKI to secure vehicular communications, and Khodaei et al. [62] proposed a generic pseudonymization approach to preserve the unlinkability of messages exchanged between vehicles and PKI servers.
Driven by [59], PRESERVE [27] and EVITA [29] were designated projects on the design and specification of the secure architecture of OBUs. Secure access controls to the OBU from smartphones were proposed by Groza et al. [63] to use smartphones as a vehicle key. Huayi et al. [64] proposed an enhanced scheme of [65], namely DUBI, a decentralized and privacy-preserving usage-based insurance scheme built on the blockchain technology to address privacy concerns for pay-as-you-drive insurances using zero-knowledge proofs and smart contracts.

VIII. CONCLUSION
In this paper, we proposed HERMES -an efficient, scalable, secure, and privacy-enhancing system for vehicle access provision. It allows users to dynamically instantiate, share, and access vehicles in a secure and privacyenhancing fashion. To achieve its security and privacy guarantees, HERMES deploys secure multi-party computation primitives for access token generation and sharing while keeping the booking details confidential. To ensure efficiency and scalability, HERMES utilizes two secure multiparty computation protocols, supporting various users and vehicles per users. This makes HERMES suitable for individuals with few vehicles and rental companies with potentially thousands of vehicles per branch. We presented a formal analysis of our system's security and privacy requirements and designed a prototype as a proof-of-concept. We benchmarked the secure multiparty valuations with HtMAC-MiMC for arithmetic circuits and CBC-MAC-AES for the case of binary circuits. HERMES demonstrates a significant improvement in performance: ≈ 61ms for a vehicle access provision, thus demonstrating its efficiency compared to SePCAR (i.e., 25 times faster).
In the future, we plan to extend HERMES to support additional operations such as booking and payment and protect against MPC servers as active adversaries. Moreover, we aim to investigate whether message authentication part can be made more efficient using lightweight block ciphers such as Rasta.
[12] F. Ferrero, G. Perboli, M. Rosano, and A. Vesco, "Car-sharing services: An annotated review," Sustainable Cities and Society, vol.  We prove that HERMES satisfies the security and privacy requirements of Section II, provided that its underlying cryptographic primitives are sufficiently secure. In Section A-A we describe the security models of the cryptographic primitives. Then, the formal reasoning is given in Section A-B.

A. Cryptographic Primitives
The security definitions for signature schemes and MAC functions are inspired by Goldwasser et al. [48], for key derivation utilizing PRF by Goldreich et al. [49], for public key encryption by Bellare et al. [50], and for symmetric key encryption by Bellare et al. [51].
We will, in fact, need security of the cryptographic primitives in the multi-key setting, as these are evaluated under different keys. For example, sign is used by all owners u o , each with a different key; enc is used for different keys, each for a different party in the VSSP, and E and mac are used for independent keys for every fresh evaluation of the protocol. We refer to Bellare et al. [50] for a discussion on generalizing semantic security of public key encryption to multi-key security; the adaptation straightforwardly generalizes to the other security models.
In below definitions, for a function f , we define by Func(f ) the set of all functions with the exact same interface as f K . We denote a random drawing by where "forges" means that A outputs a tuple (i, M, σ) such that verify(P k i , M, σ) = 1 and M has never been queried to the i-th signing oracle. We define by Adv µ-euf sign (q, t) the supremum over all adversaries making at most q queries and running in time at most t. Definition 2. Let µ ≥ 1. Consider a key derivation function using a pseudorandom function prf = (keygen, prf).
For any adversary A, we define its advantage in breaking the µ-multikey pseudorandom function security as We define by Adv µ-prf prf (q, t) the supremum over all adversaries making at most q queries and running in time at most t. we define its advantage in breaking the µ-multikey chosen-plaintext security as We define by Adv µ-ske E (q, t) the supremum over all adversaries making at most q queries and running in time at most t.
Definition 5. Let µ ≥ 1. Consider a MAC function mac = (keygen, mac). For any adversary A, we define its advantage in breaking the µ-multikey existential unforgeability as where "forges" means that A outputs a tuple (i, M, σ) such that mac(K i , M ) = σ and M has never been queried to the i-th MAC function. We define by Adv µ-mac mac (q, t) the supremum over all adversaries making at most q queries and running in time at most t.
Finally, we consider the hash function hash to be collision-resistant. We denote the supremal probability of any adversary in finding a collision for hash in t time by Adv col hash (t). The definition is, acknowledgeably, debatable: for any hash function there exists an adversary that can output a collision in constant time (namely one that has a collision hardwired in its code). We ignore this technicality for simplicity and refer to [52], [66], [67] for further discussion.

B. Analysis
We prove that HERMES satisfies the security and privacy requirements of Section II provided that its underlying cryptographic primitives are sufficiently secure.
Theorem 2. Suppose that communication takes place over private channels, the MPC is statistically secure, hash is a random oracle, and where µ o denotes the maximum number of u o s, µ c the maximum number of u c s, µ vehicleo the maximum number of vehicles, l the number of servers in the VSSP, q the total times the system gets evaluated, and t the maximum time of any adversary.
Then, HERMES fulfills the security and privacy requirements of Section II.
Proof. Recall from Section II that u o s and CM are honest-but-curious whereas u c s and outsiders may be malicious and actively deviate from the protocol. Vehicles are trusted.
Via a hybrid argument, we replace the key derivation functions utilizing pseudorandom functions prf(K uc , ·) by independent random functions $ uc . This step is performed at the cost of as in every of the q evaluations of HERMES there are two evaluations of a function prf, and there are at most µ c instances of these functions. As we assume that the MPC is performed statistically secure, we can replace the VSSP by a single trusted authority (with l interfaces) that is trusted, perfectly evaluates the protocol, and does not reveal/leak any information. Assuming that the public-key encryption reveals nothing, which can be done at the cost of we can for simplicity replace it with a perfectly secure public-key encryption ρ VSSP to the VSSP directly (an encryption does not reveal its origin and content, and only VSSP can magically decrypt), therewith eliminating the fact that VSSP has l interfaces and has to perform multiparty computation. Now, as the pseudorandom functions are replaced by random functions, the keys to the symmetric encryption scheme E are all independently and uniformly distributed, and as the public-key encryption scheme is secure, these keys never leak. Therefore, we can replace the symmetric encryption functionalities by perfectly random invertible functions, π vehicleu o for the vehicles, unique π uc enc 's for every new encryption under u c 's session keys, and π uc tagenc 's for every new encryption in the tag computation under u c 's session keys, at the cost of as there are 2q + µ vehicleo different instances involved and at most 3q evaluations are made in total. Note that this means that, instead of randomly drawing K uc enc ← $ uc , we now randomly draw π uc enc $ ← − Func(E). Likewise, for K uc tagenc ← $ uc we now randomly draw π uc tagenc $ ← − Func(E).
We are left with a simplified version of HERMES, namely one where the VSSP is replaced by a single trusted authority, the pseudorandom functions are replaced by independent random drawings (u c uses $ uc which generates fresh outputs for every call), public-key encryptions are replaced with a perfectly secure public-key encryption function ρ VSSP , and symmetric-key encryptions are replaced by perfectly random invertible functions π vehicleu o , π uc enc , and π uc tagenc . The simplified system is given in Figure 10. Here, the derivation of the vehicle key (or, formally, the random function corresponding to the encryption) from the database is abbreviated to π vehicleu o ← query(ID uo , DB VSSP ) for conciseness.
We will now treat the security and privacy requirements, and discuss how these are achieved from the cryptographic primitives, separately. We recall that u c and u o have agreed upon the booking details prior to the evaluation of HERMES, hence they know each other by design. AuthT ag M B = mac(K uc tagmac , π uc tagenc (M B )) , The latter value reveals nothing about M B as π uc enc is randomly generated for every evaluation, whereas the former value reveals nothing about M B as π uc tagenc and the key K uc tagmac are randomly generated for every evaluation. The nested encryption π uc enc • π vehicleu o does not influence the analysis due to the mutual independence of the two functions.
b) SR2 -Authenticity of M B : An owner who initiates the AT generation and distribution, first signs the booking details using its private key before sending those to the VSSP in shares. Therefore, once the vehicle receives the token and obtains the booking details, it can verify u o 's signature on the booking details. In other words, the vehicle can verify the source of M B , u o , and its integrity. Suppose, to the contrary, that a malicious consumer can get access to a vehicle of an u o . This particularly means that it created a tuple (M B , σ uo ) such that verify(P k uo , M B , σ uo ) holds. If σ uo is new, this means that u c forges a signature for the secret signing key Sk uo .
Denote the event that this happens by On the other hand, if (M B , σ uo ) is old but the evaluation is fresh, this means a collision hash(Cert uc ) = hash(Cert uc ). Denote the event that this happens by E 2 : A finds a collision for hash .
We thus obtain that a violation of SR2 implies E 1 ∨ E 2 .
c) SR3 -Confidentiality of AT vehicleo : The AT is generated by the VSSP obliviously (as it is trusted), and only revealed to the public in encrypted form, through C uc of (7). Due to the uniform drawing of π uc enc (and the security of ρ VSSP used to transmit this function), only the legitimate user can decrypt and learn the AT. It shares it with the vehicle over a secure and private channel. d) SR4 -Confidentiality of K vehicleo : By virtue of our hybrid argument on the use of the symmetric-key encryption scheme, E K vehicle got replaced with π vehicleu o , which itself is a keyless random encryption scheme. As the key is now absent, it cannot leak.
Moreover, considering the VM as a TP, it holds all the secret keys of vehicles that produce. By vehicle owners registering their vehicles, the VM forwards the list of each vehicle ID vehicleo to VSSP. To retrieve the yth key from DB Si , i.e., [K from which the share of the vehicle's secret key, [K vehicle ], can be retrieved. Due to the properties of threshold secret sharing, the secret vehicle keys stay secret to each S i . Thus, no one including the PD of the vehicle owner, but VM and the vehicle holds the vehicle key. e) SR5 -Backward and forward secrecy of AT vehicleo : The AT is published on PL as C uc of (7), encrypted using π uc enc . Every honest u c generates a uniformly randomly drawn function π uc enc for every new evaluation. Therefore, all encryptions C uc are independent and reveal nothing of each other. (Note that nothing can be said about ATs for malicious users who may deviate from the protocol and reuse one-time keys.) f) SR6 -Non-repudiation of origin of AT vehicleo : The vehicle, who is a trusted identity, verifies the origin through verification of the signature, verify(P k uo , M B , σ uo ). The consumer u c verifies the origin through the verification of the MAC function, AuthT ag M B ?
= mac(K uc tagmac , π uc tagenc (M B )). Note that u c does not effectively verify AT vehicleo , but rather AuthT ag M B . In either case, security fails only if the asymmetric signature scheme or the MAC function are forgeable. The former is already captured by event E 1 in (8). For the latter, denote the event that this happens by E 3 : A forges mac(K uc tagmac , ·) for some K uc tagmac .
We thus obtain that a violation of SR6 implies E 1 ∨ E 3 .
g) SR7 -Non-repudiation of delivery of AT vehicleo : u o can verify correct delivery through the verification of the message sent by the vehicle to the him/her, verify(P k vehicle , {M B , T S vehicle Access }, σ vehicle Access ) at the end of the protocol. Security breaks only if the signature scheme is forgeable. Denote the event that this happens by E 4 : A forges sign(Sk vehicle , ·) for some Sk vehicle .
We thus obtain that a violation of SR7 implies E 4 .
h) SR8 -Accountability of users (i.e., owners, and consumers): In the case of disputes, the information related to a specific transaction (and only this information) may need to be reconstructed. This reconstruction can be done only if the VSSP servers collude and reveal their shares. In our setting, these servers have competing interests, thus they would not collude unless law authorities enforce them to do so. Due to the properties of threshold secret sharing, the private inputs can be reconstructed by a majority coalition. This is, if the VSSP consists of three parties, it suffices two of such parties to reconstruct the secrets (for semi-honest and malicious cases).
i) PR1 -Unlinkability of u c and the vehicle: The only consumer-identifiable data is in u c 's certificate included in the booking details. Note that these are agreed upon between u c and u o , so u o learns the identity of u c by default. Beyond that, u c only communicates with the vehicle, which is supposed to learn u c 's identity so that it can perform proper access control. u c consults PL over an anonymous communication channel. The booking details are transferred to and from the VSSP, but these are encrypted and do not leak by virtue of their confidentiality (security requirement SR1).
j) PR2 -Anonymity of u c and the vehicle: The reasoning is identical to that of PR1.
k) PR3 -Undetectability of AT vehicleo operation: Access token generation, update, or revocation is performed using the same steps and the same type of messages sent to the VSSP and PL. Hence, outsiders and system entities can not distinguish which operation has been requested. 30 l) Conclusion: In conclusion, HERMES operates securely as long as the costs of (3)(4)(5), together with the probability that one of the events (8-11) occurs, are sufficiently small: Adv µc-prf prf (2q, t) + Adv l-pke enc (t) + Adv 2q+µ vehicle -ske E (3q, t) + Pr (E 1 ∨ E 2 ∨ E 3 ∨ E4) 1 .
By design, the probability that event E 1 ∨ E 4 occurs is upper bounded by Adv µo+µ vehicle -euf sign (2q, t), the probability that event E 3 occurs is upper bounded by Adv q-mac mac (q, t), and the probability that E 2 occurs is upper bounded by Adv col hash (t). We thus obtain Pr (E 1 ∨ E 2 ∨ E 3 ∨ E4) ≤ Adv µo+µ vehicle -euf sign (2q, t) + Adv q-mac mac (q, t) + Adv col hash (t) , which completes the proof.