# Adaptive Authentication Protocol Based on Zero-Knowledge Proof
## 4 ZKAP Using Session Keys  
Assume that only _OBUs_ and _RSUs_ work in the VANET network. In reference [44], the authors proposed an authentication scheme in which _OBUs_ fully trust _RSUs_. In this case, only the _OBU_ needs to be authenticated. However, this scheme has a disadvantage. The _RSU_ can control the vehicle's route when this authentication scheme is used. Therefore, during the development of an authentication protocol, we proceed from the condition that both sides do not trust each other. Assume that the vehicle manufacturer loads a secret key, \(O_{private}\) into each _OBU_. When the VANET network is deployed, every _RSU_ has its own secret key \(R_{private}\), which is loaded into the appropriate _RSU_. These keys can be changed periodically using Certificate Authority. Certificate Authority places a large prime number \(D\) and the number \(\mathrm{u}\) (the primitive root modulo \(D\)) in the public domain to organize the authentication process. _OBU_ and _RSU_ independently choose random numbers:  
\[\textit{OBU}:\ W<D-1,\ \textit{RSU}:\ Y<D-1 \tag{1}\]  
These numbers are used to calculate the _OBU_ and _RSU_ session keys, respectively. The use of a pseudo-random function (PRF) is proposed [45] to obtain session keys. Then,  
\[\textit{OBU}:\ W(i)=u^{\frac{1}{W(i-1)+O_{private}}}\,\mathrm{mod}D \tag{2}\]  
\[\textit{RSU}:\ Y(i)=u^{\frac{1}{V(i-1)+R_{private}}}\,\mathrm{mod}D \tag{3}\]  
where \(W(i-1),\ Y(i-1)\) are session keys, which were used on \((i-1)\)-th authentication session: \(W(0)=W,\ Y(0)=Y\). Consider the ZKAP, which provides a maximal level of confidentiality. Assume that _OBU_ is the prover and _RSU_ is the verifier. Authentication protocol \(\textit{OBU}(\textit{Prover})\to\textit{RSU}(\textit{Verifer})\). At the beginning of the authentication session, the prover calculates its true index:  
\[\textit{1.}\textit{OBU}:\ \ X(i)=u^{O_{private}}u^{W(i)}\mathrm{mod}D \tag{4}\]  
where \(X(i)\) is the true index of _OBU_; \(i\) is authentication session number. Then, the _OBU_ starts calculating its \"noisy\" index. To do this, it first generates numbers \(\Delta O_{private}(i)\), \(\Delta W(i)\):  
\[\textit{2.}\textit{OBU}:\ \ \left\{\Delta O_{private}(i),\ \Delta W(i)\right\}<D-1 \tag{5}\]where \(\Delta O_{private}(i),\ \Delta W(i)\) are random numbers for \"noisy\" keys. \"Noisy\" keys are calculated using expressions (6):  
\[ \begin{array}{ll}3.\,\mathit{OBU}:&O_{private}^{*}(i)=\Big{(}O_{private}+\ \Delta O_{ private}(i)\Big{)}\text{mod}\varphi(D),\\ 4.\,\mathit{OBU}:&W^{*}(i)=(W(i)+\Delta W(i))\text{mod}\varphi(D),\end{array}  \tag{6}\]  
where \(O_{private}^{*}(i),\ W^{*}(i)\) are \"noisy\" key values; \(\varphi(D)\) is [PERSON]'s totient function of the prime number \(D\). After that, \(\mathit{OBU}\) calculates its \"noisy\" index:  
\[ \begin{array}{ll}5.\,\mathit{OBU}:&X^{*}(i)=u^{O_{private}^{*}(i)}u^{W^{*}( i)}\text{mod}D\end{array}  \tag{7}\]  
where \(X^{*}(i)\)--\(\mathit{OBU}\)'s \"noisy\" index; \(i\) is authentication session number. The authentication process includes the following procedures. When an \(\mathit{OBU}\) appears in the range of the \(\mathit{RSU}\), the latter generates a random number:  
\[ \begin{array}{ll}6.\,\mathit{RSU}:&K(i)<D-1\end{array}  \tag{8}\]  
This number serves as a question from the verifier in the developed protocol. The number \(K(i)\) is passed to the prover (\(\mathit{OBU}\)). \[\mathit{RSU}\to\mathit{OBU}:\ \ K(i)\]  
Having received the number-question \(K(i)\) from the verifier, the prover proceeds to calculate the answers. These answers depend on both the question and the secret and session keys. \[ \begin{array}{ll}7.\,\mathit{G}_{1}(i)=(O_{private}^{*}(i)-K(i)O_{private}) \text{mod}\varphi(D).\end{array}  \tag{9}\]  
\[ \begin{array}{ll}8.\,\mathit{G}_{2}(i)=(W^{*}(i)-K(i)W(i))\text{mod}\varphi( D).\end{array}  \tag{10}\]  
The true and \"noisy\" \(\mathit{OBU}\)'s indexes, as well as the answers to the questions, the prover transmits to the \(\mathit{RSU}\) in the form of a signal:  
\[