1. Introduction
The integration of new technologies has revolutionized the way many sectors operate and the quality of their services. Wireless Sensor Networks (WSNs) and the Internet of Things (IoT) connect the physical world with digital infrastructures, transforming massive amounts of data into valuable information and enabling different users to access devices. WSNs consist of numerous small sensor nodes with limited computational power and battery life. Sensor nodes often monitor phenomena directly tied to the physical world. A sensor may periodically transmit data about the location of a high-value shipment, a biomedical node may send sensitive health measurements, or a security node may detect movement in a specific area. If an adversary monitors network traffic and can associate packets with a particular node, its owner, or its geographic location, they can extract critical information about personal activities or target physical infrastructures and resources. Sensor nodes are considered an easy target for attackers because they typically lack tamper-resistant mechanisms. Consequently, an adversary can use power analysis techniques to extract parameters stored in the node’s memory and exploit them during key negotiation with other nodes, pretending to be a legitimate sensor node.
While extensive research has been conducted on authentication and key management in WSNs, existing protocols still face significant limitations. Many rely on pre-distributed keys, static credentials, or trusted gateway nodes, which creates single points of failure and limits resilience against node capture and insider attacks [
1,
2]. Multi-factor and hardware-assisted schemes, including those leveraging PUFs and fuzzy extractors, improve security but often introduce high computational or communication overhead, suffer from environmental sensitivity, or lack robustness and reusability [
3,
4,
5,
6,
7]. Moreover, public-key approaches remain impractical for resource-constrained sensor nodes due to energy and processing limitations [
1,
2,
3]. The design of secure and efficient authentication protocols must meet not only security and privacy requirements but also usability demands for resource-constrained devices such as IoT devices. These challenges highlight the need for authentication mechanisms that are lightweight, secure, resilient to node capture, and capable of reliably generating cryptographic keys without pre-distributed secrets, which motivates the development of a protocol that does not rely on pre-distributed keys, trusted gateways, secure channels, or computationally heavy cryptographic operations.
Our approach is an iterative, bit-flipping protocol where nodes gradually converge on a shared secret without sending the secret itself or relying on pre-installed keys. It’s lightweight, secure, and well-suited for constrained WSN environments. Building on the conceptual scheme of [
8], our work contributes:
A self-contained, implementation-ready pseudocode for the full protocol, including deterministic index sampling, turn-taking, and round synchronization,
a concrete, library-friendly 2PC design for the “half-or-more mismatches” test using a one-time base OT, IKNP OT extension, a Free-XOR + half-gates threshold circuit (no pre-distributed keys), and a fuzzy extractor with a secure sketch
theory refinements: strict-majority thresholding for guaranteed negative drift, optional sequential sampling to reduce expected k, and parameter sizing via tail bounds with a worked numeric example
engineering guidance: message and label encodings, wire formats, MAC-based key confirmation, and privacy amplification, so the interested reader can implement and experiment with the protocols without consulting other information sources.
2. Related Work
Over the years, numerous protocols have been proposed to achieve secure authentication in WSNs, evolving from simple password-based approaches to multi-factor and hardware-assisted mechanisms. The following subsections outline this progression and highlight the main contributions and limitations.
Early work focused on password-based authentication schemes mediated by a gateway node [
9,
10]. Still, subsequent cryptanalysis has demonstrated that such one-factor approaches are vulnerable to replay, impersonation, and offline password-guessing attacks [
11,
12]. Two-factor schemes incorporating smart cards were later proposed to address these weaknesses [
13]; however, they remain susceptible to card loss, insider attacks, and sensor node capture [
14,
15,
16,
17]. Many schemes, such as [
18,
19,
20,
21,
22,
23], analyzed previous cryptographic schemes, identified vulnerabilities, and proposed improved versions. Unfortunately, significant studies such as [
12,
24] have shown that most proposed solutions in two-factor authentication schemes remain vulnerable to various attacks.
This led to the proposal of a new authentication scheme to enhance the security of communication between entities in a wireless sensor network, the three-factor authentication [
25,
26,
27,
28,
29,
30]. In this approach, user authorization relies on something the user knows (their password), something the user possesses (their smart card), and something that uniquely characterizes the user (their biometric data). Due to the use of biometrics, these types of schemes offer increased resilience, as biometric data cannot be lost, forgotten, or easily compromised, and the keys generated from them are extremely difficult for a malicious actor to predict. While these approaches improve resistance against specific attack vectors, extensive analysis has shown that many such schemes still fail to ensure user anonymity, forward secrecy, or resistance to known session-specific temporary information (KSSTI) attacks [
1,
31]. Moreover, Elliptic Curve Cryptography (ECC)-based constructions, although cryptographically strong, often impose non-negligible computational and communication overhead on resource-constrained sensor nodes, and continue to rely on pre-distributed secrets that form single points of failure.
The findings regarding three-factor authentication protocols for WSNs indicate that most of these protocols rely on cryptographic techniques such as ECC and often incorporate biometric data, smart cards, and passwords (e.g., Xie et al. [
32], Shuai et al. [
33], Rangwani et al. [
34], Wu et al. [
35], Ryu et al. [
36], Yang et al. [
37], Zhu et al. [
38], Mo et al. [
39], Chhikara et al. [
40]) to achieve strong security and privacy protection. These protocols have been validated as secure through formal analyses using tools such as BAN logic, ProVerif, AVISPA, and the Real-or-Random model, as well as via theoretical and practical testing. Specifically, they demonstrate resilience against various attacks, including replay attacks, offline dictionary attacks, impersonation attacks, man-in-the-middle attacks, insider attacks, smart card theft, sensor capture, and session key compromise. However, they remain vulnerable. Some protocols, such as those by Xie et al. [
32], Shuai et al. [
33], Rangwani et al. [
34], and Wu et al. [
35], exhibit vulnerabilities in information leakage, fail to ensure complete anonymity and untraceability, or do not maintain perfect forward secrecy, as noted by Mo et al. [
39] and Hu et al. [
41]. Protocols like that of Xie et al. [
32] may also lead to rapid battery depletion due to high communication overhead. Wu et al.’s protocol was found by Mo et al. to lack three-factor security and user anonymity and is vulnerable to information disclosure attacks. Furthermore, protocols such as Shuai et al.’s are susceptible to desynchronization and stolen verifier attacks and do not provide perfect forward secrecy, according to Xie et al. [
32] and Hu et al. [
41]. To address the remaining challenges of three-factor authentication protocols, improved or new protocols have been proposed (e.g., Yang et al. [
37], Zhu et al. [
38], Mo et al. [
39], Chhikara et al. [
40]), which incorporate techniques such as fuzzy extractors, Physically Unclonable Functions (PUFs), blockchain, and solutions tailored to specialized environments.
Despite various advances, surveys in [
2,
3] indicate that most recent protocols still rely on pre-distributed secrets, static credentials, or trusted gateway nodes, creating single points of failure and limiting resilience against node capture and insider attacks. Even solutions, such as assigning a distinct key to each sensor [
1], only partially mitigate this risk, as the compromise of a sensor node can still expose all stored encryption keys [
42]. Effective authentication and key agreement in IoT systems, therefore, require a careful balance between security and efficiency. Lightweight and hybrid cryptographic techniques are widely adopted to accommodate resource-constrained devices while maintaining adequate protection. Overall, current trends emphasize the need for adaptable security designs that minimize the risk of key exposure and are tailored to both application requirements and device limitations [
2].
Hardware-assisted authentication has been widely investigated as a countermeasure against sensor node capture attacks, most notably through the use of Physically Unclonable Functions (PUFs) [
43,
44,
45]. A representative example is the protocol proposed by Lee et al. [
46], which aims to enhance security in IoT environment by addressing vulnerabilities such as ID/password guessing attacks and device capture attacks. The protocol employs three-factor authentication framework that combines PUFs with honey lists, which act as decoy entries to mislead potential attackers. However, the security of this scheme relies on the presence of a trusted gateway node. If this gateway is compromised, user identities and other sensitive information may be exposed, rendering users vulnerable to identity theft and privileged insider attacks [
47]. In addition, PUF-generated responses are highly sensitive to environmental and physical variations, which makes them inherently non-reproducible. A comprehensive comparison of authentication techniques used in IoT environments can be found in [
4]. Consequently, although PUFs are suitable for device identification and authentication with some tolerance for error, even small variations prevent their use in key generation, which requires exact reproducibility [
48]. PUF responses serve as unique device fingerprints, necessitating error-correction mechanisms for key generation [
48]. Differential design techniques can reduce environmental sensitivity [
49], but noise may still cause bit flips and false negative authentications.
To address this, fuzzy extractor-based error-correction schemes are employed, mitigating noise-induced errors without increasing false positives and improving PUF output reliability [
48]. Traditional fuzzy extractors, while secure against passive attackers, face challenges when helper data are manipulated by an active adversary or when multiple keys must be derived from correlated inputs [
7,
50,
51]. Some constructions improved security by concealing randomness rather than directly extracting it from biometric or noisy sources [
50], but they often lacked robustness or were weakly reusable [
7,
51]. Subsequent work introduced robust fuzzy extractors capable of resisting helper data manipulation and reusable fuzzy extractors that allow multiple independent key extractions from the same source without leaking sensitive information [
6]. Other schemes combine computational assumptions such as Learning With Errors (LWE), Non-uniform Learning With Errors (NLWE), Decisional Diffie-Hellman (DDH), or Decisional Linear (DLIN) to provide robust and reusable fuzzy extractors, addressing practical constraints like storage and error tolerance, although challenges remain regarding post-quantum security, uniformity of inputs, and residual information leakage [
7,
52,
53]. These advances position fuzzy extractors as a viable method for reliably generating cryptographic keys from PUF outputs or other noisy sources in real-world IoT and sensor network environments.
From the sensor side, public-key encryption systems are impractical in wireless sensor networks due to limitations in energy, processing power, memory, and communication capabilities [
8,
9,
54]. While symmetric cryptosystems are considered more suitable for such networks, as they require less computational power [
55], they still present several challenges. These include difficulties in key distribution [
8], vulnerability to node compromise that can expose a large portion of the network, limited capability to ensure anonymity and protect personal data, lack of perfect forward secrecy, and restricted support for dynamic authentication and the use of temporary identities [
12].
Pre-distributed secret information stored in sensor memory, as well as cryptographic keys managed and disseminated by gateways, inherently contain sensitive data related to communicating entities; their exposure therefore poses a serious threat to overall network security under node-capture attacks. PUF-based schemes mitigate key storage requirements but remain dependent on hardware stability and environmental conditions, while group key-agreement approaches further increase communication and revocation complexity.
In contrast to these designs, the proposed PBS-KAP protocol eliminates the need for pre-distributed long-term secrets, centralized key pools, and complex key management infrastructures, and confines public-key operations to a one-time bootstrap phase. By leveraging probabilistic bit similarity, oblivious transfer, and fuzzy extraction, our protocol achieves lightweight key agreement without storing or transmitting long-term secrets in clear form, thereby providing strong resilience against sensor node capture, compromise, and eavesdropping. When properly implemented, this approach significantly reduces energy consumption and computational overhead, enhances privacy protection, and maintains a high level of security and robustness, making it particularly well-suited for resource-constrained WSN deployments. In
Table 1, we compare our key agreement protocol with other representative protocols for WSNs.
The solution we adopt differs fundamentally from the classical symmetric or asymmetric cryptographic architectures typically used in wireless sensor networks and is based on the Bit-Similarity Key-Agreement Protocol, as proposed by Liagkou et al. [
8]. This approach allows two nodes to establish a shared secret key without requiring pre-distributed keys or the exchange of sensitive material over the network. In each round, the nodes privately compare
selected positions from their local secret bitstrings without revealing them. Only if a sufficient number of differences (majority) is detected, does a node randomly flip some bits at the corresponding positions. This process is repeated until the two strings converge, forming the shared key. The underlying intuition of the protocol is that when two random substrings from two bitstrings differ in at least half of their positions, randomly flipping certain bits in one of the substrings tends to increase the percentage of similarities between the two bitstrings. Conversely, if the substrings are already highly similar, a single flip could potentially further decrease their similarity. Once the two nodes reach a point where their bitstrings are sufficiently similar, they can generate a large set of potential keys from them, potentially applying error-correction methods to increase the number of matching bits, which can then be used for both current and future communications. At this stage, our approach integrates a Fuzzy Extractor to serve as an error-correction mechanism. This allows the nodes to reliably derive matching keys from their similar bitstrings, even in the presence of slight variations, without being hindered by constraints on reusability and robustness. In more detail, the two parties (i.e., the GWN and the sensor node) begin with independent bitstrings. Using the bit-similarity protocol, they iteratively sample positions and flip bits until their strings are sufficiently close. Once the Hamming distance between the strings is below a threshold, they apply a Fuzzy Extractor to correct residual mismatches and extract a uniform random key. This produces a final shared, secure key, without requiring pre-distributed secrets.
3. Criteria for Designing Authentication in Wireless Sensor Networks
While the existing literature largely follows a “break–fix” pattern, identifying specific vulnerabilities and proposing incremental patches (e.g., two/three-factor authentication, additional checks, or temporary nonces) to isolate attacks, these approaches ultimately collapse once an adversary gains access to the pre-distributed key. Dependence on pre-installed key material provides implementation convenience but introduces a critical single point of failure. The compromise of one node or the exposure of a shared parameter can jeopardize the security of the entire network. For this reason, our research takes a different approach, eliminating reliance on pre-distributed keys and instead focusing on mechanisms that generate secrets dynamically and are inherently resilient to node compromise and physical capture. The goal is to establish solutions that do not rely on a fixed trust anchor but remain robust under realistic attack scenarios and partial key exposure.
In an effort to break this “
break–fix” cycle, Wang et al. [
24] attempted to summarize and address all identified deficiencies and limitations. They argued that modern authentication protocols for WSNs must satisfy a broad range of criteria to comprehensively tackle all critical security and privacy issues. However, we propose the inclusion of two additional criteria: C13, “Time Efficiency,” and C14, “Network Topology.” Although the C13 characteristic is considered in many protocols, due to the nature of WSNs, which require lightweight methods, it is not yet an official criterion. Therefore, its addition would serve as an extra factor to strengthen the protocol requirements. Similarly, criterion C14 is mentioned in many proposed protocols, but is not always guaranteed. Its presence is critical because the distance between the user and the sensor often exceeds the communication range [
62].
Table 2 presents 15 independent criteria that a proper authentication protocol must satisfy in order to address security and privacy issues, according to [
1,
24], with additional new criteria included based on our own research.
In the broad criteria for evaluating authentication protocols in WSNs, criterion C5, “Resistance to Known Attacks,” includes the sensor node capture attack. In contrast, Wang et al. [
24] propose a separate criterion specifically for reducing the risk of such an attack, denoted as C15. They found that only two protocols were capable of resisting sensor node capture attacks: the protocols proposed by Li et al. [
63] and Gope and Hwang [
64]. However, regarding Li et al.’s protocol, we observed that if an adversary succeeds in capturing a sensor node, he could exploit the parameters stored in the sensor’s memory to generate a valid request to the gateway. In the case of Gope and Hwang’s protocol, according to Gope et al. [
65], the protocol does not support sensor anonymity and remains vulnerable to sensor node capture and cloning attacks.
4. Preliminaries
In this section, we present the system model, threat model, and garbled circuit optimizations.
4.1. System Model
We consider architecture to be a two-level system commonly adopted in wireless sensor networks, consisting of sensor nodes and gateway nodes. Sensor nodes collect environmental data and communicate exclusively with nearby gateway nodes, which act as aggregation and control points for the network. The gateway nodes manage communication with multiple sensors and coordinate secure data exchange within the network. Communication between sensor nodes and gateway nodes takes place over insecure wireless channels that are vulnerable to eavesdropping, replay, and impersonation attacks. Therefore, sensor nodes and gateway nodes must mutually authenticate each other and establish a shared session key before initiating secure data transmission. The entities involved in the system are described as follows:
The sensor node is a highly resource-constrained device with limited computational capability, memory, and energy supply. Sensor nodes are typically deployed in unattended or hostile environments, making them susceptible to physical capture and compromise. Consequently, sensor nodes are assumed to be unable to securely store long-term cryptographic secrets, motivating the design of lightweight and capture-resilient key agreement mechanisms.
The gateway node serves as the bridge of communication between a sensor node and a user. Compared to sensor nodes, gateways possess greater computational and communication resources, enabling them to perform more complex cryptographic operations. The gateway has general computing capacity but lacks security mechanisms.
4.2. Threat Model
Throughout this work, we adopt the semi-honest (honest-but-curious) adversary model. In this setting, each party is assumed to follow the prescribed steps of the protocol correctly but may attempt to infer additional information from its local view of the execution, which consists of its private input and random coins, the messages it sends and receives, and the final output of the protocol.
In the semi-honest model, a protocol is secure if whatever a party can learn from its real view could be efficiently simulated from its own input and output only; thus, the execution reveals no extra information beyond what is implied by the prescribed outputs. Within this work, we assume semi-honest parties and design the “half-or-more mismatches” test so that each side learns only the single bit β and nothing else about the peer’s sampled bits.
Additionally, we consider the practical deployment scenario of sensor nodes in unattended environments, where nodes are incapable of protecting the secrets stored in their memories. Moreover, we assume that an attacker may perform memory probing attacks on both gateway and sensor nodes, modeled under the Dolev-Yao adversary model [
66], where they can eavesdrop on communications, intercept or synthesize messages, and perform replay attacks. The attacker’s primary objective is to impersonate sensor nodes or compromise the established group key without being detected. We assume, however, that the adversary cannot break cryptographic primitives (e.g., hash functions, MACs).
Model separation. In this manuscript, we assume honest-but-curious (semi-honest) endpoints for the OT/GC sub-protocol privacy. Separately, we consider an active Dolev–Yao network adversary controlling the channel; our security claims for key secrecy/indistinguishability therefore hold for protocol-abiding endpoints with authenticated messages (see transcript-MAC clarification below). Full active/malicious endpoint security would require malicious-secure OT/GC and/or an AKE
Considering that sensor devices are often deployed in unattended environments, the attacker can capture the device, obtain data stored in its memory, and carry out node cloning and tampering attacks [
67].
4.3. Garbled Circuit Optimizations for Efficient Secure Computation
Our protocol relies on Garbled Circuits (GCs), allowing the participating parties to jointly compute a function on their private inputs without revealing those inputs to each other. The garbled circuit generator (garbler) generates a garbled circuit from a pre-calculated Boolean circuit truth table and sends it to the evaluator. Next, the evaluator takes the garbled circuit, evaluates it, and produces the final result. The result is then shared with the garbler. To make these circuits efficient enough for constrained devices, we employ two standard optimizations, Free-XOR and Half-Gates. The Free-XOR optimization allows all XOR gates in a garbled circuit to be evaluated at essentially zero cost. This is achieved by assigning wire labels that differ by a fixed global offset, enabling the evaluator to compute XORs simply by XOR’ing labels, instead of transmitting, storing, or decrypting any garbled tables, eliminating the cost of XOR gates. The evaluator never sees both labels of any input wire, so the global offset remains hidden [
68,
69]. We employ oblivious transfer. In a one-time bootstrap, the parties execute 256 base 1-out-of-2 OTs (κ = 128 security parameter) using an ECC-based OT scheme, thereby obtaining correlated seed values. These seeds are then used to realize a large number of OTs efficiently via the IKNP OT-extension protocol (symmetric-key only).
The P&P optimization removes the need for the evaluator to check and decrypt all ciphertexts by associating each label with a choice bit. P&P and Free-XOR operate on orthogonal dimensions: P&P supplies the per-wire selection bit used to pick the right row of any garbled table, while Free-XOR removes the need for a table for XOR gates altogether by defining correlated labels via a global offset . The Half-Gates optimization reduces data transfer in garbled circuits by decomposing an AND gate into two half-gates, thereby eliminating the need for multiple ciphertexts. For non-linear gates (e.g., AND), we still emit a small table (two ciphertexts under Half-Gates), and P&P ensures the evaluator reads exactly one entry per half without any guesses. This preserves security even though labels share the global offset Δ. Used together (and with Half-Gates for AND), they yield zero-cost XORs, two-ciphertext ANDs, and single-shot row access, meeting our goals of low bandwidth and predictable, constant-time evaluation.
In the following subsections, we recall the key ideas of Free-XOR, which are crucial to the efficiency of our construction:
4.3.1. Global Offset and Wire Labels
Choose a secret global offset
once per circuit (
is the security parameter, e.g.,
). Require that the least significant bit of
is
to support point-and-permute. For every wire
, pick a random base label
with a chosen permute bit as its Least Significant Bit (LSB), and set
Thus the two labels for a wire differ by the fixed offset , and their LSBs differ automatically.
4.3.2. Free Evaluation of XOR
For an XOR gate
the garbler sets
sends no garbled table and publishes the output label mapping only at the very end. The evaluator, who holds runtime labels
and
for inputs
, computes:
Therefore XOR gates require no ciphertexts and no hashing or decryption.
4.3.3. Half-Gates Garbling of AND Gates
The Half-Gates technique [
70] optimizes the garbling of AND gates by decomposing each AND into two half-gates, one garbled by the party holding the first input label and one by the party holding the second. Each half-gate consists of a single ciphertext, reducing the cost of an AND gate from four ciphertexts (in the traditional Yao garbling) to two while remaining fully compatible with the Free-XOR construction and the point-and-permute mechanism.
Let
,
be Boolean input wires with labels
and
where
is the global offset chosen once per circuit and lsb(
) = 1. The output wire
has labels
The garbler chooses a random base label
and constructs:
Here, is a correlation-robust hash and “·” denotes conditional XOR depending on the permute bit of the corresponding wire label. The two ciphertexts and constitute the half-gate table.
During evaluation, the evaluator, holding runtime labels
and
with hidden bits
, computes:
The resulting label corresponds to no other information about , is leaked. XOR gates remain free under the same global offset , enabling compact threshold and Hamming-distance circuits using only symmetric operations.
In the proposed PBS-Key Agreement protocol, this half-gate optimization is used inside the SecureHalfDiff routine to implement the strict-majority test over sampled bit positions. Combining IKNP OT extension, Free-XOR, and Half-Gates yields a lightweight garbled circuit that outputs only a single comparison bit while maintaining security in the semi-honest model. The integration of half-gates thus minimizes both transmission and computation overhead, making the protocol practical for resource-constrained wireless sensor nodes.
4.3.4. Point-And-Permute Compatibility
P&P is a routing/indexing mechanism that removes try-all-rows and makes evaluation work constant-time per gate. Each wire label carries a selection bit (e.g., the LSB of Given the selection bits of the two input wires to a gate, the evaluator directly indexes the single correct row of that gate’s table, without trial decryptions.
To ensure compatibility with the Free XOR and Half-Gates optimizations, we adopt a unified label format across the entire circuit. In particular, we derive as the least significant bit (LSB) of each label that can be used as the selection bit, allowing the evaluator to identify the correct row in the garbled table without any additional computational effort.
If the LSB of each encodes the permute bit, choosing makes . For an XOR gate, . Thus, the evaluator can route to the correct row without extra work.
6. Implementation Details
In this section, we present the six basic steps of the PBS-Key Agreement protocol in detail. First, we introduce the Secure Similarity Check, where the parties first establish common randomness (via JointRand), selecting the same indices without exposing their values. To limit information leakage, they reveal only a single bit indicating whether mismatches exceed a threshold (via SecureHalfDiff). Throughout this process, turn scheduling ensures only one side flips in each round, preventing conflicting updates. When mismatches are sufficiently large, conditional flipping of random positions drives the sequences toward agreement. Synchronization keeps the parties’ counters aligned despite network delays, while a loop-bound T ensures the protocol eventually terminates, with early stopping possible after a successful key-confirmation MAC.
6.1. Secure Similarity Check
As already stated, our protocol proceeds in rounds, where a round is a single iteration in which both parties compare a small, randomly selected subset of their bitstrings. In each round, both parties jointly compute whether the Hamming distance of the sampled substrings exceeds a predefined threshold. This comparison reveals only one bit of information (), which indicates whether this threshold is exceeded or not. No other information about the actual bits is revealed, preserving privacy. More formally, this requires computing mismatch bits for all sampled positions. These bits are then summed to obtain the Hamming distance . Finally, the result is compared to the constant threshold using a binary adder tree and a constant comparator.
To implement this, our protocol combines the Ishai–Kilian–Nissim–Petrank (IKNP) OT [
73] extension with efficient garbled circuit techniques. The IKNP protocol provides large batches of oblivious transfers using only symmetric cryptography, while Free-XOR and Half-Gates minimize the cost of the garbled threshold circuit. This combination ensures that our similarity check is lightweight enough for wireless sensor networks. More specifically:
IKNP OT extension: Extends a small number of base OTs (i.e., the n0 into k correlated OTs using only symmetric primitives, such as AES, SHA, and Keccak.
Garbled circuit (GC): Uses Free-XOR and Half-Gates to evaluate a threshold circuit that outputs 1 iff Hamming distance ≥ t.
6.1.1. Convergence Analysis
The core mechanism that drives convergence in our protocol is the way mismatches between the parties’ bitstrings are progressively reduced over multiple rounds. At each step, the parties do not directly reveal their bits but instead jointly compute whether the sampled substrings differ in a majority of positions. Based on this outcome, one party flips a small number of bits, introducing a corrective bias that steadily decreases the global Hamming distance. The following analysis formalizes this idea and explains why convergence is guaranteed.
Explicit drift computation: Let the sampled set have size k and contain mismatches between the parties. If a flip of size is applied uniformly at random within , then the expected change in Hamming distance is (where . Hence strict-majority triggering () gives negative drift.
The goal of each round is given the initial parties’ strings , , and the Hamming distance , in each round, a random subset of size is sampled, then the number of mismatches within that subset is computed securely, specifically with (strict majority), and the protocol outputs a single bit that equals iff , revealing nothing else and requiring no pre-distributed keys. This strict-majority threshold guarantees negative drift in mismatches, ensuring eventual convergence.
Conditioned on a fixed and a fixed flip set , with , each flipped bit decreases the Hamming distance by if it is a mismatch and increases by otherwise. With mismatches in , the fraction of mismatches is , hence Therefore, whenever we have a strictly negative drift. If the drift is . Since the protocol only flips when the secure similarity check returns “”, choosing guarantees negative drift whenever we flip.
We consider two possible thresholding strategies. In our construction we adopt the first (strict majority) as the default:
- –
Variant A (strict majority). Set . Then any flip implies .
- –
Variant B (coin flip on ties). Keep , but if , perform the flipping step with probability (e.g., ). This preserves a nonpositive overall drift and avoids slowdowns for odd .
6.1.2. Probabilistic Bounds to Prevent Unnecessary Flips
To quantify the probability that the sampled subset’s observed similarity deviates from the true global similarity between the parties’ bitstrings, we apply a probabilistic analysis, to effectively control the decision threshold and prevent unnecessary bit-flipping operations, thereby improving both convergence efficiency and communication overhead. To achieve this, we appeal to Serfling’s bound [
66], which gives concentration inequalities for sampling without replacement. Let a finite population
have mean
. Draw
items without replacement and let
be the sample mean. Serfling’s inequality states that for any
,
and the same holds for the lower tail by symmetry. A two–sided version is obtained by multiplying the right-hand side by
.
When sampling without replacement from binary populations, hypergeometric distributions arise indicator/hypergeometric special case [
74]. If
with population proportion
and
is the number of successes in the sample, then
which is strictly tighter than the sampling with replacement Hoeffding bound because of the finite-population correction factor
.
In our case, we set
and
(the global mismatch rate) to bound
. The sample mismatch count
is hypergeometric:
. By the Serfling bound, for any
,
Writing
and
, the probability that we trigger (i.e.,
) when the global rate is
is exponentially small in
:
For instance, for , :
- –
at ( below half) the bound gives
- –
at ( below half) the bound gives
Using a normal approximation to the hypergeometric/binomial tail is tighter: for and one-sided tail the -score is , yielding ; for it yields .
6.1.3. Adapting L Value for Improving Protocol Performance
Recall that we have mismatches in , the fraction of mismatches, and . A larger accelerates progress when the fraction is well above , but can overshoot near the boundary. We consider two possible ways to control . As already stated, in our implementation we adopt the conservative fixed- strategy as the default.
Conservative fixed. Pick a constant (e.g., ). Then each triggered round yields at least expected decrease under Variant A. The empirical sweet-spot maximizes expected progress, while setting still converges albeit slower.
Adaptivewith bounded leakage. As an alternative, we also introduce a single additional 2PC bit to detect a “margin” event, for a small margin parameter , (e.g., ). Then, set if and otherwise. This leaks at most one bit per round but increases negative drift when the mismatch fraction is safely above .
6.2. Turn Scheduling
If the mismatch threshold is exceeded, only one party performs flips. To prevent simultaneous flips, which could cause divergence, the protocol enforces turn scheduling. Specifically, a turn-taking rule is enforced (line 10 of phase 1:. Only the party whose turn it is flips randomly chosen bits from the sampled set , using the shared seed to ensure unbiased selection. This mechanism guarantees progress (negative drift) toward agreement while preventing oscillations or divergence.
6.3. Conditional Flipping
For conditional flipping with a conservative fixed , a subset of bits is selected in each round, and a fixed number of bits are flipped whenever the disagreement in the subset exceeds a predefined threshold. Choosing to be a moderate fraction of the subset size ensures steady progress toward agreement: when the fraction of mismatched bits is well above the threshold, flipping bits significantly reduces disagreements, while near the threshold, it avoids overshooting and destabilizing the process. Smaller values of still guarantee convergence, albeit more slowly, making the fixed- strategy a simple and reliable method for gradually aligning the parties’ bitstrings through conditional flipping.
6.4. Synchronization
To ensure that the two random selections remain independent, even though they originate from the same seed, the protocol employs distinct labels (e.g.,
vs.
) when expanding the shared seed with the pseudorandom generator. Specifically, the label
is used when deriving the subset of sampled indices S, while
is used when deriving the subset of flip positions
. After each round, both parties exchange a short control message of the form:
and wait to receive the matching
from the peer. This message serves two purposes. Firstly, it synchronizes the round counter and parameters between the parties, and secondly, it acts as a safeguard against desynchronization caused by packet loss or delays. The inclusion of
ensures that both sides are aligned not only on the indices but also on the outcome of the similarity check, thereby maintaining protocol consistency across rounds.
The actual subset sampling is carried out using either reservoir sampling or a Fisher–Yates shuffle applied to the set Both methods guarantee that every element has an equal probability of being chosen, while also being implementable with minimal memory footprint, which is essential in constrained WSN devices.
6.5. Loop Bound T
Once convergence is reached, after T rounds, both parties derive a provisional key and exchange a short MAC to confirm agreement. Theory suggests , but in practice, is ample for 128-byte keys on 8-bit MCUs. If mismatches are detected, the protocol restarts with fresh subsets.
6.6. Core Functions
To ensure clarity, in the following subsections, we present the pseudocodes of the two core subroutines used throughout the protocol:
The function JointRand provides both parties with identical pseudorandom subsets without requiring communication. It is instantiated via a pseudorandom generator seeded with the shared seed established in the initialization phase.
The function SecureHalfDiff is responsible for securely comparing sampled substrings without leaking any additional information. Specifically, it computes a single bit that indicates whether the Hamming distance of the two sampled substrings exceeds the strict majority threshold.
6.6.1. JointRand
This process refers to how two parties in our protocol independently select a subset of indices for use in each round of a protocol. They use a shared initial secret (seed) as an input to a deterministic cryptographically secure pseudorandom number generator (CSPRNG). In each round, both parties derive the same per round from a shared seed and the round index. We require a CSPRNG (e.g., AES-CTR with a 128-bit seed), ensuring that sampling is performed without replacement. The pseudocode of this function is presented below.
| Step 1: JointRand
|
|
| (no duplicates) |
| 1. |
| 2. |
| 3. do |
4. // uniform sampling: ensure the subset is sampled uniformly without replacement. Avoid modulo bias if mapping PRG bits to [0,N-1]; use rejection sampling or Fisher-Yates/reservoir sampling. |
| 5. |
| 6. then |
| 7. |
6.6.2. SecureHalfDiff
The following pseudocode describes SecureHalfDiff, a protocol that combines BaseOT, IKNP extension, and Half-Gates to securely determine whether the number of mismatches exceeds a strict majority, without requiring pre-distributed keys.
2PC/OT resources per round. In each round, for a k-bit sampled substring comparison, the evaluator requires k OT instances to obtain input wire labels (amortized via IKNP OT extension after base OTs). Base OTs are performed once per session and the OT extension expands them for all rounds. State explicitly which party is Garbler/Evaluator (e.g., GWN as Garbler, sensor as Evaluator) and whether roles are fixed.
| Step 2: SecureHalfDiff: strict-majority mismatches via BaseOT + IKNP + Half-Gates (no pre-distributed keys) |
|
|
|
|
| // ONE-TIME BOOTSTRAP (ECC base OTs; no pre-installed keys) |
| 1. if BOOTSTRAP_PENDING then |
| 2. |
| 3. BOOTSTRAP_PENDING ← false |
| // IKNP OT EXTENSION: derive k cheap correlated OTs (symmetric only) |
| 4. |
| // GLOBAL CORRELATION LABEL (garbler side) |
| 5. if role==Garbler then |
| 6. |
| // PREPARE EVALUATOR INPUT WIRE-KEYS (garbler side) |
| 7. do |
| 8. if role==Garbler then |
| 9. |
| 10. else |
| 11. |
| (one key per bit) |
| 12. if role==Garbler then |
| 13. do |
| 14. |
| 15. |
| 16. |
| 17. do |
| 18. |
|
| 19. if role==Garbler then |
| 20. |
| 21. else |
| 22. |
| // EVALUATE AND REVEAL THE SINGLE OUTPUT BIT |
| 23. if role==Evaluator then |
| 24. |
| 25. |
| 26. else |
| 27. |
| 28. |
8. Experimental Evaluation
In addition to the analytical bounds and the specifications/estimates above, we provide a software-based experimental evaluation of Phase 1 (bit-similarity alignment) and report communication, time, memory/flash estimates, and convergence statistics under multiple initial mismatch rates and noise levels. Because we do not currently have access to a full physical WSN testbed, the results below combine measured software micro-benchmarks with a conservative radio/time/energy model and are intended to validate feasibility on IoT-class devices (e.g., Raspberry Pi–class gateways and microcontroller-based sensors).
8.1. Convergence Evaluation and Probabilistic Bounds
This section refines the probabilistic behavior of Phase 1 (bit-similarity alignment). We give (i) an optional sequential-sampling view, (ii) guidance for selecting the flip parameter L, (iii) a dimensionally consistent heuristic for rounds-to-convergence, (iv) stopping rules with explicit correctness confidence, and (v) a leakage accounting bound to guide secure key-length selection in Phase 2.
8.1.1. Sequential Sampling Instead of Fixed
Instead of fixing the sample size k in advance, the similarity test can be performed sequentially in batches (k1, k2, …) until evidence for or is decisive. A standard choice is Wald’s Sequential Probability Ratio Test (SPRT), which can reduce the expected number of samples when p is far from , while preserving a prescribed error probability at the decision boundary.
8.1.2. Choosing the Number of Flips
The flip parameter can be chosen adaptively based on how far the sampled mismatch count appears above the majority threshold . For example, an optional ‘margin’ test can output a second bit indicating whether for some . When the margin bit is true, the protocol can apply a larger flip parameter ; otherwise, it applies a conservative . This increases expected progress when the mismatch rate is well above the boundary, while reducing overshoot/oscillation near
8.1.3. Rounds to Convergence Estimation
Let be the key length and let denote the mismatch rate at round , where is the Hamming distance between the two strings. Let be the probability that the sampled majority test triggers a flip-round. If the comparison bit is flipped with probability (-noise), the effective trigger probability becomes
Under a mean-field approximation in which a triggered round flips
uniformly random positions on one side, the expected change in mismatch rate per triggered round is approximately
Therefore, the expected one-round drift is
When
pt is not close to 1/2 (so
, this yields exponential relaxation toward 1/2:
. Consequently, the number of rounds needed to reduce the excess mismatch from
to a target
scales as
). This heuristic explains the observed
N/
L scaling in
Table 6 and the L trade-off in
Table 7.
8.1.4. Stopping Rules with Correctness Confidence
Because is random, observing in one round does not prove . We stop when occurs for consecutive rounds. Let If the mismatch rate were actually , the probability of a false stop due to consecutive no-trigger rounds is at most (under the standard independence approximation). Thus, for a target false-stop probability at a design point , choose
In practice, can be set to the largest mismatch rate that Phase~2 can still correct; using a conservative yields a safe stopping rule.
8.1.5. Accounting for Information Leakage and Parameter Agreement Length
Each round reveals at most one application-visible comparison bit
(and optionally one additional margin bit). Let
denote the total protocol leakage in bits over the Phase-1 transcript (e.g.,
for
-only, or
with a margin bit, where
is the number of rounds). Let
denote any other side information available to the adversary (e.g., public helper data). A conservative leftover-hash choice for the final key length
extracted in Phase~2 is:
which achieves statistical distance at most from uniform (Leftover Hash Lemma). This explicitly ties the Phase-2 key length to the measured/estimated number of rounds and the chosen leakage threshold.
8.2. Specifications and Estimation of Resource Requirement
This section outlines the key implementation aspects of the proposed protocol, focusing on message structure, cryptographic primitives, and resource considerations.
8.2.1. Message Formats and Round Transcript
The one-time bootstrap phase (Base-OT combined with the IKNP seed exchange) is handled internally by the OT/GC library and does not define any external wire formats at this stage. After bootstrap, the protocol proceeds in per-round interactions. For each round
, given the sample size
and threshold
, an index announcement occurs first, where either party may initiate the message:
Both parties independently recompute the subset using the shared seed via JointRand and verify that the results match. Next, during the secure computation phase, the parties jointly execute the SecureHalfDiff protocol using OT extension and a garbled circuit implementation of . The only application-visible output from this step is a single-bit value (as u8).
Finally, a turn-synchronization and acknowledgment message is exchanged:
Upon receipt, both parties validate the parameters to ensure consistency before proceeding to the next round.
8.2.2. IKNP OT Extension
The Ishai–Kilian–Nissim–Petrank (IKNP) OT extension expands a small number of public-key-based OTs into many OTs using only symmetric primitives. For κ-bit security, IKNP requires κ base OTs per direction. Because PBS-KAP uses OT/GC in a bidirectional manner over the lifetime of the deployment, we provision 2κ base OTs once (one set per direction) during enrollment; afterwards, all per-session work uses OT extension and symmetric cryptography.
Concretely, the extension phase uses AES in counter mode to generate the OT correlation strings, together with hashing for correlation checks. After the one-time base-OT and shared-seed establishment, no long-term public/private keys are required for subsequent sessions.
In each round, the OT-extension outputs are used as wire labels for a compact Half-Gates garbled circuit that computes the single-bit predicate (majority-of- mismatches, with an optional margin predicate). Thus, the online cost per round is dominated by the OT-extension/GC payload, not by public-key operations.
8.2.3. Memory Footprint Snapshots
The memory footprint of the protocol varies depending on the computational and memory resources. On 8-bit AVR or ARM-M0 microcontrollers with less than 32 kB of Flash and under 4 kB of RAM, an implementation of SecureHalfDiff using an oblivious pseudorandom function (PRF) combined with an equality test fits within approximately 1 kB of RAM and under 20 kB of Flash memory. On Cortex-M4 or M7 processors equipped with around 256 kB of RAM, full OT-extension frameworks such as TinyOT or EMP-OT can execute in less than 10 milliseconds per round when configured with . On more capable platforms such as smartphones or Raspberry Pi devices with over 1 MB of available RAM, general-purpose cryptographic libraries, like libscapi, are able to evaluate the Hamming-distance threshold circuit in a single step, providing efficient and scalable performance across a wide range of hardware environments.
8.3. Simulation Methodology
To evaluate PBS-KAP under controlled and repeatable conditions, we implemented a protocol-level, bit-accurate Monte Carlo simulator for the Phase-1 alignment procedure and combined it with deterministic transcript accounting and software profiling. Each simulation run initializes two -bit strings representing the parties’ initial secrets with a prescribed initial mismatch rate , i.e., an initial Hamming distance . In each round , both parties sample positions uniformly without replacement, compute the sample mismatch count , and derive the round decision bit according to the protocol rule ( when the sample indicates a majority mismatch and otherwise). When triggers an update, the simulator applies the protocol’s update action by flipping up to positions on the designated side, updating the two strings and the mismatch rate . The run terminates when the stopping rule is satisfied, namely when is observed for consecutive rounds. For each parameter setting, we repeat many independent runs and report the full rounds-to-stopping distribution (median and tail percentiles), as well as the mismatch-rate trajectories, thereby characterizing convergence behavior beyond a single average-case number.
To assess robustness under imperfect observations, we incorporate a controlled noise model and perform systematic parameter sweeps. In the default decision-noise configuration, after computing we flip it with probability , capturing transient measurement or classification errors while preserving the protocol structure. We sweep the initial mismatch rate and noise level jointly, and we also sweep the main protocol parameters , , and the stopping confidence to quantify how they trade off convergence speed, reliability of stopping, and communication overhead. All reported curves and tables are obtained from these sweeps, using fixed and documented random seeds or a deterministic seeding scheme to ensure reproducibility.
Communication, time, memory, and energy results are derived by combining measured and model-based components that reflect what would be observed on low-power IoT hardware. Communication per round and per session is computed from the protocol transcript structure; we separate (i) a one-time bootstrap cost (base OTs and setup messages, amortizable across sessions) from (ii) steady-state per-round payloads (OT-extension and garbled-circuit transfers plus small control messages), and we report totals both including and excluding bootstrap. Runtime is reported as the sum of measured CPU time for the protocol loop (sampling, decision computation, update bookkeeping) and modeled transmission time
for a selected link bitrate
; session time is the sum over rounds. Peak RAM and flash footprint are estimated from software profiling of the implementation and conservative buffer sizing for the largest per-round cryptographic payloads. Energy is reported when possible, using a standard link-capacity model derived from transmission time and radio power (and optionally reception), with all measured versus modeled quantities clearly labeled.
This methodology is a close proxy for real embedded runs in terms of the specific metrics of interest (bytes, rounds-to-stopping, and peak buffering). First, the dominant cost components in PBS-KAP are communication transcript sizes and the stochastic number of rounds until stopping; both are primarily determined by security parameters and by and are largely independent of the exact sensor CPU model. Second, communication time and energy on low-power IoT platforms are typically transmission-dominated and therefore follow directly from bytes and the link bitrate/power capacity, which can be instantiated from standard radio specifications. Third, simulation enables controlled initialization of mismatch and noise and allows thousands of independent trials to estimate tail behavior (e.g., 90th/99th percentile rounds), which is difficult to obtain reliably on physical hardware without a programmable mismatch source and extensive experimentation. Finally, any remaining platform-specific effects (constant-factor CPU overheads and OS/network stack differences) primarily influence absolute timings rather than the relative trends across parameter sweeps; these constants can be validated with a small sanity test on an IoT-class board when available.
8.4. Software-Based Prototype and Measurement Methodology
We implemented a reference simulator for Phase 1 that follows the message flow and state-machine in
Section 6. The simulator instantiates two parties (gateway and sensor) holding N = 1024-bit strings (128 bytes) and executes the sampling/threshold/flip loop until the stopping rule triggers (s consecutive non-flip rounds) or a hard round limit T. SecureHalfDiff (the 2PC predicate) is modeled as returning the correct comparison bit β based on the true sample Hamming distance; we also evaluate the effect of errors by flipping β with probability ε (β-noise). All reported convergence statistics (median/p90/p99) are obtained from Monte Carlo runs (≥400 sessions/setting). We additionally micro-benchmark the protocol control logic (sampling, mismatch counting, and flips) and use the communication/memory estimates from
Section 8.2 for the GC/OT sub-protocol.
Communication accounting. We report (a) the number of bytes per round and per session, using the wire-level breakdown from
Section 8.2. We treat the base-OT/seed establishment as a one-time bootstrap cost of 16 kB per peer-pair, and we parameterize the per-round 2PC traffic as approximately 16·k bytes (matching the ≈2 kB estimate at
in
Section 8.2.2). Control headers, nonces, and transcript authentication are conservatively set at 64 bytes per round in total.
Timing/energy accounting. Round time is dominated by radio transmission time on low-rate links; we therefore report (b) time per round and total time assuming an IEEE 802.15.4-class rate of 250 kbps, plus measured local CPU overhead. For (d) energy, we convert transmitted/received bits to energy using a representative 2.4 GHz 802.15.4 radio setting (TX/RX currents from the CC2420 datasheet [
75]), assuming the sensor transmits and receives approximately half of the per-session traffic. All these are reported in
Table 6.
8.4.1. Rounds-to-Stopping Distributions
Figure 4 shows the empirical CDF of the number of rounds until the stopping rule triggers (s = 5) for representative initial mismatch rates. As expected, sessions that start well below the flip-trigger threshold terminate quickly (no flips), whereas sessions that start above 0.5 require multiple flip rounds before the sample majority condition stops firing.
8.4.2. Parameter Sweeps (k, L and Stopping Confidence)
To quantify the trade-off between per-round cost and convergence speed, we sweep (i) the sample size k, (ii) the flip parameter L, and (iii) the stopping confidence (
consecutive non-flip rounds).
Table 7 summarizes representative points for p0 = 0.55 and ε = 1%.
8.4.3. CPU and Memory Footprint
CPU overhead. On our evaluation host (x86-64, Python 3.11), the measured control-loop cost (sampling indices, counting mismatches, and applying flips when triggered) is per round for (averaged over 20,000 rounds). For cryptographic primitives, OpenSSL reports for AES-128-CTR on 1 MiB blocks, indicating that on gateway-class CPUs the local computation is typically dominated by the radio time for the 2PC payload on low-rate WSN links.
Peak RAM/flash on the sensor. A microcontroller implementation must store the local key string (
bytes), the sampled index set (
bytes using 16-bit indices), a flip list (
bytes), plus the OT-extension/GC working buffers. Using the traffic parameterization of
Section 8.2 (
bytes per round total) and conservative single-round buffering, this yields an estimated peak RAM of
for
and
for
, excluding the radio driver and OS. The flash footprint depends on the chosen 2PC/OT library; we reserve
–
of flash for AES/HMAC, OT extension, and garbled-circuit evaluation code, which fits in common Cortex-M4/M7-class sensor platforms.
8.4.4. Quantitative Comparison with Representative Schemes
Table 8 provides a quantitative comparison against representative WSN authentication/key-agreement schemes. For external schemes, we report the wireless-sensor-side computation and communication costs as reported in a recent survey-style experimental evaluation (Yi et al., 2022) [
76] and clearly label these as literature values. For PBS-KAP, we report our measured/simulated Phase-1 costs on the same metrics (sensor-side total bits sent+received), using the median rounds at
and
.
8.5. Evaluation of Experimental Results
This section evaluates the experimental results reported in
Section 8 and clarifies how the measured/simulated costs translate into practical security and performance trade-offs. In particular, we relate the convergence distributions (
Table 6 and
Table 7) and the platform accounting (bytes/time/energy) to the comparison of representative schemes in
Table 8.
Convergence behavior. The rounds-to-stopping distribution is strongly driven by the initial mismatch rate
and by the stopping confidence
. As
Table 6 shows, when
is moderate (0.40–0.45), the protocol typically terminates after 5 rounds, while in adversarial starting points (
–0.60) the median rises to 40–54 rounds and the upper tail becomes heavier. This behavior is expected for iterative bit-flipping alignment: as the two strings approach the decision boundary, the sampled mismatch statistics become noisier, and more rounds are needed to obtain
consecutive “similar-enough” outcomes. Importantly, even in these difficult cases, the protocol reduces the mismatch rate to the “correctable” region for the subsequent extraction stage.
Communication, time, and energy: For fixed
and security parameters, the protocol’s per-round communication cost is essentially constant because each round executes one privacy-preserving similarity test (
) with a fixed transcript structure. In the representative configuration (
), this yields 2112 bytes per round (
Table 6). Total session traffic, therefore, scales linearly with the realized number of rounds and includes a one-time bootstrap of 16 kB for base OTs; when the bootstrap is amortized across sessions, the online cost is reduced accordingly (
Table 6 and
Table 7). In low-power radios, transmission dominates the energy consumption, so the energy estimates closely track the total number of bytes; CPU-side control logic remains minor relative to the radio’s airtime.
Impact of
,
and stopping confidence: The parameter sweeps (
Table 7) illustrate the intended deployment knob set. Increasing
makes premature termination exponentially less likely but increases expected rounds (and hence bytes/time). Increasing
raises bytes per round but stabilizes the
decision and can reduce rounds by decreasing sampling variance. Increasing the flip parameter
accelerates convergence in high-mismatch settings (fewer rounds), but it also makes each corrective step more aggressive; thus
should be chosen to balance speed with the desired final mismatch margin for the fuzzy extractor. These trade-offs allow the protocol to be tuned to application-specific noise levels and key-refresh periodicities.
Interpreting the comparison in
Table 8:
Table 8 indicates that PBS-KAP has higher sensor-side communication than representative lightweight WSN authentication/key-agreement protocols. This difference is expected and does not imply inferior design: PBS-KAP targets a stronger goal under different assumptions. Specifically, it (i) performs privacy-preserving similarity testing via 2PC (OT extension + garbled circuits), which intentionally reveals only a single comparison bit
per round, and (ii) avoids reliance on pre-distributed long-term secrets on the sensor. Many lightweight schemes optimize for a few-message exchange given stored secrets (or device-specific assumptions), and therefore their reported cost cannot be directly compared on an “equal-goal” basis.
Consequently, the additional overhead of PBS-KAP should be viewed as the price of the following properties, which are not simultaneously provided by the compared protocols and are directly aligned with the criteria set in
Table 2 (notably C12 and C15):
Capture resilience without long-term secrets on the sensor: Compromising a node does not reveal a global master key or key pool and does not automatically enable impersonation across the network.
Bounded and quantifiable leakage during agreement: Each alignment round reveals at most the comparison bit (plus fixed-size control metadata), allowing the final extracted key length to be conservatively adjusted.
Privacy-preserving alignment: Beyond and termination, the gateway does not learn the sensor’s raw string or sampled substrings, mitigating honest-but-curious infrastructure exposure.
One-time public-key cost: The expensive base OT can be executed during provisioning; subsequent sessions use OT extension and symmetric primitives only.
Tunability and graceful degradation: The explicit parameters () enable systematic trade-offs between overhead and reliability, and the protocol continues to function under higher noise/mismatch at the cost of more rounds rather than failing outright.
Practical implications: For deployments where node capture is plausible and long-lived keys are unacceptable, the extra handshake traffic is exchanged for localized compromise and quantifiable leakage. Moreover,
Table 6 shows that for typical mismatch levels, the median session cost is far below the worst-case, and the bootstrap can be amortized across multiple key refreshes. This makes PBS-KAP attractive for scenarios where key agreement is performed infrequently (e.g., at enrollment, after resets, or periodically at long intervals), while still maintaining robust behavior under noisy measurements.
Opportunities for optimization: Our evaluation emphasizes reproducibility over micro-optimizations. The dominant cost is the 2PC component; therefore, implementing OT extension and garbling in optimized C, reusing setup where possible, and batching multiple evaluations per OT-extension instance can reduce both runtime and energy without changing the protocol logic. These optimizations are orthogonal to the convergence behavior and can be incorporated in future hardware-level evaluations.
9. Discussion
Our protocol is constructed to be lightweight, secure, and practical for deployment in wireless sensor networks. It employs bit-flipping rounds, secure similarity checks, and fuzzy extraction with secure sketches, thereby eliminating the necessity for pre-deployed keys, minimizing dependence on costly public-key operations, and restricting the exposure of information during key agreements. The integration of IKNP OT extension with Free-XOR and Half-Gates garbled circuits facilitates efficient execution of similarity checks, even on resource-constrained devices. Furthermore, privacy amplification through hashing ensures that even minor discrepancies in intermediate bitstrings prevent adversaries from deducing the final key.
In particular, with respect to real-world feasibility on WSN links, on an IEEE 802.15.4-class radio (250 kbps), the dominant cost of PBS-KAP is communication airtime rather than local computation. In the representative configuration (e.g.,
), the per-round packet is about 2112 bytes, so total session traffic scales with the realized number of rounds plus a one-time (around) 16 kB bootstrap (base OTs) that can be amortized across multiple key refreshes. Using the same 250 kbps link model, the measured/simulated sessions in
Table 6 fall in the sub-second to few-second range (about 0.86 to 4.17 s) across the evaluated mismatch regimes), with corresponding radio-energy estimates on the order of 0.047 to 0.227 J under a standard 802.15.4 radio configuration. With respect to feasibility on sensor-category MCUs, the protocol is designed in a way that expensive public-key work is confined to provisioning/bootstrapping, while steady-state rounds use symmetric primitives plus OT extension and a compact threshold circuit. In terms of embedded information, the sensor stores only the local
-bit string plus small per-round index/flip lists and OT/GC buffers. For very constrained nodes (e.g., 8-bit AVR/ARM-M0 with less than 4 kB RAM and less than 32 kB Flash), a PRF+equality-test style SecureHalfDiff implementation can fit in, around, 1 kB RAM and less than 20 kB Flash. Also, for more capable Cortex-M4/M7-class devices, OT-extension frameworks can execute in the millisecond range per round for typical values for
.
Finally, since our implementation targets only the communication between the gateway node (GWN) and the sensor, the protocol directly satisfies criteria associated with secure sensor-node key agreement, resistance to known attacks, mutual authentication (if Authenticated Key Exchange or malicious-secure OT/GC is added), forward secrecy, time efficiency, and protection against sensor capture, while user-related criteria are outside the scope of this study. However, as future work, we aim to extend our work to also cover communication between the user and the GWN.
10. Limitations and Future Work
The proposed protocol is explicitly designed to operate within the constraints of typical wireless sensor network hardware, including limited processing capability, restricted memory, and limited energy availability. The protocol minimizes reliance on public-key cryptography by confining expensive operations to a one-time bootstrap phase, after which only symmetric primitives, lightweight oblivious transfer extensions, and bounded-size garbled circuits are used. This design choice significantly reduces per-session computational overhead, making repeated key refresh operations feasible on low-power devices. The convergence behavior, which scales as ), allows the protocol to be customized to the resource constraints of a given deployment by tuning the flip parameter and stopping confidence. Moreover, the protocol’s execution in discrete, independent rounds, without the need for continuous connectivity, seamlessly aligns with the energy-efficient sleep–wake scheduling commonly utilized in WSNs.
The security analysis under the semi-honest model does not cover active or malicious behavior (e.g., deviating from the algorithm, sending inconsistent messages, selective-failure attacks, or aborting strategically). These behaviors fall outside the semi-honest model and are left as future work. Strengthening the protocol against such threats would require integrating malicious-secure OT extensions, authenticated garbled circuits, and cut-and-choose or dual execution techniques. While this would increase computational and communication costs, it would preserve the high-level structure of the protocol.
Furthermore, the current limitation of this study is the absence of implementation on physical sensor hardware. While the protocol and its underlying cryptographic mechanisms have been fully specified and evaluated algorithmically, performance metrics such as execution time, energy consumption, and empirical memory usage remain unmeasured in real-world environments. As future work, we plan to undertake a two-phase validation strategy. First, a software reference implementation will be developed using standard toolchains and libraries (e.g., libOTe or EMP-toolkit for secure computation components and micro-ECC for ECC primitives) to obtain cycle-accurate profiling and communication overhead in simulation. Subsequently, the optimized implementation will be ported to representative IoT platforms such as Arduino MKR series, ESP32, and STM32 Cortex-M4, guided by the resource estimates presented in
Section 8.3. Another area for future work is the enhancement of side-channel resilience, for instance, against power analysis or fine-grained timing attacks in real-world deployments. Additionally, the protocol assumes synchronized rounds and reliable communication, adapting it for highly asynchronous or lossy networks may require extra mechanisms for round alignment and error recovery.