Comparison of Encryption Algorithms in Wireless Sensor Networks

In general, Wireless Sensor Networks occur when sensor nodes are randomly left in an unreliable environment. Sensor node has limited processor, limited memory, limited radio capacity and low cost. In sensor network applications, security mechanisms must be used, because of unsafe environments, excessive number of sensor nodes, and wireless communication environments. Ensuring confidentiality, the primary goal of security, is one of the most important problems to be solved in order to realize time and vital objectives. While ensuring security, it is also necessary to consider other important criteria such as memory usage, energy and latency of Sensor Networks. In this study, encryption is described in Wireless Sensor Networks and Skipjack, XXTEA and AES encryption algorithms are compared using TOSSIM simulation program in TinyOS operating system considering memory usage, energy and delay criteria. The study is considered to be useful academicians who study security in Wireless Sensor Networks.


Introduction
Compared to classic computer networks, wireless sensor networks show many unique features.Therefore, security methods that can be used in conventional networks cannot be used in wireless sensor networks [1].In sensitive wireless sensor networks applications such as monitoring enemy lines or monitoring border zones, security protocols that provide confidential data transmission from the sensor nodes to the base station must be used.However, low processor and radio capacities of sensor nodes do not allow the implementation of traditional security protocols in sensor networks [2].To make sensor networks practical, many improvements are currently being made in software and hardware.However, the basis of every work done is the reduction of the energy consumption per unit and hence the extension of the life of the sensor nodes.The main reason for this is that replacing or refilling sensor nodes and used energy sources in the working environment is often impossible and costly [3].Security methods designed for traditional networks and widely used in many applications today cannot be implemented directly in wireless sensor networks because sensor nodes have limited energy resources, insufficient memory capacities and limited processing capabilities.Because of this, the security methods developed for wireless sensor networks take into account safety, energy, ITM Web of Conferences 22, 01005 (2018) https://doi.org/10.1051/itmconf/20182201005CMES-2018 memory usage and latency.A security method in which all resources are actively used will be ideal for sensor networks [4].In sensor networks, encryption algorithms are used to provide data confidentiality.However, it should not be forgotten that sensor networks have limited hardware resources and that the first objective is energy efficiency while providing requirements.Otherwise, a protocol that consumes a lot of energy, even if it provides all security measures, would be useless for sensor networks [5].This work describes encryption in wireless sensor networks and uses Skipjack [6], XXTEA [7] and AES [8] encryption algorithms to examine memory usage, energy and latency criteria using the TOSSIM simulation program in TinyOS.

TinyOS&TOSSIM
The TinyOS Operating System is installed on the sensor nodes that compose the Wireless Sensor Networks.TinyOS is encoded in the programming language NesC, a variant of the C programming language.With this coding, nodes can be given new features.Designed algorithms or protocols can be seen primarily in the TOSSIM simulation program in TinyOS.TOSSIM is designed to simulate sensor network applications.TinyDB is a small database that is used to collect data and to read the data during simulation.TinyViz is a graphical visualization tool associated with TOSSIM, which is used to view the results of any NesC application.TinyViz interacts with TOSSIM, providing an extensible graphical user interface for debugging and visualization.TOSSIM is a simulation tool designed for TinYOS sensor networks.NesC codes written in TOSSIM also work on sensor node hardware without any change.Then, it can be loaded into the nodes without making any changes.The TinyOS operating system is designed to support the needs of wireless sensor networks.TinyOS is an embedded operating system distributed as completely free and open source for use in wireless sensor networks.TinyOS has a component-based architecture.In TinyOS, sending messages is via the AMStandard component.The encryption can be written as a module in a separate file.After the message package is prepared in the AMStandard component, it is transmitted wirelessly to the receiver via radio.The node that receives the message can still see the contents of the message package in the AMStandard component.This means that users who want to use different encryption algorithms or encryption modes will have to write their own algorithms or modes in this partition.The code written in this way is both modular and easy to use.The diagram showing the message transmission in TinyOS is given in Figure 1.GenericComm and AMStandard components are definitely used when sending / receiving messages in any application in TinyOS.

Fig. 2. TinyViz Screen
According to the simulation program, node 19 will send message to node 15.First, node 19 generates a message after performing node detection.Then, it performs the encryption process before sending the message.The message to be sent on the MAC calculated with the encrypted message is added to the package.The encrypted message sent by node 19 is received by node 15.So even if the node is seized on the road, it will not get a meaning for the aggressor.The decryption of the message received by node 15 is resolved and the MAC value is calculated.When the calculated MAC value is the same as the incoming MAC value, the message is processed.
It is seen that the NesC code for the encryption algorithm written by TinyViz runs smoothly on the nodes.After this, the same code can be loaded in the sensor nodes without making any changes.

Evaluation Results
The performance of a cryptographic algorithm can be determined according to the length of the system breakable period, the time spent in ciphering and deciphering processes, and the amount of memory required for encryption and decryption operations [9].For a 40-bit key n = 2 40 or n = 1 099 511 627 776 (one trillion ninety nine billion five ITM Web of Conferences 22, 01005 (2018) https://doi.org/10.1051/itmconf/20182201005CMES-2018 hundred ten ten million six hundred twenty seven thousand seven hundred seventy six) is a possible key word.In a competition, a credit card transaction on the Internet, encrypted with a 40-bit key with the RC4 algorithm, was solved in 3 and a half hours by a student who have just a modest computer lab in 1995 [10].Therefore, the key length used must be carefully selected.
It is concluded that a 64-bit algorithm can be used up to 1994, an 80-bit algorithm up to 2013, and a 128-bit algorithm up to 2076 can be used in the proportions made by knowing that the 56-bit DES algorithm introduced in 1977 is broken in 1982 [11].The comparison of the encryption algorithms used in the study according to the block length, key length and number of cycles are given in Table 1.In TOSSIM environment, the energy, delay and memory usage of the algorithms are compared in Tables 2. In comparisons, the key length of the AES algorithm is 128 bits and the number of cycles is 10.As shown in Tables 2, although the key length of the XXTEA encryption algorithm is 128 bits, there is a negligible increase according to the Skipjack encryption algorithm according to the memory usage, energy and delay criteria.It would be better to use the XXTEA encryption algorithm instead of the Skipjack encryption algorithm, which has a key length of 80 bits, according to studies done in the literature.The AES encryption algorithm is more costly than other algorithms because of the specific methods it uses for encryption.However, the AES algorithm can be preferred in high-level applications that require much security.

Conclusions
When developing a security approach, it is necessary to consider the capacities of wireless sensor node resources (memory, processor, power supply).Sensor networks are expected to increase node energy consumption quantities and average end-to-end latency of encryption mechanisms added to improve security in applications.It is very important here that the needs of the applications are well established.In a simple large-scale environment or industrial sensor networks application, safety is of utmost importance, while energy consumption is a major factor.On the other hand, while security is of great importance in ITM Web of Conferences 22, 01005 (2018) https://doi.org/10.1051/itmconf/20182201005CMES-2018 military and health applications, node energy consumption can be relatively neglected.Therefore, it is very important to select the encryption algorithm, encryption mode appropriate to the security solutions developed for military and health applications.Developed security solutions must be modular.That is, the newly introduced encryption algorithm and encryption modes of the literature should be integrated directly into the developed security solution if security, energy, memory usage, latency are better.
In this work, encryption is described in wireless sensor networks and Skipjack, XXTEA and AES encryption algorithms are compared using TOSSIM simulation program in TinyOS operating system considering memory usage, energy and delay criteria.XXTEA encryption algorithm is a negligible increase according to Skipjack encryption algorithm, but the result is that XXTEA encryption algorithm should be used instead of using Skipjack encryption algorithm with 80 bit key length.At the same time, it is concluded that the more costly AES encryption algorithm can be used in applications that require high security.

Fig. 1 .
Fig. 1.The diagram showing the message transmission in TinyOS

First
, Skipjack, XXTEA and AES encryption algorithms are written in C language.The encryption of the message values used in the future TOSSIM simulation results and the calculation of the MAC value are performed in this program.Then, after verifying the codes of the encryption algorithms, this written code is translated into NesC code.Simulated results were obtained on 30 nodes with the help of the TOSSIM simulation program to test whether the NesC code written after this operation was performed correctly before loading the node.In this chapter, The message generated by the node, Message encryption and MAC calculation, Sending a message, Receiving message, Decryption of the password, Computation and comparison of MAC, If the MACs are equal, the process of accepting the message is shown.The simulated display is shown in Figure 2.