Abstract
Scenarios in which two nodes who distrust each other in wireless sensor networks (WSNs) would like to know the distance between them are considered. The scenario is designed to protect the private information of WSNs, in this case each node's location, from the other nodes and from a passive attacker. The goal of the present work is to provide two novel and secure two-party distance computation protocols based on a semihonest model, the first with aid of a third party and the second based on randomization technique. Both of these protocols can extend the calculated value into a real number field. The output of the distance computation and the intermediate values in the proposed protocols are also private and not accessible to a third party or any other attackers. When executing these two protocols, security is guaranteed, and the performances of communication and computation of them are found to be satisfactory when compared to those of other similar protocols.
1. Motivation
With the development of the computer and communication technologies, wireless sensor networks have gradually extended into the fabric of human society. Communications between people and things have become a reality so that many researchers have begun to pay attention to wireless sensor networks, where many techniques [1, 2] require secure authentication and secure privacy computation. This is because privacy protection is a significant research point which cannot be ignored in today's wireless sense applications. The privacy of wireless sensor networks’ entity may appear to be either a natural property or a social characteristic depending on the requirements of specific scenarios. The matter of defining privacy in terms of different applications and realizing privacy protection can be explained in detail through the following scenarios regarding secure communications.
Wireless sensor networks can usually be deployed in the enemies’ battle field to monitor military information. Once found, each node has the risk of being captured by enemies so that all nodes do not trust each other. However, these nodes have to cooperate with each other in this unreliable environment in order to complete tasks of data collection. For example, Node A decides to expand its coverage area through enhancing transmitting power in one region to obtain more sensing data. Node A also notices that Node B, possibly the adjacent node of Node A, is also expanding the coverage area of his located region. But the two nodes do not want to collect data in the same area, so they want to know whether there are overlapping areas between their respective regions without disclosing the corresponding location information, in order to avoid the danger of being captured caused by the leakage of location information. If Node A and Node B are able to calculate the distance between their respective regions in the case of keeping geographical location information confidentiality and meanwhile telling each other their respective coverage radiuses, then this problem can be effectively solved: if the distance is too close, it indicates that there is overlap; otherwise there is no overlap.
Location information becomes important and confidential in the above scenarios, though the utilization of the respective positions of two participants is the most common method for calculating Euclidean distance. In this case, secure two-party distance computation without revealing location information becomes a vital problem.
Secure two-party computation, introduced by Yao, allows two parties to jointly compute any function using their inputs in such a way that (1) the output of the computation is correct and public and (2) the inputs are not revealed to both users [3]. Secure calculation of the distance between two parties (or two nodes in WSNs) is a specific case of secure two-party computation, and it provides a solution to the scenario described above. Currently, there exist two ways of computing the distance, and both of them allow the location of each party to be kept secret. The first requires the help of a third party, and the other does not. The primary contribution of this paper is that it puts forward two novel, secure, and efficient protocols that can be used in accordance with the above two methods.
The rest of the paper is organized as follows. The next section reviews related works in the field of secure two-party distance computation. Section 3 presents the preliminaries and assumptions. Section 4 provides two novel and secure two-party distance computation protocols used in WSN, the first involving a semihonest third party and the other involving randomization technique, and their respective correctness proofs. Security analysis and performance comparisons between the proposals and previous work are presented in Sections 5 and 6, respectively. Further discussions about sensitive issues are given in Section 7. Section 8 concludes this paper.
2. Related Work
Secure two-party computation is widely used in network security protocol design to protect important information related to location, identity, and healthcare. Recently, location information during the use of location-based services (LBSs) has raised considerable concerns [12], especially in distance calculation application. Currently, secure two-party distance protocols are generally divided into three categories. The first [4–7] is established using a homomorphic encryption mechanism that serves as the secure basis of privacy protection. The second [8, 13] is established with the assistance of a third party, usually a semihonest third party. The third [14] is established with the randomization technique.
As the first type of protocol, [4] describes and analyzes a scheme for biometric authentication and it uses homomorphic encryption for secure calculation of Hamming Distance without revealing the participants’ secret information. The work [5] puts forward a secure two-party computation protocol of Euclidean distance using Paillier homomorphic encryption [11] and this protocol is implemented for private querying of face images and maintains low communication overhead. The work [6] also proposes a secure multiparty distance computation protocol, which is also designed based on Paillier homomorphic encryption without a third party. The work [7] suggests a secure, privacy-preserving opportunistic computing (SPOC) framework for healthcare emergency based on a secure scalar product protocol that can be used to design a secure two-party distance computation protocol. Pronounced computational complexity is the common weakness of secure two-party computation protocols based on homomorphic encryption mechanisms. This is difficult to use with resource-constrained outdoor wireless link networks.
In the second category protocol, two participants are unable to calculate the distance between them if there is no third party involved. The protocol in [13] involves a quantum private comparison based on the presence of a semihonest third party and it enables two parties to determine whether their information matches without revealing the specifics. The work [8] allows the participant to calculate the distance based on an honest third party for comparison of local data and simultaneously causes private values to be fully grasped by the third party, which is followed by obvious information leakage and security issues that cannot be ignored. Although intervention by a third party may improve the efficiency of computation and communication, this increases network costs. This issue of decreasing the number of secrets learned by a third party is significant here. The distinction between honest and semihonest third parties is illustrated in Section 3.2.
Broad application of homomorphic encryption mechanisms results in less use of other digital disguise techniques, such as randomization methods, which can be used to design secure two-party computation protocols. Randomized disguises obscure the real data by adding random elements to them to facilitate privacy protection. For example, [14] provides a randomization method by performing a linear transformation on the real data or a random permutation replacement of the real data to achieve a secure two-party distance computation protocol. The protocol in [9] also involves randomization method and 1 out of m oblivious transfer protocol [11]. Designing a secure and efficient two-party distance computation protocol based on randomized masquerade is mathematically difficult. Many current protocols, such as one described in a previous study [8], can only be used in integer domains and cannot be expanded into real number domains. This limits their use.
In wireless sensor networks, literatures related to privacy protection of location and distance [15] can be traced back to 2007. Actually only few literatures apply the distance computation protocols based on privacy protection to data security of wireless sensor networks. To the best of our knowledge, [16] is the first paper that uses the secure distance calculation protocol to solve location privacy in WSNs. The work [17] presents an overview of the solutions that provide source location privacy such as anonymity and unobservability, within a WSN, in relation to the assumptions about the adversary's capabilities. A location privacy routing protocol (LPR) is proposed in [18] to achieve path diversity, and, combining with fake packet injection, LPR is able to minimize the traffic direction information that an adversary can retrieve from eavesdropping. However, LPR does not provide the data-level privacy protection. The work [19] found out that Lu et al.'s protocol in [7] still has some secure flaws such as user anonymity and mutual authentication, and it presents an improved mobile-healthcare emergency system based on extended chaotic maps for applications of wireless body sensor networks (BSNs).
3. Preliminaries and Premises
3.1. Definition of Secure Two-Party Computation
There are two participants in WSNs, Node A and Node B. Node A selects a secret input x and Node B selects another one y. They hope to calculate the function
3.2. Semihonest Model
Secure two-party computation should guarantee the safety of the information even if one participant behaves deceitfully in the execution of the protocol. The attacker may perform one of two types of attacks: one is active that is called “malicious (or adversarial) model [20]” and another is passive, here called the “semihonest model.” In the malicious model, the attacker manipulates one of the participants into executing the protocol improperly. For example, the attacker may cause a participant to substitute mendacious data for real input in order to interrupt implementation of the protocol. In the semihonest model, the attacker only grasps the entirety of the information of the captive participant, including those intermediate data acquired from the other participant, and the purpose of the attacker is solely to reveal some private information, but the protocol is carried out correctly and all inputs are true. Some researchers refer to the semihonest participant as “honest but curious” [21].
Based on the above, the reliability of a third party can be defined (hereinafter abbreviated “TP”). There exist three cases. In the first case, the TP is honest, and both the participants send their secrets to the TP without worrying that the TP will leak any private information. This case is perfect but impractical. In the second case, the TP is dishonest or malicious, and neither participant believes the TP. This case is dangerous. In the third case, the TP is semihonest. The TP executes the protocol faithfully, and all kinds of intermediary data and computational results are recorded. The TP tries to make this information publicly available. In WSNs, base station or the cluster-header usually acts as the role of TP.
In the present paper, it is supposed that both participants and TP all follow the semihonest model. Generally, the semihonest secure two-party computation model can be illustrated in detail as follows. This can be used in security proofs of protocols.
There exists a mapping function
Generally, if there exists a probabilistic polynomial-time algorithm (denoted by
3.3. Definition of Distance
There are many definitions of distance between two participants, including the Minkowski distance, Hamming distance, and Levenshtein distance [22]. The Minkowski distance is the most common one. It can be expressed using
In this paper, the Euclidean distance between two participants is calculated exactly in the two proposed secure protocols.
3.4. Privacy Measure
Most researchers use the “calculation of indiscernibility” method to realize security proofs, but this method cannot quantify privacy. If it is necessary to prove that one protocol is absolutely secret (perfect zero leakage), privacy measures become essential because it can validate safety of protocols against attackers more efficiently. However, currently there is no common method of measuring privacy. Although the utilization of information theory can quantify privacy, it has limitations [23, 24]. Specifically, it is only available for the protocols whose input has a linear relationship with output. It cannot be applied to nonlinear protocols.
Several symbols and concepts regarding the measurement of privacy are given below. These were used to confirm the validity of the proposed protocol.
Relative privacy is believed to be more likely to reflect the degree of privacy divulgence than the absolute privacy, and it can be standardized to a value between 0 and 1 where 0 represents full leakage and 1 indicates perfect safety (perfect zero leakage).
Theorem 1 (see [23]).
Consider that
4. Two Novel Secure Two-Party Distance Computation Protocols
4.1. Description of the TPEDP Protocol
In this section, a novel third party-based Euclidean distance protocol (abbreviated TPEDP) is used to securely calculate the distance between two participants of Node A and Node B. Based on semihonest model, the TPEDP is divided into three phases: the input phase, computation phase, and output phase.
Input Phase. Node A selects a secret vector
Output Phase. Through two-party calculation,
Computation Phase
Step 0. The TP (a third party, i.e., a base station or a cluster-header) randomly generates two vectors,
Step 1. Node A receives
Step 2. Node B computes
Step 3. After receiving
Finally, Node A and Node B determine the distance
Proof (correctness proof).
The TPEDP can achieve the correct result of Euclidean distance between two participants.
Proof.
The arithmetic expression of (6) can be expanded as follows:
4.2. Description of the REDP Protocol
Some outdoor wireless sensor network environments do not allow the existence of a reliable third party, so the two nodes must complete security distance calculation relying only on each other. A randomization technique is used to avoid the high computational complexity produced by homomorphic encryption, and the design of an efficient two-party protocol is described in this section. It is here called the randomization-based Euclidean distance protocol (abbreviated REDP). The difficulty of designing REDP is that it requires randomly camouflaging vectors in the domain of real numbers and it involves exchanging some elements within those modified vectors.
It can be supposed that Node A and Node B are semihonest participants and operations in input and output phases of the REDP are identical to those of the TPEDP. Then only the steps of computation phase are displayed as follows.
Computation Phase
Step 1. Node A generates a random sequence
Step 2. Node B constructs two fresh vectors
Step 3. Node A determines the value of m on the basis of (16) and sends it to Node B:
Step 4. Node B obtains the value of v according to
Finally, Node A and Node B share the value of
Proof (correctness proof).
According to (16), (17), and (18), (19) can be deduced:
5. Security Analysis
5.1. Security of the TPEDP Protocol
In this section, the security of the TPEDP protocol is proven. Node A and Node B cannot learn any private vectors from each other except for the distance between them. This provides a detailed analysis of each step of the TPEDP.
In Step 0, the TP receives no reply from either Node A or Node B, so it cannot gain any information from either of the two participants. In Step 1, Node B learns In Step 2, Node A receives s, which is the result of scalar products for In Step 3, owing to adding stochastic number v into (6) by Node B, Node A cannot hold the final result by itself. It means that u is only available to Node A and v is only available to Node B. For any one participant, (8) has two unknown quantities and an infinity of solutions. In this way, neither Node A nor Node B can deduce the value of
In summary, none of the information is compromised during communications among Node A, Node B, and TP. In order to render the procedure of security analysis more convincing, the calculation of indiscernibility method was adopted for further validation.
Theorem 2.
The TPEDP (marked with
Proof.
Because both Node A and Node B are semihonest participants, it is necessary to prove, in the TPEDP, that the intermediate information obtained by the passive attacker cannot be differentiated from those produced in no-attack and real situations, that is, calculation of indiscernibility.
A simulator must be constructed to imitate all of information acquired by a passive attacker in the executing process of the TPEDP. It can be discretionarily determined whether Node A or Node B is captured by the attacker. For this reason, the simulator
Input Phase of
Computation Phase of
In Step
In Step 2, Node A receives s and
In Step 3,
Output Phase of
However, in each of the steps outlined above, all of the data (denoted by
Likewise, if the attacker suborns Node B, then the attacker will gather all information in Node B's possession using another simulator,
If the attacker captures the TP, then the attacker cannot realize the simulation because the TP has not obtained any information from Node A or Node B at any point in the protocol.
This proves Theorem 2.
5.2. Security of the REDP Protocol
Node A and Node B cannot obtain any private vectors from each other except for the distance value between them. The following is a detailed analysis of each step in the REDP process.
(1) In Step 1, Node B receives some data from Node A, including
(2) In Step 2, Node A encounters the same problem with respect to solving a group of nonlinear equations. In extreme situations (e.g., if Node B selects
(3) In Step 3, if Node B utilizes the expressions of (13), (14), and (15) to successively substitute for the values of
(4) The security analysis in Step 4 of this process is the same as the analysis in Step 4 of the TPEDP.
In order to make the above security analysis more persuadable, it must be proven that the intermediate information obtained by a passive attacker and that produced in no-attack and real situations involve the “calculation of indiscernibility.”
Theorem 3.
The REDP (marked with
Proof.
Because of the premises and assumptions of the simulator and because the process of the input phase of the REDP protocol is similar to that of the TPEDP protocol, the validation procedures of computation and output phases may be paid more attention. It can still be supposed that the passive attacker captures Node A and constructs the simulator
Computation Phase of
In Step 2, because Node A does not know the real
In Step 3,
In Step 4,
Output Phase of
The same conclusion can be drawn if the participant captured by the attacker is Node B.
This proves Theorem 3.
6. Efficiency Analysis and Comparisons
In this section, the complexity of communication round is analyzed, and the complexity of computation and the type of data involved in various protocols are also evaluated. These protocols obey semihonest execution rules and their objectives are to determine the result of secure distance computation. One of these protocols in previous study [4] is based on homomorphic encryption, called “Rane's Scheme.” A similar scheme [5], in which Rane's Scheme was improved upon, is called “Rane's Improved Scheme.” Another previous study [8] proposed two kinds of secure two-party closest-pair of points protocols. The first one comprised the computation of distance aided by a third party, and the distance computation procedure can be separated from the protocol itself and called “Huang's 1st Scheme.” The second one was designed according to discrete logarithm principles without any third party and could be used to realize secure two-party distance computation, called “Huang's 2nd Scheme.” Luo's Scheme, Lu's Scheme, and Li's Scheme are introduced, respectively, in [6], [7], and [9] in the Related Work section. Lu's Scheme only realized a scalar product protocol, but, through it, a distance calculation protocol can be simulated at no extra cost. Table 1 lists the results of a comparison of the protocols given above from several perspectives.
Secure two-party distance computation protocols.
(a) Communication Round Complexity. As shown in Table 1, communication round complexities of those protocols are almost roughly the same level except for Li's Scheme, which includes many communication steps. Rounds of communication in Lu's Scheme, Rane's Scheme, and the Rane's Improved Scheme are determined by the dimensions of the input vector. However, the dimensions of location information must be less than or equal to 3. Even if there is a third party, the TPEDP can be completed within two rounds, but the REDP has a total of four steps and three rounds of interaction, so the complexity of communication round is 3.
(b) Computation Complexity. As shown in Table 1, the overhead of these protocols to generate random numbers can be ignored because that can be addressed in the input phase. The complexity of computation is primarily produced during the computation phase of those protocols, including the TPEDP and REDP. Both of these protocols rely on the dimensions of input vectors, so the computation complexity of them are both
Some protocols based on Paillier additive homomorphic encryption can be used to perform
(c) Type of Data. Rane's Scheme shows satisfactory performance with respect to the complexity of rounds of communication, but the types of data that it can process are limited to integer field. Huang's 2nd Scheme shows the same defect. The two proposed protocols have a broader range of computation because they can be implemented in real number domains.
(d) Degree of Privacy Protection. The TP of Huang's 1st Scheme holds all the information from both participants, so there is no privacy protection at all. Li's Scheme, which is based on oblivious transfer protocol and involves no TP, has a primary disadvantage that one participant may acquire all results of distance computation and deduce some private information of the other participant. In this case, if one participant can obtain all three distances from three different starting points to the same terminal point, the exact location of the other participant can be calculated. For example, as shown in Figure 1, if Node A holds

Deduction of location.
Both the TPEDP and REDP use a result-sharing mechanism in which two participants can determine the distance calculation results until publishing their respective random numbers (u and v). This prevents the privacy leakage that can be caused when one participant monopolizes the results. In Section 7.1, especially, it can be proven that the TPEDP protocol's degree of privacy is 1, that is, the perfect zero leakage.
7. Further Discussion
7.1. Privacy Measurement Problem of the TPEDP Protocol
Not all protocols can be carried out and used to measure privacy; only those that always satisfy linear dependence between their inputs and intermediate messages can be evaluated for the degree of privacy by using the methods recommended in Section 3.4. In this way, only the TPEDP protocol meets the requirements outlined in this paper. In the TPDEP protocol, the impact of TP can be completely ignored, because it only distributed some initial values but did not receive any valid information from either of the two participants.
During the running of the TPDEP protocol, all messages received by Node A can be denoted by
Next, the degree of privacy is examined from Node B's perspective. All messages received by Node B can be denoted with
The expressions of q and
Here it is assumed that
Based on the information given above, the following conclusions can be drawn.
Theorem 4.
The result of privacy measure for the TPEDP is
7.2. The Repeated Calculation Problem of the REDP Protocol
Repeated calculation problem is worth emphasizing. It merits attention from both of the participants in the REDP protocol. An erroneous choice of participants may lead to a serious reduction in privacy. If Node A and Node B meet again after they have executed the REDP protocol at least once, then, during the new execution, the REDP protocol requires fresh initial vectors and random numbers distinguished from those used in the last calculation. A specific example can be cited and used to illustrate this issue, but discussions are not limited to this example.
Node A and Node B, who held initial vectors
For this reason, extra limitations must be added to the REDP protocol when it is encoded into the wireless communication devices. This can prevent some extreme situations such as selecting
7.3. Availability in Wireless Sensor Networks
It is necessary to verify the availability of TPEDP and REDP in wireless sensor networks. We design such simulation experiments related to distance to observe the changes of network lifetime and energy consumption in the following three scenarios: the first is calculating the distance between Nodes A and B which use the REDP protocol; the second aids TPEDP to achieve the distance calculation (the current cluster-header is “TP”); and the third is based on ECC (elliptic curves cryptography), which is considered as the most lightweight public key method in WSNs, to realize the computation through encryptions, decryptions, and the reliable third party (the base station). To achieve the data-level privacy protection, in the third scenario, Nodes A and B must encrypt their locations separately using the public key of the base station, and the base station decrypts them and calculates the distance between Nodes A and B, and then the base station must encrypt the distance value by their respective public keys and send it to A and B. Finally, Nodes A and B decrypt it and obtain the result. If A and B cannot communicate with the base station within one hop, this method will cause heavy network loads.
In order to ensure the validity of comparisons, we make some assumptions aimed at the three scenarios. Shown in Figure 2, any two nodes who want to calculate the distance between them in the network can form a group; once a node joins one group it will not be able to join other groups, except the death of the other node in the same group, it will find a new single node with the same situation again to form a new group. In our simulation experiments, nodes would prefer to search the closest neighbor to form a group. All groups repeatedly calculate the distance between two members, until the network life cycle is ended. The base station, especially, does not participate in any group and all packets are in the same size which can be divided exactly by 16. Leach protocol will be used as the clustering and routing protocol in order to ensure path accessibility. If one current cluster-header is dead, it will reselect the new header in terms of Leach protocol. In TPEDP protocol, the same cluster-header can act as the TP for several groups of nodes. Detailed simulation parameters can be shown in Table 2.
Simulation parameters setting.

Three simulation scenarios.
We set two cases “

Comparisons of network lifetime among REDP, TPEDP, and ECC.
7.4. Extended Multiparty Computation
The flexibility characteristics of the TPEDP and REDP protocols make them conveniently transform from two-party distance computation to multi-party distance computation. We suppose that there are totally m nodes in WSNs, and they can be denoted by
The details of calculation are determined by the specific protocol. If
8. Conclusions
Wireless sensor networks make communication and computation between humans and other things become a research hotspot. Two novel secure two-party protocols for distance computation are presented in this paper, designed to address the scenarios of privacy-preservation of location information in an encounter between Node A and Node B. The first proposed protocol, the TPEDP, involves a semihonest TP that protects the location of all participants from a passive attacker inside or outside the network. The problem of nonexistence of a suitable TP in wireless sensor networks was considered. The second protocol lacks a third party. The REDP, which benefits from randomization method, can be used to acquire the correct results of distance between two nodes securely. Compared to the similar protocols, the two proposals, TPEDP and REDP, performed more satisfactorily on the efficiency including rounds of communication, computation, and data type.
However, the assumption of the semihonest model is only suitable for certain scenarios, those that can resist only passive attacks. Some protocols secure against the malicious adversary model have been proposed especially for privacy-preserving data applications [20, 25]. However, these techniques are expensive in both communication and computation costs. In the future, the design of efficient protocols that can resist active or malicious attacks may remain challenging.
Footnotes
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
The authors would like to thank the anonymous reviewers of this paper for their objective comments and helpful suggestions while at the same time helping the authors to improve the English spelling and grammar throughout the manuscript. This research was supported by National Natural Science Foundation of China under Grant nos. 61373138, 61170065, 61202355, 61201163, 61272422, and 61300240, Scientific and Technological Support Project (Industry) of Jiangsu Province under Grant no. BE2012183, Natural Science Key Fund for Colleges and Universities in Jiangsu Province under Grant no. 12KJA520002, Postdoctoral Foundation under Grant no. 2013T60536, and Science and Technology Innovation Fund for Higher Education Institutions of Jiangsu Province under Grant no. CXLX13_467. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the paper.
