Abstract
Secure key distribution is one of the most important building blocks to ensure confidentiality in wireless sensor and actor networks (WSANs). However, the key distribution becomes a challenging task when keys have to be relayed by compromised nodes in order to establish secure communication between distant nodes. To deal with this issue, we propose in this paper a key distribution scheme, named key distribution using fragmentation and assimilation (KDFA). In this scheme, the sender node splits the actual key into fragments and sends them through intermediate actor nodes towards the receiver node. The latter assimilates these key fragments using XOR operation to reconstruct the actual key. In this case, attacker cannot retrieve the actual key and only gets the key fragment. KDFA is composed of two parts: (a) key distribution protocol (KDP) to distribute the key using intra-actor and interactor communication scenarios and (b) key fragmentation algorithm (KFA) to slice the key using binary calculations. KDFA execution has been specified and formally verified using Rubin logic. Moreover, the performance and the resilience of the proposed protocol are further analyzed through extensive simulations using ns-2.35. Results show that KDFA is resilient against actor node compromise and key exposure.
1. Introduction
A wireless sensor and actor network (WSAN) is a distributed system of sensor and actor nodes that are interconnected through wireless links [1, 2]. The sensor nodes gather information about the environment such as temperature and vibration and send them a base station (or sink) using a hop-by-hop communication. On the other hand, the actor nodes perform actions in response to some specific events. Such networks are widely used in applications like buildings/house monitoring [3], water sprinkling on fire detection [4], surveillance and intruder detection, traffic monitoring, health and habitat monitoring, and so forth [5, 6]. Actor nodes play a vital role at taking actions to change the behavior of the environment by analyzing and responding to the events [7]. They also communicate with ordinary sensor nodes to collect data as shown in Figure 1.

Communication scenarios in WSAN.
Secure key distribution in WSAN is mandatory because most of the applications require confidentiality of data exchanged between nodes located in different regions [8, 9]. In the literature, some secure key establishment schemes have been proposed to enhance security and ensure confidentiality. In existing symmetric key management schemes [10–12], if a node is compromised then the new key distribution messages passing through that node are also compromised. Therefore, the links are compromised before their establishment, and it is not possible to establish end-to-end key between the sender and the receiver as messages can be decrypted and then reencrypted at the intermediate nodes. An intermediate malicious node can interpret these keys and help other malicious nodes at joining the network using valid keys. The problem becomes more complex when indirect keys are exchanged between distant nodes in different regions because more intermediate nodes are involved and the probability of the key to be relayed by malicious intermediate nodes increases.
In the existing key distribution schemes, all the keys that pass through compromised nodes also become compromised. The issue studied in this paper is how to exchange secret keys among distant nodes in the presence of malicious intermediate nodes. To deal with this issue, we propose a key distribution using fragmentation and assimilation (KDFA) scheme for establishing indirect keys between two distant sensor nodes. The main contribution offered by KDFA is that the sender node slices the actual key into fragments and sends them via intermediate actor nodes towards the receiver node. The distant receiver node assimilates the key fragments using XOR operation to obtain the original key. In this case, the attacker can only get the key fragment because the original key is never transmitted. The condition for successful attack is to capture all the fragment key packets related to one key, which is not a trivial task. If an attacker succeeds at identifying the intermediate nodes and subverting the key fragments then only one key is exposed. Therefore, KDFA is expected to provide better secure key distribution scheme and achieve better resilience against malicious nodes in comparison to other schemes.
KDFA is composed of two parts: (a) key fragmentation algorithm (KFA), which divides the keys of different sizes into an appropriate number of key fragments, and (b) key distribution protocol (KDP) provides a stepwise description for exchanging secure messages to distribute pairwise keys. In addition, we have formally specified and verified KDFA using Rubin logic [13]. The latter validates the protocol as per standard requirements of cryptographic operations like authentication, message integrity, message freshness, encryption, decryption, and so forth. It also helps at identifying the deficiencies in the protocol and possibilities of node compromise attacks, and it is also near to real implementation. KDFA is further simulated under ns-2.35 to assess its effectiveness in terms of resilience against compromised nodes. Results show that two uncompromised nodes can distribute a key securely even if a large number of intermediate nodes are compromised.
The rest of paper is organized as follows: system model and problem statement are provided in Section 2. Section 3 presents related work. Section 4 details KDFA operations for key distribution. Section 5 provides a detailed formal specification and analysis of KDFA using Rubin logic. Simulation scenarios and results in terms of resilience, fragmentation computation, and communication overhead are given in Section 6. Finally, Section 7 concludes the work and outlines future research directions.
2. System Model and Problem Statement
We consider a model of WSAN, in which the nodes composing the networks (i.e., sensors, actors, and the sink) are randomly deployed in the network field. We assume that each actor knows the keys of all the sensor nodes in the network and can move around within the network field to collect data from sensors. We also assume that nodes within communication range of each other have already established keys among them.
During indirect key establishment between ordinary distant nodes, the sender node transmits a pairwise key via intermediate nodes. The message that contains a new key is encrypted by the preestablished key between the sender and the intermediate node. The latter decrypts the key and then reencrypts it using the preestablished key with the next intermediate node and so on. By following the same process, the new key reaches the receiver node. The problem in this scenario is that any new secret key is available to intermediate nodes in a plain text form. If one of the intermediate nodes is compromised then that key is compromised before its establishment. Similarly, future key passed through that nodes become also compromised. The same problem holds in [10–12, 14–17] for WSN and [9, 16, 18–20] for WSAN.
This allows the attacker to perform illegal activities by either code alteration or falsifying the broadcast messages. New indirect keys can also be established with that malicious node. An adversary can also introduce new node to the network by preloading the compromised keys onto it along with a duplicate ID of a sensor node that was expired by the attacker. This new duplicated node can receive the packets destined for the actual node. In a similar way the situation can be worse if a large number of new compromised actor nodes are introduced to the network.
3. Related Work
Key management schemes have been extensively investigated in the context of indirect key establishment between nodes in WSNs and WSANs. In this scenario, a symmetric key is transmitted by the sender node to the receiver node using intermediaries. Intermediate nodes in the literature are called agent [15], gateway [10], bridge [12], or proxy [17]. These nodes play a vital role for intercluster communication in WSN. We will use the name gateway to represent such nodes. Also, the similar role is played by actors for indirect key establishment in WSAN [9, 16, 18–20].
3.1. Gateway Node Based Schemes
Zhou et al. [15] provided a pairwise intergroup key distribution scenario where an agent node pair is used to share keys between senders and receivers. This scenario is depicted in Figure 2 where the sender node n2 sends the message via an agent node pair n7 and n23 to the receiver node n30. This scheme uses an agent pair to transmit a single key whereas in our proposed scheme (i.e., KDFA) actor pairs are used instead.

Interagent key distribution.
Addya and Turuk [10] proposed a scheme, which required the gateway node to set up an intergroup path key between nodes of two clusters. A single node is acting as a gateway node instead of a node pair because it has shared keys of both clusters. This node should be located at a common region of two clusters similar to the locations of nodes 5, 11 as illustrated in Figure 3. Intercluster communication between cluster 1 and cluster 2 is established through node 5. There could be multiple gateway nodes in a common region. The scheme uses a gateway node to transmit a single key which is similar to the intra-actor communication scheme proposed in KDFA.

Intercluster communication using gateway nodes.
Zhou and Fang [21] proposed a symmetric polynomial based scheme where polynomial shared keys are preloaded in each sensor to calculate the direct key after deployment. Nodes located at the junction of two clusters receive two polynomials and can play the role of gateway. To achieve satisfactory level of security, coefficient degree must satisfy (1) where
In this scheme, if a new node joins the network or existing node leaves the network then new polynomial is calculated to refresh the existing keys. It requires a large amount of communication overhead. It could be reduced by adopting XOR based key freshness scheme [22] where a magic word is shared among all member nodes to refresh the key in an efficient manner.
Huang's scheme [14] mitigated the effects of compromised nodes by applying the Reed-Solomon encoding scheme to divide the seed of a key into n codewords and transmit each codeword via different node-disjoint path. KDFA applies the idea of partitioning on indirect keys as in [14]. However, instead of using some encoding scheme, it just uses a lightweight fragmentation mechanism to partition the key into small-sized fragments.
3.2. Actor Node Based Schemes
Du et al. [9] proposed a distributed key establishment scheme for WSAN, in which actors are preloaded with symmetric keys and public key certificates as well. After deployment, node A can request from its neighbors to sign its certificate where an actor can also be one of the signers. Neighboring nodes sign the received certificate by using their self-generated private key
Mármol et al. [19] proposed WSANRep to maintain node reputation to detect the malicious nodes and exclude from the network. Global reputation of a network WSAN
j
can be calculated by a group
Kashi and Sharifi [23] illustrated a categorical comparison for weak coordination and connectivity between actors and sensor nodes. It recommends that powerful actor nodes can help sensor nodes in routing and forwarding data to the sink. KDFA provides a strong resilience to protect the key exposure at intermediate compromised nodes. Interactor connectivity is the mandatory part for this communication; therefore, connectivity restoration [24–26] should also be considered to achieve sustainable communication and coordination [27] in different regions using actor nodes.
Y. Lee and S. Lee [20] proposed a scheme to establish pairwise keys between two sensors and between sensors and actors for secure communication in WSAN. A region key is also distributed by actor nodes to its neighboring sensor nodes for a specific task and keys expire after a fixed time quanta. Public key cryptography was proposed only for upper layer communication between actors and the sink nodes. Key distribution through public key cryptography is an expensive task in terms of computation and a central KDC could be a single point of failure. KDFA does not require a KDC and it ensures secure key distribution as compared to the existing schemes.
4. Key Distribution Using Fragmentation and Assimilation (KDFA)
The proposed scheme KDFA provides a reliable solution to the key exposure problem at compromised intermediate nodes. A sender node transmits a request to nearby actors for establishing key with a distant receiver node that is located outside the communication range. Actors can play a vital role at routing keys between sender and receiver nodes. Key distribution process begins when a sender uses a light weight fragmentation mechanism to divide the key into f fragments and transmits them through f intermediate actor nodes in the paths towards the receiver. The receiver calculates the actual key by taking XOR of these key fragments. In this process, number of key fragments “f” is decided by the administrator and it depends on the safety of deployment region and the security level required by the application. In most of the cases, the recommended value for f is either 2 or 3. In KDFA, the attacker can only get the key fragment by capturing intermediate nodes and not the complete original key. It provides an efficient way to secure the pairwise key establishment scheme by improving the resilience against the node capture attacks.
Actor nodes can distribute the key fragments using one of the following communication scenarios. In the first scenario, the sender requests to establish an indirect key with a node located outside its transmission range but exist within the communication range of nearby actor nodes. The actor node has keys of all the nodes in the network and can act as an intermediate node to establish a secret key between sender

Intra-actor communication for key distribution.
In the second scenario, the sender node transmits two key fragments to the actor node pair to establish indirect key with a distant node

Inter-actor communication for key distribution.
In the third scenario, the sender node requests from nearby actor node pair to establish indirect key with a distant node by distributing key fragments. Actor

Hybrid communication for key distribution.
During the key distribution process, if there is only one actor in the range of the sender node and the second actor node is not available within a threshold value of time then f key fragment messages are sent via a single actor node. An upper-bound on the delay between consecutive transmissions of fragments can be imposed so that the receiver node will wait for the next fragment. An extra functionality can be added to the receiver code to manage the freshness as different messages originated by the same node reach the receivers at different time instants. During the waiting phase, another actor can visit the sender node's area to transmit other fragments because the actors frequently visit areas to collect data from the sensor nodes. In all case, the property ensured by KDFA is that a single key is never sent in one message.
KDFA is applicable for static and mobile sensor nodes. In war field, two or more distant soldiers can exchange their current positions securely to move together towards the target. In industry, big machines are turned on in a sequential manner to avoid power hazards. Distant machines can be synchronized to turn on or off by exchanging secure messages. There exist a number of similar application scenarios where our scheme can effectively provide secure messaging.
A list of notations used in KDFA is provided with brief description in Table 1.
Notations.
4.1. Key Fragmentation Algorithm (KFA)
It is used by the sender node to divide the key into f fragments. If the key size is divisible by f then equal-sized fragments are produced like 32-bit key is divided into 2 fragments of size 16-bit each, but in case of 3 fragments the result will be two fragments of size 10 and the last fragment of size 12. The size of the last fragment is calculated as per line 7 in Pseudocode 1.
(1) if Remainder of (keySize, f) is 0 then (2) fragmentSize = keySize/f (3) (4) else (5) fragmentSize = (6) addBits = keySize − (fragmentSize * f) (7) (8) end if
Step 1, 2. If a selected key size in bits is completely divisible by f, for example, a 32-bit key with
Step 3. Last fragment size is equal to the fragment size because the key size is completely divisible.
Step 4, 5. If the key size is not completely divisible by f, for example, a 32-bit key with
Step 6. This problem is mitigated by calculating additional bits and then padded them to the last fragment. Initially a fragment size is calculated by dividing the key size by f and the floor is taken to get the lower value for the fragment size. If a key size is 32 with
Step 7. The last fragment size LF z is calculated by adding the number of padded additional bits to the fragment size. In the case of above scenario, fragment size is 10 and additional bits are 2; therefore, the last fragment size equals 12 bits.
Bitwise representation of this technique is elaborated in the following example where a 16-bit key 1110011101010101 is divided into
In another scenario, 16-bit key 1110011101010101 is divided into
4.2. Key Distribution Protocol (KDP)
The sender and receiver nodes establish the secret keys using KDP protocol. In this section, all the protocol steps are elaborated along with description of message contents for intra-actor distribution scenario. It includes sender
After receiving the message, actor
Upon receiving the message, the receiver node
For Interactor distribution scenario,
5. KDFA Formal Specification
We have performed formal modeling using nonmonotonic cryptographic protocol (NCP) also called Rubin logic [13] to analyze and verify the KDFA protocol as per formal specifications. It validates the protocol as per standard requirements of cryptographic operations like authentication, message integrity, message freshness, encryption, decryption, and so forth. It also helps to identify the deficiencies in the proposed protocol and possibilities of compromise attacks. It is close to the actual implementation and flow of programming functions. In Rubin logic, the entities are assigned roles and a global set is also maintained where information about the protocol is maintained in these sets and it also maintains updated states of the users after each updateable operation. Global sets are accessible to all the member nodes and can be categorized into secret, observer, rule, and principal sets. A detailed discussion on formal specification for WSAN protocols is provided in [25, 28] along with appropriate case studies.
We have reutilized the notations of KDFA predefined earlier in Table 1 and a brief description is provided in Table 2 for all notations used in the following local set for formal specifications.
Notations of local set for KDFA.
A local set is maintained at each entity or node and can be categorized into possession POSS(), belief BEL(), and seen and behavior sets BL(). Detailed specification of this sets can be explored from [13, 16]. By applying Rubin logic on KDKF-AN, the local set is elaborated as follows and then its verification and analysis part provides a detailed overview of all sets maintained under the category of local set.
Local Set for KDFA
Sender ( POSS( BEL( BL ( Hash( Concat( Encrypt( Send( Update Hash Concat( Encrypt( Send( Update( Receive( Split( Decrypt [ Check-freshness(
if yes, then abort Check( MAC({Concat Check( Actor ( POSS( BEL( BL( Receive Split( Decrypt( [ Check-freshness(
if yes, then abort MAC({Concat ( Check( Concat( Encrypt( Send( Update( Actor ( POSS( BEL( BL( Receive( Split( Decrypt( [ Check-freshness(
if yes, then abort MAC({Concat( Check( Concat( Encrypt( Send( Update( Receiver ( POSS( BEL( BL( Receive( Split( Decrypt( [ Check-freshness(
if yes, then abort MAC({Concat Check( INCR( Compare ( XOR( Hash( Concat( Encrypt( Send( Update(
Local sets for all the entities including sender, receiver, and actor nodes are separately maintained. A possession set POSS(entity) contains all the parameters involved in encryption, decryption, and other operations performed at local memory of each entity as described in section below. A Behavior List BL() contains the list of operations and input arguments that are performed in near to implementation steps by entities
5.1. KDFA Analysis and Verification
In this section, KDFA is analyzed for intra-actor distribution scenario as discussed in Section 4. In this scenario, the key distribution is initiated by the sender node ( Concat( Encrypt( Send( Update ( Hash( Concat( Encrypt( Send( Update( POSS( BEL( Receive( Split( Decrypt( Check-freshness( MAC({Concat( Check( Concat( Encrypt( Send( Update( Forget( POSS( BEL( POSS( BEL(
Sender node further unicasts another message to actor node
Related parameters including messages, ciphers, nonce values, actual key, key fragments, and hashes are saved in possession set at
After sending two messages, control is passed to receive operation in appropriate actor node where messages are decrypted to retrieve concatenated message that are further split to get actual parameters. Freshness of message is checked by subtracting timestamp received
Actor nodes
Possession set at actor nodes
Forget operation will result in removing these temporary values (
The receiver node Receive( Split( Decrypt( Check-freshness ( MAC({Concat( Check( INCR( Compare( XOR( Hash( Concat( Encrypt( Send( Forget( POSS( BEL(
If
Possession set values including nonce values
After execution of all steps, secure key
The sender node Receive( Split( Decrypt( Check-freshness( Check( MAC({Concat( Check( Forget( POSS( BEL(
Possession set at
6. Simulation and Results
For simulation, we have used ns-2.35 on Fedora Core 12. During simulation scenarios, C language is used for providing send and receive functionalities along with packet formats for sensor nodes, actors, and sink. Encryption, decryption, fragmentation, and hash functions are also provided in C. Tcl is used to create nodes, deployment of network field, and linking the nodes. Messages scenarios are also exchanged as per KDP specifications. In WSAN, nodes and actors are randomly deployed in a region of 1200 × 1200 meters where nodes were static and actors can move within the network field. We have focused on providing key distribution services and data collection scenario is left for future work. Transmission range of nodes is set to 40 meters with different network sizes from 100 to 1000 nodes. It also includes 5 to 20 powerful actor nodes. Queue type is set to Queue/DropTail/PriQue as shown in Table 3.
Simulation parameters.
6.1. Resilience
During interactor communication (IAC) two ordinary nodes from different regions communicate using two actor nodes. The probability that an actor node being compromised in the path can be calculated using (12), where N is the network size and cp is the number of nodes captured by an attacker in the network:
The total number of uncompromised nodes
Considering the scenario of dividing a key into two fragments, we can calculate the probability of capturing exactly
Results in Figure 7(a) show that if 150 nodes are captured then there are 15% of chances to capture one actor node in the path. In case of fragmentation, there are only 2% for

Probability of an actor node being compromised when less than 40% nodes in the entire network are captured in (a) and more than 60% in (b).
6.2. Fragmentation Computation Cost
A key fragment size is calculated using KFA as discussed in Section 4.1 where the size of the last fragment varies in case of odd number of fragments. Additional bits are added to last fragment as illustrated in step 7 and that is used to generate (14), where
Figure 8(a) shows the size of the last fragment by selecting

Size in bits of the last fragment in (a) and size of initial fragments in (b) where the number of total fragments is
6.3. Communication Overhead Analysis
In KDFA, the number of messages (
In case of intra-actor communication,
An ordinary node can establish indirect keys with distant sensor nodes in outer circle of its transmission range as illustrated in Figure 9(a). The total communication cost for indirect keying (

(a) Effects of key fragmentation on communication overhead. (b) Probability of links between nodes and actors.
M intra and M inter represent the values of communication cost (
If there are Q actor nodes in the network then
7. Conclusion
Key distribution schemes require agent nodes as intermediaries to establish keys between distant nodes. A compromised actor node can reveal all the keys passing through that node. Therefore, we have proposed a lightweight key fragmentation and assimilation scheme to mitigate the key exposure problem. Rubin logic is applied to model the proposed scheme KDFA and analysis is also performed to evaluate its accuracy of cryptographic operations and transmissions. Simulation results show the effectiveness of the proposed scheme over contemporary schemes in literature. According to results, 75% of communication is compromised in existing schemes whereas the proposed KDFA has the probability of exposing only 13% of communication when 60% of nodes are compromised. In the proposed scheme, sender transmits extra 14 bytes during key distribution process but using powerful actor nodes reduces the overhead for those messages exchanged through actors. In future, the proposed scheme will be analyzed to measure the effects of poor interactor connectivity on data extraction and aggregation.
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 extend their sincere appreciation to the Deanship of Scientific Research at King Saud University for funding this research through Research Group Project (RG no. 1435-051).
