# Authentication Based on Non-Interactive Zero-Knowledge Proofs for the Internet of Things
## 8 Comparative Analysis
### Schemes Based on Diffie-Hellman  
Other schemes with an objective similar to that of the one proposed here have been also compared. One of them was chosen for this study due to its popularity, frequent application and use of Diffie-Hellman key exchange [6]. Such a method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure communication channel, so that this key can then be used to encrypt subsequent communications using a symmetric key cipher. However, if no additional security measure is used, the Diffie-Hellman key exchange is vulnerable to an MitM attack. This vulnerability is possible when Diffie-Hellman key exchange does not include the authentication of participants. However, feasible solutions for authenticated Diffie-Hellman schemes, such as the one proposed here, allow preventing such attacks.  
After reviewing the relevant bibliography, a scheme was chosen that implements an authenticated Diffie-Hellman protocol for the comparison. The scheme is called password authenticated key (PAK) Diffie-Hellman exchange [40] and proposes to add mutual authentication based on a memorizable password, to the basic, unauthenticated Diffie-Hellman key exchange. PAK allows two parties to authenticate themselves while performing the Diffie-Hellman exchange. It also provides a secure and authenticated key-exchange protocol, which ensures forward secrecy and is secure against offline dictionary attacks when passwords are used.  
For the comparison, the PAK scheme was implemented for Android and Android Wear devices. Till now, the PAK scheme had not been implemented on any Android platform, so this paper provides the first implementation of the PAK scheme in the most popular platform of mobile devices. Both the source code of the scheme proposed in this paper and the source code for the PAK scheme have been released as open source and are available in a hosted repository on GitHub [38]. In the tests, the shared secret information in both schemes has been the typical 'Hello World!' used in computer programming environments.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & **Conf1. [39]** & **Conf2. [39]** & **Conf3. [39]** & **Conf4. [39]** & **Our Scheme** \\ \hline \multirow{2}{*}{10 Challenges} & Time & 469 & 1302 & 484 & 1522 & 454 \\  & Size & 4045 & 4045 & 4045 & 4045 & 17,826 \\ \hline \multirow{2}{*}{100 Challenges} & Time & 3422 & 8070 & 3703 & 9824 & 5665 \\  & Size & 39,595 & 39,595 & 39,595 & 39,595 & 187,132 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparative data: time (ms) and size (bytes).  
In particular, in order to compare the proposed scheme with the PAK scheme, the following configuration was used:  
* Graphs of 41 nodes, which are large enough to be considered secure in the scheme; thus, an attack on the graph isomorphism would involve 41! iterations, which would be unfeasible.
* Packages with 3, 4, 5, 6, 7 and 8 challenges.
* The time for these comparisons includes both package generation by the sender and unpacking the package by the user who receives it.  
The results of the comparison are shown in Table 3. The conclusion is that in general, the scheme proposed in this paper has a similar performance as the PAK scheme, and even in some cases, the proposed scheme slightly improves the results of the PAK scheme.