WSN-WCCS: A Wireless Sensor Network Wavelet Curve Ciphering System

W ith wireless sensor network (WSN) wide applications in popularity, securing its data becomes a requirement. This can be accomplished by encrypting sensor node data. In this paper a new an efficient symmetric cryptographic algorithm is presented. This algorithm is called wireless sensor network wavelet curve ciphering system (WSN-WCCS). The algorithm idea based on discrete wavelet transformation to generate keys for each node in WSN. It implements on hierarchical clustering WSN using LEACH protocol. Python programming language version 2.7 was used to create the simulator of WSN framework and implement a WSN-WCCS algorithm. The simulation result of the proposed WSN-WCCS with other symmetric algorithms has shown that its execution time fastest among AES, 3DES and DES 15%, 55% and 17%.


INTRODUCTION
In the last twenty-years wireless sensor network (WSN) development become a great interest area for industry such as transportation, civilian, healthcare, military and commercial applications.So, as this grown go day by day and beside its sensors small size, low cost and low power a security mechanisms become a big challenge due to its resources constrained.Furthermore, the nature of communication within WSN make eavesdropping and data modification more easy.Cryptography is the core techniques to protect data in WSN.Due to the limitation of the WSN batteries power and computation speed make traditional security methods unstable to secure WSN data.However, there are two techniques in cryptography symmetric and asymmetric.In symmetric the same key is shared between two nodes and used for message encryption and decryption process.On other side, asymmetric two keys are used one to encrypt message and other one is used to decrypt message.In fact, some researchers used asymmetric cryptography, Kumaran, et al., 2016, but most studies in WSN data security, M. Panda,2015, Satyabrata, et al., 2016, and Li, Juan, 2017, preferred to use symmetric cryptography (e.g., AES) to reduce energy consumption.This study is used a new symmetric cryptography algorithm is called WSN wavelet curve ciphering system (WSN-WCCS).In this algorithm a wavelet signal will be used to generate keys in such way that each node in the WSN has its own key.Our aim is developing data encryption algorithm using wavelet signal to achieve the following:  Fast implementation for encryption and decryption process than other symmetric cryptography techniques such as AES, DES and 3DES. Flexibility in generating a number of keys for each node in WSN. Protection WSN data from eavesdropping and ciphertext attack. Reducing memory usage because it can perform computation in place without need to a temporary array In this study a new algorithm is proposed to generate encryption keys based on discrete wavelet transformation.In which, secret key extracted from a multilevel up to 3 levels signal decomposition type Daubechies (one-dimension) as shown in section 3 in full details.The algorithm applied on hierarchical clustering WSN using LEACH protocol.Also, a comparison with other algorithm DES,3DES and AES have been made.It found a WSN-WCCS algorithm achieves significantly faster than other algorithms.The paper is presented as follows: section 2 contains a survey of related works on using discreet wavelet transformation DWT as base to generate keys in WSN, section 3 shows a study method which demonstrates key generation based on DWT multilevel decomposing using one dimension Daubechies and steps of building a WSN-WCCS algorithm, section 4 are discussed simulation result of the proposed algorithm with other symmetric algorithms (AES, DES and 3DES) and finally section 5 includes study conclusion.

RELATED WORK
Based to our knowledge there is a few studies that used discreet wavelet transformation DWT as base to generate keys in WSN.In Keven and Fekri, 2004 study, they used wavelet transformation through finite fields GF(256) to produce private key cryptosystem size 128 Byte.They conducted a charting on the field to their opposite in the field through nonlinear device.In a WSN-WCCS the key value is used in the process of encoding and decoding message using base64 method.
Another study Koduganti and Avadhani, 2011, used DWT as base for authentication message in the network.They generated keys using one of generated algorithm then transformed generated keys using Haar technique.The transmitted encryption key is received then applied to encrypted message.So, the decryption key is retrieved from the reverse DWT.A Daubechies (one-dimension) wavelet is used in a WSN-WCCS because it has different types (from 1 to 20).In order to maximize complexity for opponent to know which type that has been used to generate secret keys in the algorithm.
In DebayanGoswami et al., 2013, study they generate keys consist of DWT decomposition code and bookkeeping to encrypt file format (.txt, .doc,.bmp).In the decryption process they used the inverse of DWT.A WSN-WCCS algorithm is different from this method in that its using coefficient details value as secret keys and that will be used for encryption/decryption message in wireless network.Beside the proposes algorithm applied on hierarchical clustering WSN, using node id to assign secret key to each node WSN.

STUDY METHOD
The basic idea of a WSN-WCCS is generating keys based on DWT multilevel decomposing using one dimension Daubechies wavelet.The result values of DWT process will be used as encryption keys assigned to each node in a WSN.So, to achieve that the following steps are:

Key Generation
Wavelet transformation is defined as an assortment of tools for transforming from time into convert domain to discover transfer coefficient.Subsequently, the coefficients also can be transformed again into the time domain for conversations many times.The fundamental issue in DWT are using low-pass (approximate coefficient) and high pass (details coefficient) filter to decompose signal simultaneously batch (h) into levels Shukla and Tiwari, 2013, as shown in Fig. 1.  1) and ( 2) are used to calculate lowpass (coefficient approximate) and high-pass (coefficient details) 3) is used to get the original input sample x[n] In this algorithm Daubechies (one-dimension) wavelet is used because it has different types of Daubechies (from 1 to 20).In order to make it harder for opponent to know which type was used in the algorithm to generate keys.Posterior, coefficient details values are used as secret keys for encryption and decryption message in the network.Also, decomposition on input single made up to 3 levels.In order to increase the complexity for opponent in finding out which level the node request its secret key.owever, a hierarchical clustering WSN is used in this study.The network organized into a number of clusters connected to the base station.Each cluster consists of two or more nodes connect to its cluster head.So, each node sensory data and send it to the cluster head, which in turn aggregate data and send it to the base station.The cluster head selected based on LEACH "Less Energy Adaptive Clustering Hierarchy Protocol", Tandel, 2016.In LEACH protocol all the nodes in the network can be selected as cluster head (CH).The node with highest energy will be elected as CH.
In a WSN-WCCS algorithm the key values will be taken from d1, d2 and d3 lists and be used as secret key for node, CH and base station.
5. The Decryption message process again the secret key will be in the decode base64.So, first step removes the key from the encoded message and apply it on the decode base64 as shown below: 1-Encryption ("ZVdYXVk=", key= "-1295000739.643582") M= "SGVsBCA" 2-DecodeBase64(M) plaintext= "Hello"

LEACH Protocol
LEACH is one of the main routing protocol that used in forming cluster in WSN in order to prolong the network lifetime.In each cluster all the nodes connected to CH via single hop.So the nodes collection data send to their CH which in turn forward it the base station.The LEACH protocol constructed in two phases setup and steady.
In setup phase the network divided into groups of nodes or clusters.In the network all the nodes are equal in the probability to be elected as CH.The node with highest residual energy will be elected as CH.Thus, each CH will send advertised message to inform other nodes in the groups that it become as CH using Eq. ( 4) Gupta, and Marriwala, 2017.Other non CH nodes will send joining message to the elected CH in order to become Cluster Member (CM).
Where h= a random number between (0 and 1), Pb =Probability of CH M= is the all the nodes that are not selected as CH ron = round number.t(h)= thereshold for node that became as CH in the current round 1/ Pb = first round that in which CH nodes had been elected.
The node elected as CH in the current round if its values is less than t(h) otherwise it remains normal node.Although, when a node elected as CH once it cannot be elected again as CH.So, the process continues till all the nodes in the network become CH once.In steady phase all CMs send their sensory data to their CH through single hop.The CH summed the collected data and send it the base station via other CHs or directly using static route.After specified period of time the network start again the setup phase.3. Assign each cluster header in WSN a key from d2 list using cluster id. 4. Assign each base station in WSN a key from d3 list using BS id. 5. Assign each node in WSN a key from d1 list using node id. 6.Each a live node in the network sends its ID to the base station BS, to request a key 7. BS check the node id validity and send the key that assign to this node 8. Node use the key to encrypt message.Subsequently, send the encrypted message with its id to the destination node.9.In BS again check node id that attach with the message in routing table.In order to find assigned key and used it to decrypt the message.

RESULTS
The algorithm applied on hierarchical clustering for a WSN that used LEACH protocol see appendix A2 LEACH protocol source code.The energy consumption is ignored in this study and consternated on the calculation speed of encryption algorithm and storage usage.Python language version 2.7 was used to create the simulator of WSN framework and implement a WSN-WCCS algorithm.The simulator implemented on laptop Lenovo, processor intel(R) Core(TM)-4200 CPU @ 1.60 GHz 2.30GHz and RAM 4.00GB.The network simulator parameters are assumed the same for the four algorithms (DES, AES, 3DES and WSN-WCCS) as shown in Table2.The Fig. 3 shown WSN before using clustering and Fig. 4 show WSN after clustering.In Fig. 5 screenshot of running a WSN-WCCS in which final round 2545, total remaining energy is 0.0000 and node id: 36.Encrypted message "ektdWFoWQVxAVwE=".The WSN-WCCS algorithm is compare with other symmetric algorithms DES, 3DES and AES based on speed of execution time and storage usage.The comparison was done by running the fourth algorithms separately.The result shown in Table 3.A WSN-WCCS execution time is 15% faster than AES, 55% faster than 3DES and 17% faster than DES.In the storage usage it takes less storage than 3DES, slightly more storage than AES and DES.In Table 3, the total storage usage for AES is 32bytes.But for 10 rounds the key expansion will be equal to 176 bytes 16 x (10+1).In a WSN-WCCS the total storage 34.While a DES the total storage is 32 bytes because DES used key sized 8 bytes for each block size is 8 bytes.Whereas, the message size is 16 bytes thus the total size is 32 (16x2).The 3DES algorithm increased the key size via the reused of DES therefore the total size storage is (32x2=64 bytes).

WSN-WCCS Cryptanalysis
The symmetric technique is based on using the same key between two nodes to encrypt and decrypt message.So, the secret key is considering vulnerable for attacker.Thus making its long and hard to predictable or cracked by the attackers is considered important issue.But due to a WSN resource constraints makes this issue a big challenge for researchers.This section is discussed the security issue of a WSN-WCCS algorithm in compare with other algorithms DES, 3DES and AES The main disadvantage in DES algorithm is that a secret key size is small and can be creaked using brute force attack.In a WSN-WCCS the key sized is larger and randomly selected and assigned to the node in the network.The 3DES increased the key sized via the reused of DES algorithm using either two or three different keys (112 or 168 bit), but the main drawback that it taken more computation time, Patil, et al., 2016, which in turn increase the energy consumption, thus make it not appropriated for securing WSN framework.The AES algorithm is used in widely and efficiently in securing a WSN data, Hung, et al., 2018.The key length is 128 bit used in more than one rounds on 4x4 state matrix for full encryption/decryption using permutation and substitution operations.Whereas, a WSN-WCCS algorithm is used only substitution operation.Beside in this study the secret key length 18 Byte (144 bit) is randomly generated from Daubechies wavelet signals (from 1 to 20).Which maximums the complexity for adversary to crack the secret key that used with base64 encode/decode method.Although, a WSN-WCCS execution time in this study for encryption process is 15% faster than AES.However, a WSN-WCCS based on the base64 decode and decode method.So, if the attacker discovered the way the secret is generated then attacker can easily reveal the original message using base64 decode table.In the proposed algorithm a random key is generated based on DWT multilevel decomposing using one dimension Daubechies wavelet.While the DES, 3DES and AES start with seed key is generated randomly using random generated then used shift rotate operation in DES and 3DES to generate secret key using permutation computation matrix in 16 rounds.Whereas AES four operations (Add Round key, Mix.Column, Shift Row and Subbyte) are used to generate secret key on 4x4 state matrix in 10 rounds for key sized 128 bits.Thus, there is a probability that the same seed key is used more than one times because it generates randomly.Thus, when adversary discovered the secret key values that used more than one times then he or she can figure out how keys is generated randomly.While in a WSN-WCCS algorithm the level of security is increased because even the adversary can figure how the key is generated then he or she has to figure out which wavelet single is used (Haar, Daubechies.Coifle …etc.).Furthermore, even the adversary has ability to find out a wavelet signal in the algorithm is a Daubechies.Thus, the adversary must be able also to specify the signal type which is between (1 and 20).Even though, the attacker can be able to specify the signal type then he or she needs to compute DWT multilevel decomposing for many level.Which is very harder and take much time for adversary to check each point on each curve on each level.In general, the study result has shown the proposed algorithm is faster than other symmetric techniques and efficient in storage usage.Even its used a larger key size than others algorithms.Also, its take less storage usage about 30 bytes than 3DES algorithm and more storage usage about 2 bytes than AES and DES algorithms.
Note the Base64-encoded value is taken from mapping index value to Base64-encoded table.
WCCS Algorithm 1. Generate (n) random number of sample size 18 Byte and store it in xx[n] array 2. input x[n] samples into DWT function to a. Calculate low-pass and high-pass up to 3 levels from Daubechies wavelet (onedimension) type 2 b.Store the result of computation in d1, d2, d3 and C3 lists in a routing table.
Symmetric cryptograph was widely used to secure data in WSN network.In this study a new algorithm proposes, based on our knowledge e is the first algorithms that used DWT only to generate keys in WSN.A WSN-WCCS algorithm was designed based on DWT multilevel decomposing using one dimension Daubechies wavelet signal.It implements on hierarchical clustering WSN that use LEACH protocol.