Abstract

In order to protect network information security and improve the security of wireless sensor networks, based on chaotic systems, we propose a wireless sensor algorithm based on improved identity encryption. First, the basic principle of chaotic system mapping is specifically analyzed; the two chaotic mapping systems are rectified to obtain the hybrid chaotic mapping system according to the demand of wireless sensing network. After that, an encryption framework and key are designed and the hybrid mapping system is applied to the encryption framework to encrypt the data. In this way, the length of the encryption algorithm is lengthened and the defensibility of the encrypted content is improved. Finally, the performance of the proposed encryption algorithm is tested in terms of information entropy, statistical methods, and ciphertext randomness. The test results show that compared with other encryption algorithms, the running speed of the encryption algorithm proposed in this paper is only 18.51 ms, which is faster than that of other encryption algorithms, and the memory consumption is only 27%, which is much lower than that of other algorithms. It can be seen that the proposed encryption algorithm has strong encryption effect and superior algorithm performance for data encryption in wireless sensor networks.

1. Introduction

With the continuous improvement of Internet technology, computers, cell phones, and many other computer devices are widely used and have become essential products for daily life, enhancing information exchange and enriching people’s entertainment. However, the widespread popularity and application of devices such as wireless sensors in computers have also brought about information security problems, and the security of people’s information on the network has been seriously threatened. Therefore, encryption technology was born. The current market research on wireless sensor network security mainly includes encryption algorithms and authentication schemes, which serve to guarantee data security and legitimacy. However, the complex node resources and small memory of wireless sensor networks lead to the low computational accuracy and poor results of the existing encryption algorithms for wireless sensor networks. Among them, chaotic system has the characteristics of sensitivity to initial value, ergodicity, pseudo-randomness, etc., which meets the characteristics of diffusion and obfuscation in encryption algorithms and achieves preliminary application results in information security. For network information encryption, scholars and experts have conducted in-depth research. Maram et al. proposed a dynamic S-box approach to process Unicode text data [1]. Ahmad et al. proposed to use the Diffie–Hellman technique to exchange the encryption key generated by TTI algorithm with another party as a way to improve the security of sensitive information transmission [2]. Liang et al. proposed a dynamic key encryption-decryption neural network chaotic algorithm, and the results showed that the encryption-decryption speed and anti-decryption ability of the method had a great improvement [3]. Chaotic encryption algorithm was widely used, for example, Deng and Xiao applied the chaotic algorithm to the encrypted transmission of RFID, and the results showed that the algorithm can meet the security requirements of object RFID [4]. Zhang et al. applied chaos algorithm to video transmission encryption to encrypt the differential components of motion vectors in horizontal and vertical directions as well as DC transform coefficients, respectively, and achieved good results [5]. Ge et al. proposed an encryption method for images based on cross-diffusion of logistic mapping and Chebyshev mapping by combining chaos algorithm. The results indicated that the encryption algorithm had high security [6]. Wu et al. proposed a chaotic compressed sensing algorithm for OFDM-PON networks, with results showing that the method can save bandwidth and improve the security of OFDM-PON networks [7]. The above studies show that chaotic algorithm is widely used in the field of data transmission [817]. Therefore, this study proposes an improved chaos-based encryption algorithm for wireless networks based on the characteristics of chaos algorithm and verifies the feasibility of the proposed algorithm.

2. Basic Methods

In the field of network information security, chaotic systems possess sensitivity, ergodicity, and unpredictability that have led to smaller applications in information security. Chaotic mappings are mainly divided into logistic mappings and cubic mappings.

Logistic mapping is in one-dimensional form in chaotic systems and can be expressed aswhere μ is a parameter and when μ (3.57, 4), the logistic mapping exhibits chaotic properties.

The cubic mapping is calculated aswhere both a and b are parameters, the output range of Cubic mapping is shown in Figure 1, and the mapping range becomes progressively smaller with increasing parameter a.

As shown in Figure 2, a bifurcation point will occur when the parameter b is higher than 2.3, and the chaotic system is in a chaotic state at this time. To obtain better pseudo-randomness, a is set to 4 and b is set to 3. The cubic mapping expression is obtained as follows:

In wireless sensor networks, chaotic systems cannot perform complex calculations on the network due to the problems of small network memory and poor computational power. To apply chaotic systems to wireless sensor network encryption, the chaotic system needs to be rectified.

The logistic mapping can also be expressed aswhere λ is a parameter. The logistic mapping integerization in chaotic systems consists of three main steps, as follows:(1)Multiply both sides of equation (4) by at the same time and obtain the following equation(2)Construct an equation:After a simple treatment of equation (6), equation (7) is calculated as follows:(3)Substitute equation (7) into equation (5) and set the parameter λ to 2. The final integer logistic mapping equation is obtained as

In equation (6), xn interval is [−1, 1]; zn interval is [0, 2m]; if zn are integers, then m = 2L−1, thus obtaining the zn interval as [0,2L].

Equation (8) contains two zeros, zn = 0 and zn = 2m. If the initial iteration value is 0 or 2m, the value of all subsequent iterations will be 0. To prevent the above situation, equation (8) will be optimized:

There are no zeros in equation (9) so that all iteration values will not be 0.

According to the cubic mapping of equation (3), it is integerized as follows:(1)Construct the following equation:(2)Substitute equation (10) into equation (3) to obtain the following equation:

In equation (10), the xn interval is [−1,1], and the yn interval is obtained as [0, 2c]. If the yn values are all integers, then c = 2L−1, and the yn interval is [0, 2L].

Equation (11) contains several zeros, yn = 0, yn = 1.5c, and yn = c. If the initial iteration value is 0, 1.5c, or c, then all subsequent iterations have a value of 0. Thus, equation (11) is optimized to obtain the following equation:

There are no zeros in equation (12), and the iterative value of 0 does not occur when iterating.

3. Improved Identity Encryption Algorithm

3.1. Cryptographic Framework

The chaotic algorithm after integer is computed by Feistel cryptographic framework as shown in Figure 3, and the encryption process is as follows:

The Feistel structure belongs to a symmetric cryptographic framework in which the round function F has an important impact on the performance of the algorithm. The main details of the round function F are shown in Figure 4.

In Figure 4, is the XOR operation. The round function encryption process is divided into three main steps, as follows.(1)First a 32-bit plaintext is divided into two parts of equal length, each side of length 16; then, a part is divided into two parts of equal length, of length 8.(2)The two 8-bit plaintexts are followed by the number “0” to bring their length to 16 bits.(3)The round key will be XOR operated on the 16-bit plaintext separately, followed by the logistic and cubic mappings, and then the XOR operation will be performed. Finally, the XOR value is passed through a 16-bit permutation matrix to obtain the output.

The algorithm encrypts a total of 4 rounds, i.e., r = 4.

3.2. Generation of Round Key

In the above, the performance of the two chaotic systems degrades gradually after the integerization, which leads to the reduction of their sequence randomness. Therefore, to solve the above problem, the two chaotic systems are mapped together to obtain one hybrid chaotic system.

Also, this part generates the initial values of the hybrid chaotic system by a linear congruential generator. The linear congruential generator expression is given by [18, 19]

With the addition of a linear congruential generator to the hybrid chaotic system, the period of the sequence generated by the hybrid chaotic system is extended to 231–1. The specific flow of generating chaotic sequences is shown in Figure 5.

The autocorrelation of integer logistic mapping and integer cubic mapping in a 16-bit processor is shown in Figures 6 and 7.

From Figures 6 and 7, it can be seen that the autocorrelation of logistic and cubic chaotic mappings is poor, which affects their encryption effect. Therefore, the study will use the quantization operation method to enhance the autocorrelation of the two chaotic systems. The autocorrelation of the sequences generated by the quantized hybrid chaotic system is shown in Figure 8, from which it can be found that the autocorrelation image is mainly in the form of impulse function, which indicates that the sequences generated by the quantized hybrid chaotic system have better autocorrelation and can achieve better encryption effect.

An arbitrary 32-bit sequence is selected from the sequence generated by the hybrid chaotic system and divided into two parts of equal length, labeled k1 and k2, respectively [20, 21].

As shown in Figure 9, k1 and k2 are used as the initial values for generating the round key, the process of which is divided into three main steps, as follows.(1)The initialization matrix M is generated by k1 and k2.(2)Loop the value of matrix M twice and assign all of them to matrix N afterwards.(3)Eight shift operations are performed on the matrix and the values in the matrix to obtain the eight round keys needed for encryption.

3.3. Permutation Matrix

In cryptography, the permutation operation is a typical practice whose main function is to complicate the relationship between plaintext and ciphertext. In the chaotic encryption algorithm, the study will be represented by a permutation matrix :

In the matrix, each parameter is the position of the input sequence. The parameter “10” means that when the input sequence passes through the permutation matrix, the parameter at the tenth position becomes the parameter at the first position of the output sequence. This can be expressed as follows:

3.4. Decryption

From the above cryptographic framework, it is clear that the Feistel structure is a symmetric state and the decryption and encryption steps are roughly the same. The difference lies in the order of using the round keys, such as the order in encryption ; conversely, the decryption round key is the reverse of the encryption round key . The decryption is calculated as in equation (15) [2224]:

Meanwhile, the substitution inverse matrix P−1 can be expressed as

From P−1 matrix, we can see that the element in the first position of the input sequence becomes the element in the eleventh position of the output sequence after permutation; if we want to restore the element in the eleventh position of the output sequence to the first position of the input sequence again through the permutation inverse matrix, we need to set the first value of the permutation inverse matrix to 11, and so on, to obtain the permutation inverse matrix.

4. Experimental Results and Analysis

4.1. Experimental Environment

To verify the effectiveness of the proposed algorithm performance, this experiment will be implemented using C program and the algorithm will be applied to the ZigBee platform, which contains 128 KB of ROM, 4 KB of RAM, and a CC2530 microprocessor.

4.2. Algorithm Evaluation Index
4.2.1. Information Entropy

In order to test the performance of hybrid chaotic systems, i.e., to test the system complexity and security, the experiment will use information entropy to verify the performance of chaotic systems. The higher the value of information entropy, the stronger the complexity of the system. That is, the information entropy can effectively measure the system. If the length of the ciphertext is 8 bits, the information entropy is taken to be about 8 for better encryption. The expression of information entropy is as follows [25]:

The entropy of various ciphertext information of different lengths is shown in Table 1.

From Table 1, we can visually see that the ciphertext length is extended from 16000 to 800000, and its information entropy is increased from 7.9642 to 7.9999, which is very close to the standard value of 8. This shows that the ciphertext has strong randomness and also proves that the system has better performance, complexity, and security and can effectively avoid external attacks on network information.

4.2.2. Confusion and Diffusion

In encryption algorithms, confusion and diffusion are the two basic principles that must be followed. Confusion serves to complicate the relationship between the plaintext and the ciphertext, and diffusion, i.e., the maximum impact on the ciphertext through the plaintext, further enhances the security of the ciphertext.

In order to verify the confusion and diffusion effect of the encryption algorithm and to evaluate and assess the performance of the encryption algorithm more objectively, the degree of completeness, degree of avalanche, and degree of strict avalanche are used as evaluation indexes in this experiment.

If an encryption algorithm encrypts a plaintext of n bits into a ciphertext of m bits, the performance of the encryption algorithm is measured using the above three criteria. Completeness represents the existence of correlation between each bit of the plaintext and all bits of the ciphertext species, and the completeness expression is as follows:

The avalanche degree represents that each change of one bit in the plaintext will change at least nearly half of the bits of all ciphertexts, and the avalanche degree expression is as in equation (18):

The strict avalanche degree is the probability that for each bit changed in the plaintext, each bit in the ciphertext is changed at least 50%, which is expressed as follows [2628]:

In the above equation, aij denotes the i-th row and j-th column element inside the dependency matrix a containing n∗m elements, i takes values in the range (1, n), and j takes values in the range (1, m). If the i-th element of the plaintext is changed, the j-th element of the ciphertext changes; then aij = 1; otherwise aij = 0.bij denotes the i-th row and j+ 1-th column element inside the distance matrix B containing n∗(m + 1) elements, i takes values in the range (0, n), and j takes values in the range(0, m). If the i-th element of the plaintext is changed, the plaintext is changed by j bits, and then bij = 1. The symbol X represents the total number of bits in the plaintext; # indicates the summation symbol.

If the values of dc, da, and dsa meet the criteria of equation (20), it means that the proposed algorithm possesses good results in confusion and diffusion.

The trends of the above three evaluation indexes under different encryption rounds are shown in Figures 1012.

The change curves of dc, da, and dsa indicators from Figures 1012 show that when the number of encryption rounds is 4, da and dsa show stable trends with no significant change. The optimal number of encryption rounds can be determined to be 4, thus minimizing the resource loss of wireless sensors and ensuring the security of encrypted information.

To further verify the superiority of the proposed encryption algorithm based on hybrid chaotic system, this experiment compares the designed algorithm with the traditional two encryption algorithms of RC5 and RC6 for wireless sensor network for confusion and diffusion, and the comparison results obtained are shown in Table 2.

From the above table, the dc values of all three algorithms are 1, which indicates that the completeness of all three algorithms is good. da and dsa of the proposed algorithm are 0.998 and 0.999, respectively, which are both higher than those of the other two algorithms, by (0.005, 0.12) and (0.007, 0.009), respectively, compared to the RC5 and RC6 encryption algorithms. This shows that the proposed algorithm is more effective in confusion and diffusion, and the algorithm performs better than the traditional encryption algorithm.

4.3. Statistical Analysis

In order to verify the randomness of the ciphertext after performing the encryption algorithm, this experiment will perform a statistical analysis of the length of the ciphertext, with 0 and 1 as the criteria, and the number of ciphertexts is 0 or 1, indicating that they are roughly the same. The statistical analysis table is shown in Table 3.

From the above table, it can be seen that after encryption by encryption algorithm, ciphertext of different lengths can be obtained. The number of “0” and “1” in the ciphertext is very close to each other and gets closer after increasing the length continuously, indicating that the ciphertext data achieve the 0-1 balance objective.

In the plaintext, the ASCII distribution is uneven. After encryption, the ASCII distribution gradually tends to be homogeneous, which means that the encryption algorithm can effectively defend against probabilistic attacks. The ASCII distributions of both are shown in Figure 13.

As can be seen from the above graph, the plaintext ASCII distribution shows a large undulating peak at 50, 100, and 150, indicating a higher probability of aggressiveness and a lower defensibility in the plaintext, which makes it vulnerable to external intrusion and threats. After encrypting the plaintext, the ASCII code values shown in Figure 13(b) are obtained. It can be seen that the probability of ASCII code values is all around 40%, which indicates that they are very evenly distributed and further proves that the encrypted ciphertext is more defensive and less likely to be attacked.

4.4. SP 800-22 Test

In order to test whether the ciphertext sequence is secure after using the encryption algorithm, this experiment is conducted to test 15 information security items of SP800-22. There are 1 million bytes in this ciphertext, and it is divided into 400 copies equally. The test results of this information are as follows. If all the values in the table are more than 0.01, it indicates that the ciphertext sequence information meets the criteria.

As can be seen from Table 4, the values of the ciphertext sequences are all above 0.01, with the lowest being 0.012351 and the highest being 0.943113. The experimental results show that all the above sequences meet the standard and satisfy the requirements of wireless sensor information security protection.

4.5. Running Speed and Memory Consumption

In order to test the suitability of the designed encryption algorithm in wireless sensor networks, the experiment will test the algorithm in terms of its running time and memory consumption and compare the algorithm with the traditional encryption algorithms RC5, SKIPJACK, and CWSN to obtain the following results.

It is obvious from Table 5 that the designed algorithm runs at 18.51byte/ms, which is 5.7, 7.28, and 1.93 higher than that of the other three algorithms, respectively, indicating that the algorithm runs faster; the memory consumption of the proposed algorithm is 96, and that of the other three algorithms is 268, 356, and 160, which exceeds that of the algorithm proposed in the study by 172, 260, and 64. After comprehensive analysis, it is shown that the proposed algorithm runs the fastest and takes up the least memory in wireless sensor networks and is very suitable for the operation of wireless sensor network.

5. Conclusion

In summary, the proposed identity encryption algorithm for hybrid chaotic systems can be applied to wireless sensor network security protection, which can solve the problems of complex node resources and small memory of wireless sensor networks, and the algorithm can further enhance the defense capability of ciphertext and reduce the attack probability. The experimental results suggest that with different ciphertext lengths, the ciphertext information entropy is close to 8 after using the improved encryption algorithm, the ciphertext randomness is significantly improved, and the performance of the hybrid chaotic system is enhanced. With the number of ciphertext encryption rounds close to 4, the resource loss of the wireless sensor network is minimized, thus simplifying the network nodes, reducing the computational cost, and improving the network security. Finally, after comparing the proposed algorithm with the traditional encryption algorithm, it is found that the improved algorithm has better confusion and diffusion effects than the traditional algorithm, and the algorithm has better performance. The operation speed is faster than that of other algorithms, and the memory consumption is smaller. Comprehensively, it can be seen that the proposed algorithm can be applied and promoted in wireless sensing networks. However, due to the experimental conditions and insufficient research experience, this experiment only encrypted text information, and the proposed algorithm cannot encrypt images and other types of information well, and thus there are certain limitations, and in the future, we will start from this aspect and apply the algorithm to information such as images and videos to improve the performance and applicability of the algorithm.

Data Availability

The experimental data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.