^{1}

^{1}

^{2}

^{1}

^{1}

^{2}

Autonomous energy harvesting sensors present one of the most attractive areas of microelectronics at the moment. They are a part of Internet of Things (IoT) systems so the data need to be protected across transmission. One way for data protection is encryption and the other way is digital signature. However, energy consumption of those systems is increased using protections algorithms, and it should be considered because these are energy harvesting systems. The paper describes the ways in which data encryption and digital signature algorithms can be implemented in resource limited systems based on an 8-bit microcontroller. Alongside the implementation method, the paper deals with the energy demands of the selected encryption algorithms and digital signatures. The execution time, energy consumption, and memory consumption will be considered.

Continuous reduction of the microcontrollers’ and sensors’ energy consumption has boost development of various energy harvesting systems. Those are autonomous systems supplied by the energy gathered from their surroundings. The most common energy sources are the ambient light, thermal gradient, airflow, vibrations, and electromagnetic radiation. These devices have either a single power management circuit in order to reduce the complexity and dissipation or an optimized power management circuit for each energy source to increase efficiency of the whole system. They tend to work in low consumption mode whenever it is possible in order to increase their autonomy [

In addition, there is a need for data protection during transmission. Encryption and digital signature can be used for it [

The lack of data and energy storage and low levels of electrical and computational performance in a node represent major obstacles to the implementation of established security techniques in wireless sensor network. Wireless sensor nodes often have very limited processing capabilities and the trend in manufacturing is to reduce the cost of nodes, not to increase computing power. The unreliable communication channel and unattended operation make effective security even more difficult to achieve.

Concerning security aspects, the problem of optimizing resources used for security, yet providing an adequate level of protection, is a hot topic at the moment [

Several algorithms of encryption can be implemented in autonomous sensors [

The name TEA is acronym of Tiny Encryption Algorithm, and adjective tiny indicates the simple way of doing and implementation. TEA algorithm encrypts data that are divided into 64-bit blocks using 128-bit key, and it was based on Feistel’s network (Feistel cipher). It was initially proposed to carry 64 rounds within the TEA algorithm; however, implementation with 32 rounds is common. Disadvantage of TEA is simple distribution of keys. Equivalent keys are the consequence of that; each key is equal to the other three.

XTEA (eXtended Tiny Encryption Algorithm) presents advanced version of TEA developed by David Wheeler and Roger Needham in 1997. Differences between TEA and XTEA are in the order of performing operations and in the way the keys are distributed. XTEA requires a small memory space so it is often used in systems whose hardware features are limited.

SKIPJACK algorithm was developed in the early 1980s by the American National Security Agency for encryption of Government’s documents. It runs within 32 rounds and encrypts 64-bit data blocks using an 80-bit key.

Unlike encryption, in digital signature, the data transmitted can be encrypted or may remain transparent and it is possible to determine the sender of the message. The digital signature algorithm consists of three parts: keys generating, signing, and signature verification. Some of digital signature algorithms are RSA [

RSA digital signature algorithm is based on RSA asymmetric encryption algorithm [

ElGamal’s digital signature algorithm was developed in 1985. The working principle of this algorithm is based on calculating discrete logarithms. The size of initial parameter

Figure

Implementation of digital signature algorithm in PIC microcontroller.

The most simplified algorithm is presented on the right side of Figure

To evaluate experimental data, a microcontroller system based on PIC18F45K22 [

Figure

Simplified schematic of the system.

The system presented in Figure

Captured waveforms: data preparation, encryption, and data sending.

The red signal (the upper one, CH2) is the voltage on the trigger pin and it changes its state every time the new operation within the software is executed. The blue signal presents the current and is recorded by the current probe. It is obvious that current consumption is the highest during the sending of the data. It is necessary to separate encryption from the sending signal and to determine the number of measurings for each operation. As an example, Figure

State of trigger pin at start and at the end of encryption.

To estimate the energy consumption, it is necessary to determine the surface below the given curve. In other words, it is necessary to calculate the integral (

Measuring time helps determining which encryption algorithm and which digital signature take the shortest execution time. Encryption time is measured for the implementation of the three previously named algorithms. For the same algorithms the time of data sending was also measured. Figure

Captured waveforms during execution of encryption algorithms.

The Figure

Firmware execution time of encryption and data sending (in ms).

According to the values measured, the process of data encryption takes much less time than data sending. The size of input data, keys, and output data is always the same. Therefore, the conclusion is that the encryption time for the same algorithm depends neither on the key values nor on the input data value. When there is no encryption, only the measured temperature value is sent, which is an eight-bit variable. On the other hand, when the measured value of temperature is encrypted, the output of the given encrypted algorithms is 64-bit data. The encryption time and the data sending time make the total software execution time (Figure

Total firmware execution time (in ms).

The first step in keys generation for digital signature is choosing random prime numbers. The keys for RSA and ElGamal algorithm were generated by choosing the value for number

Captured waveforms during digital signature.

Figure

Signing firmware execution time (in ms).

The picture shows that, with the RSA algorithm, signing time rises exponentially with the increase of the

Firmware execution time (in ms) of data and signature sending.

The change in data and signature sending time is much smaller compared to the signing time at both algorithms. Signing time and sending time make the total software execution time. The values gained are presented in the Figure

Total firmware execution time (in ms) with signature.

Calculation of the current consumption was done in order to determine which of the given algorithms has the smallest influence on the high energy consumption. The calculation was done by the previously described method (

Energy consumption during encryption (in

Energy consumption during data sending (in

The diagrams show that the consumption value of each algorithm depends on its duration time; thus, the algorithm that lasts longest needs most energy. When the consumption values for encrypting and sending are compared, the results show that the system needs much more energy to perform data sending because the process of sending takes more time than encrypting. By adding these two values total system energy consumption is obtained. This value is of high importance when choosing the encryption algorithm which is to be implemented in the system. Figure

Total system energy consumption depending on encryption algorithm (in

Measuring proved that the consumption depends on encryption time. Time for performing algorithm encryption does not depend on the values of the data which are encrypted, nor on the key values. Therefore, the conclusion is made that the encryption consumption has the constant value for the given algorithm.

Considering digital signature, the consumption was calculated for the same key values of RSA and ElGamal algorithms, for which the execution time was measured. Figure

System energy consumption for digital signature algorithms (in

System energy consumption during data sending with signature (in

Energy consumption needed for signing has the same dependence on the

System energy consumption for digital signature algorithms (in

The paper describes the ways in which data encryption and digital signature algorithms can be implemented in resource limited systems based on an 8-bit microcontroller. Alongside the implementation method, the paper deals with the energy demands of the selected encryption algorithms and digital signatures. The execution time, energy consumption, and memory consumption have been considered. All the selected algorithms can be applied in WSNs unless the memory deficiency makes it impossible.

Memory usage for the implementation of encryption and digital signature algorithms is as follows: TEA, 6.07%; XTEA, 5.15%; SKIPJACK, 5.26%; RSA, 13.81%; and ElGamal, 19.34%. XTEA symmetric encryption is the best solution of the three considered memory usage. Total firmware execution time is the shortest when SKIPJACK algorithm (248 ms) is implemented and the largest with TEA encryption algorithm (268 ms). XTEA algorithm consumes the smallest amount of energy (8043

Security of digital signatures algorithms depends on keys size. In this case, keys size for both RSA and ElGamal algorithms are equal. Thus, we can say that implementations of these digital signatures in microcontroller PIC18F45K22 have equal level of security, but the execution time and the energy consumption make the ElGamal algorithm more advantageous.

Further research could be based on advanced microcontrollers that provide the higher operating frequency and lower energy consumption, which is necessary in case of the most advanced security algorithms.

As corresponding author, I can provide original measurements data captured with oscilloscope (Figures

The authors declare that there are no conflicts of interest regarding the publication of this paper.

This work was supported in part by the Serbian Ministry of Education, Science and Technological Development under Grant TR32026 and in part by Ei PCB Factory, Niš, Serbia.