#### Abstract

In this paper, an effective framework for chaotic encryption based on a three-dimensional logistic map is presented together with secure hash algorithm-3 (SHA-3) and electrocardiograph (ECG) signal. Following the analysis of the drawbacks, namely, fixed key and low sensitivity, of some current algorithms, this work tries to solve these two problems and includes two contributions: removal of the phenomenon of summation invariance in a plain-image, for which SHA-3 is proposed to calculate the hash value for the plain-image, with the results being employed to influence the initial keys for chaotic map; resolution of the problem of fixed key by using an ECG signal, that can be different for different subjects or different for same subject at different times. The Wolf algorithm is employed to produce all the control parameters and initial keys in the proposed encryption method. It is believed that combining with the classical architecture of permutation-diffusion, the summation invariance in the plain-image and shortcoming of a fixed key will be avoided in our algorithm. Furthermore, the experimental results and security analysis show that the proposed encryption algorithm can achieve confidentiality.

#### 1. Introduction

In recent years, there has been a rapid development of multimedia including video, images, and audio. Computer science and network technology also promote the wide use of digital information. Among these categories of multimedia, images as an effective way to understand the colors play an important role in our daily life. However, because of illegal wiretapping, revision, or interception, there is an apparent lack of security for communicating images over the network, particularly some private images such as medical and military image. Structurally, cryptography is categorized into two classes [1, 2], namely, symmetric cryptography and asymmetric cryptography. It has supplied numerous effective ciphers for user information, particularly in the form of textual content. Owing to less computation requirement and high efficiency, we prefer symmetric cryptosystems in coding.

An image has some inherent characteristics and is different from textual content, for example, enormous data, high correlation, long redundancy, and bulk data capacity. Therefore, traditional methods such as advanced encryption standard (AES), data encryption standard (DES), or international data encryption algorithm (IDEA) are not effective options for image encryption [3, 4]. Chaos-based methods have recently become attractive for protecting image content. We can employ their superior properties such as control parameter, sensitivity to the initial condition, and nonconvergence in a chaotic system (or map). Numerous image encryption algorithms using chaos have been proposed [5–7], and their efficiency has been partially exhibited. Normally, two processes are adopted by the current image encryption algorithms: pixel permutation and pixel diffusion. First, to reduce the high correlation existing between adjacent pixels, permutation to the pixel positions is considered, for example, Arnold map transformation [8, 9]. However, the exchange of pixel positions alone cannot ensure security because of the nonvariance of the gray distribution in a plain-image. Thus, pixel diffusion is performed as a second step to reformulate the statistical distribution for pixels. It is more important to make a minor change in the plain-image such that it results in an entirely different cipher-image, i.e., realizing an avalanche effect. Compressive sensing was also introduced into the encryption process, and it exhibits a good effect [10].

As early as 1989, Matthews [11] proved that a chaotic sequence of random numbers can be obtained from a simple nonlinear iterative function and applied it for cryptographic use. In [12], the authors presented a symmetrical image encryption algorithm using a one-dimensional (1D) skew tent map, in which a bit-level permutation for pixels was employed. Instead of byte-permutation, a structure of diffusion layer followed by a bit-permutation layer was proposed by El Assad and Farajallah [13]. Although bit-level permutation operation can introduce double diffusion effects, it also leads to a longer time consumption. Logistic map is simple and widely used in performing image encryption with less computation [14]. However, it was shown to have some drawbacks such as a small key and weak security. To overcome these disadvantages of logistic map, Wang and Luan [15] proposed a three dimensional (3D) coupled logistic map. Additionally, various new and improved encryption schemes for images have been reported [16–18], which drives the development of chaos-based encryption methods. Chai et al. [19] proposed a new encryption scheme to resist common attacks using DNA sequence. This scheme is very sensitive to the plain-image after applying secure hash algorithm- (SHA-) 256. However, the time cost will be high because of the exchange between the decimal and binary systems. The same problem can be seen in DNA-based method [20]. In [21], a new hyper-chaos based algorithm has been proposed for image encryption. It computed a larger Lyapunov exponent in the new chaotic system. However, it did not consider the summation invariance in the plain-image. A plaintext-related image encryption system was designed in [22], which also employed a hyper-chaotic system to generate a random sequence. Although this system exhibits a good performance, it only uses fixed secret keys.

Unfavorably, various image encryption algorithms provide a low security. For example, Fu et al. [23] proposed a bit-level permutation scheme to encrypt an image, in which the diffusion effect can be achieved by a two-stage process of bit-level shuffling function using an Arnold map and chaotic sequences. Compared with some other image encryption algorithms with a permutation-diffusion structure, the algorithm has less computational complexity. However, Jolfaei et al. [24] pointed out that a permutation-only scheme for image encryption can be broken if a chosen-plaintext attack is applied. For a plain-image of size , the number of plain-images required to be chosen is (where is the number of different color intensities). One cycle of permutation-diffusion architecture was suggested in [25] for image encryption; the row and column permutations were used in the first stage, and an affine cipher was applied to modify the gray values in the diffusion stage. However, by a strategy of divide-and-conquer [26], a chosen-plaintext can efficiently attack this algorithm having a complex linear relation. In addition, there are numerous other cryptanalysis methods [27–30].

After conducting a detail analysis of the breaking methods, it can be concluded that the drawbacks of the image encryption algorithms are follows: permutation-only structure, diffusion-only structure, one cycle of permutation-diffusion architecture, key-dependence, and fixed keys. To overcome these limitations, a new image encryption model employing both electrocardiograph (ECG) signals and SHA-3 is proposed in this paper. In this model, an ECG signal is used as the initial condition for the chaotic map to handle the fixed key problem. Next, the hash values are extracted from a plain-image by the SHA-3 function and are employed to update the initial keys, which can avoid key-dependence problem. Similar to the entire algorithm, more than one cycle of the permutation-diffusion operation is considered before obtaining the final cipher-image. Moreover, compared with some recent references, the proposed method has numerous advantages. For example, in reference [3], an image encryption algorithm based on a two-dimensional (2D) chaotic map is presented. However, the keystream used in the encryption process is not related to the plain-image. Thus, secret keys and are fixed without considering the different plain-images. A hyperchaotic Rössler map was employed in [31] to design a confusion-permutation-based image encryption algorithm, in which , , and are the keys. However, keystreams , (for permutation), and (for diffusion) are the same for any plain-image of the same size. A new encryption method with a confusion-diffusion structure for the confidentiality and privacy of clinical information has been proposed by [32]. A 1D logistic map was used to generate the chaotic sequence. However, it suffers from numerous shortcomings, for example, small secret key space, nonuniform chaotic data distribution, and discontinuous chaotic ranges. Furthermore, sequences and used in [32] are also fixed for different ECG signals (original message) of the same length. In [33], a 3D chaotic system was adopted to generate random numbers. However, and for the S-box generation algorithm and for the bit exclusive OR (XOR) are obtained only from the fixed keys. A plain-image-based keystream generation was proposed in [34], in which pixel summation for the pixels were computed to affect the secret keys. However, if we modify two pixels with same summation for the plain-image, then the keystream will also be the same. Thus, this scheme suffers from summation invariance. To solve the problems of fixed keys and summation invariance, a new image encryption algorithm is designed in this study.

The remainder of this paper is organized as follows. Section 2 describes in detail the proposed image encryption algorithm. The simulation results are presented in Section 3 together with the security analysis. Finally, some conclusions are drawn in Section 4.

#### 2. Proposed Image Encryption Algorithm

##### 2.1. 3D Logistic Map and SHA-3

Recently, a 3D logistic map [35] with a better chaotic property than a 1D logistic map was studied. It can be defined by the following equation (1):When , , and are set, the 3D logistic map (1) exhibits a chaotic behavior if . Figure 1(a) shows the chaos phenomena of the 3D logistic map (initial 20 iterated values are discarded) using the initial conditions: , , , , , and . Figure 1(b) displays the bifurcation diagram for . Moreover, the Kolmogorov entropy is used to prove the chaos, for example, if =3.6324, =0.0193, and , then the Kolmogorov entropy is 0.4230, indicating the chaos behavior of the 3D logistic map.

**(a)**

**(b)**

SHA-3, designed by Bertoni, Daemen, Peeters, and Asschewest [36], is the newest hash function announced by the national institute of standards and technology (NIST), and it is highly sensitive to the input message and can perform quasi all symmetric cryptographic functions [36]. To solve the summation invariance in the plain-image and the problem of fixed keys, SHA-3 is used to compute the hash values of the plain-image. Here, the length of the output is set as 256 bits that are converted into 32 integer numbers (arranged into a vector ). Currently, the code package of SHA-3 algorithm has been made available to all the users.

##### 2.2. Generation of Initial Conditions

To solve the shortcoming of fixed keys, the secret keys will not be assigned ahead by the sender and receiver in our algorithm. It is known that different persons have different ECG signals, and they can even be different for the same person at different times. For example, Figure 2 shows two different ECG signals (all the ECG signals used in this study are chosen from [37]). The complexity of the biology of the human body makes it difficult to simulate or produce an ECG signal for any subject. Here, the Wolf algorithm [38] is employed to extract the property of an ECG signal, noted as . Subsequently, is decomposed into several decimal numbers treated as the control parameters and initial conditions for the 3D logistic map through the following equation:where represents the absolute value of , whereas rounds-off the element of to the nearest integer toward negative infinity.

**(a)**

**(b)**

##### 2.3. Encryption Process

One cycle of permutation-only, diffusion-only, or permutation-diffusion has been found to be insecure for image encryption. Therefore, to enhance the security with the proposed algorithm, three rounds of permutation-diffusion are employed in our new method. It is supposed that the plain-image is with size , and the cipher-image is denoted as .

###### 2.3.1. Permutation Operation

There is a natural strong correlation between adjacent pixels in a relevant plain-image, and a good encryption scheme should have the ability to decrease this correlation and obscure the pixel positions. Given a ECG signal, we can extract its property and then generate the initial conditions , , , , , and for the 3D logistic map. To relate the keystream to the plain-image, SHA-3 is firstly applied to the plain-image and we obtain hash vector that is divided into three factors by the following equation:

Subsequently, initial conditions , , and are updated by (4) and form new , , and . If the 3D logistic map is iterated a few times by the updated keys, chaotic sequences , , can be obtained. To increase the randomness degree, the initial iterated values should be discarded. Suppose three vectors , , and with length are produced (here, 200 is a random constant number considered as a control parameter). All the decimal numbers within , , and are transferred using (5), and the summation is calculated for Factor is obtained and is employed to select numbers from and numbers from . Assume that vectors and are generated and then used to perform a circular permutation for the plain-image along the row and column, respectively. After completing the permutation operation, permuted image can be obtained.

###### 2.3.2. Diffusion Operation

We know that a permutation-only scheme is insecure for any image encryption algorithm owing to the invariance of the statistical property; it only shuffles the pixel positions. Therefore, to ensure the security, a diffusion operation for the above permuted image, , is further considered in our method. By iterating the 3D Logistic map using the initial conditions , , and , vector is obtained containing all the elements , , and . Subsequently, it is arranged into matrix having the same size as the plain-image. Before being used in the diffusion operation, all the elements in should be transformed into integer numbers between 0 and 255 through (6) to satisfy the pixel interval.

For the keystream to be dependent on the permuted image, factor is introduced in the function of the diffusion operation. Equation (7) applies the diffusion in the row direction. Here, a natural row is treated as a unit.where represents the th row of image . is a constant vector. Similarly, the diffusion operation along the column direction can be processed for image . Finally, cipher-image is obtained after both permutation and diffusion are completed.

###### 2.3.3. Encryption Steps

For the entire permutation-diffusion structure (see the flowchart in Figure 3), our image encryption algorithm can be described by the following steps.

*Step 1. *Read the plain-image as matrix and obtain its size .

*Step 2. *Use the Wolf algorithm to produce initial conditions , , and and the three control parameters for the 3D logistic map from the ECG signal.

*Step 3. *Calculate the hash values for the plain-image using SHA-3 and convert them into hash vector .

*Step 4. *Generate factors , , and and update initial conditions , , and to obtain new , , and .

*Step 5. *Iterate the 3D logistic map with new , , and and obtain vectors and .

*Step 6. *Perform the circular permutation operation for plain-image and obtain permuted image .

*Step 7. *Iterate the 3D logistic map by , , and and obtain matrix .

*Step 8. *Compute factor for each row and column before the diffusion operation.

*Step 9. *Perform the diffusion operation for permuted image using along the row and column.

*Step 10. *Obtain cipher-image .

In view of the symmetric structure, the decryption steps for our encryption algorithm are the same but in an inverse order.

#### 3. Simulations and Security Analysis

For the simulations discussed in this section, plain-images Lena and Boat are randomly chosen for the tests. Some common security analyses are also used to evaluate the security of the proposed algorithm.

##### 3.1. Simulations

Using a computer equipped by a platform of Windows 7 with Intel(R) Core(TM) i3-2350, 2.30 GHz CPU, all the simulations are performed by the software Matlab R2011b. Figures 4(a) and 4(b) show the ECG signals of the same person but with one sample shifting. By considering the ECG signal in Figure 4(a) as the initial condition for the 3D Logistic map, Figure 4(d) shows the cipher-image generated corresponding to plain-image Lena in Figure 4(c), whereas the cipher-image for plain-image Boat in Figure 4(e) is displayed in Figure 4(f) after using our new method. The computational time cost for a plain-image of size is 0.1227s on an average.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

##### 3.2. Key Space and Its Sensitivity

Normally the key space should be kept as large as to resist brute-force attack [39]. In our algorithm, the ECG signals from 1000 samples are taken to generate the initial conditions for the 3D logistic map by the Wolf algorithm. Therefore, the data is sufficiently large to avoid key analysis. Moreover, if there is one sample shifting in the ECG signal, then the correct plain-image cannot be obtained. For example, Figure 4(g) shows the wrong decrypted image for Figure 4(d), whereas Figure 4(h) displays the decryption result for Figure 4(f). Figure 4(i) displays the correct decryption for the Lena image under the condition of using the same ECG signal. Therefore, the proposed algorithm is highly sensitive to the keys.

##### 3.3. Sensitivity of the Plain-Image

Any minor change in a plain-image should lead to a significant difference in the cipher-image to satisfy an ideal encryption algorithm. For the plain-image Lena, Figure 5(a) shows the cipher-image when there is a one-bit change in the plain-image, whereas Figure 5(b) depicts the difference before and after the one-bit change. Similarly, Figures 5(c) and 5(d) display the case for the Boat image. To numerically evaluate the sensitivity of the plain-image, the unified averaged changed intensity () and number of changing pixel rate () [40, 41] defined by (8) and (9) are usually considered in a cipher design. Various plain-images are randomly chosen to measure the sensitivity and the results are presented in Table 1. It can be seen that the values are approximately 33.4% and 99.6% [42]; i.e., the proposed method has a high sensitivity for the plain-image.

**(a)**

**(b)**

**(c)**

**(d)**

##### 3.4. Histogram Analysis

A statistical attack is a common analysis approach employed by cryptanalysts. If a designed encryption algorithm can generate a uniform distribution of the pixels in the cipher-image, then it can effectively resist the histogram attack [43–45]. Figure 6(a) shows the histogram of the plain-image Lena, whereas Figure 6(b) displays the histogram of its corresponding cipher-image obtained by using our method. Similarly, Figures 6(c) and 6(d) display the histograms for the Boat image before and after the encryption. Furthermore, the cipher-image of Lena is divided into two blocks vertically and horizontally and four blocks averagely. The results for the block histogram tests are displayed in Figures 6(e)–6(l). All confirm that the histogram of the cipher-image is different from that of the plain-image, and that an illegal statistical attack [46–48] will not affect our algorithm.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

**(j)**

**(k)**

**(l)**

##### 3.5. Correlation Coefficients Analysis

For an image in a natural case, a high correlation normally exists among most pairs of adjacent pixels because of pixel continuity. To test the ability of decreasing this correlation and then hiding the original information, the following function is usually employed to calculate the correlation coefficients:where is the total number of the samples, and represent the gray values of two adjacent pixels in the image, and , . Figure 7 shows the visual test results for the Lena image after applying the proposed method. It can be clearly seen that the correlation coefficients can be significantly deduced in the cipher-image compared with that of the plain-image.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

##### 3.6. Some Comparisons

In this subsection, to highlight the better performance of our method, we compare it with , , and entropy. Table 2 lists the results of the entropy analysis using different images. Clearly, the values from this work are more in agreement with the theoretical value 8. Regarding and , Table 3 shows the results of a one-bit change (OBC) at position (186,33) and two bits change at positions (186,33) and (105,110) but with the same summation (TBS) for different plain-images. Therefore, the sensitivity to the plain-image is higher particularly when two bits are changed, but the same summation is kept in the plain-image. Regarding the chosen/known plain-image attack, we mainly consider the relationship between the plain-image and generation of the keystream. Table 4 displays the comparisons with some references that show the advantages of our method.

##### 3.7. Extension to Other Images

Three more images are randomly taken from the SIPI image database as a test. Figure 8(a) shows the plain-image of a Chemical plant and Figure 8(b) displays its cipher-image for it. The corresponding images for a tank and truck are shown in Figures 8(c)–8(f).

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

##### 3.8. Application to Color Image

As to the case of color image, it can be divided into three channels, R, G, and B. Then we treat each of them as a gray image correspondingly. Consequently, the encryption process for each channel is similar using our proposed encryption algorithm. After that, the cipher-image can be obtained by integrating again the encryption result of each channel into a color image. Table 5 lists the entropy results for color images Lena and Peppers by the proposed algorithm. All values are near to the ideal case.

#### 4. Conclusions

To enhance the sensitivity of a plain-image and avoid the summation invariance in a plain-image associated with some algorithms, SHA-3 is employed in our proposed method to calculate the hash value. Then, an ECG signal generated by a human body is used to produce the initial conditions for the chaotic map including the control parameters. Consequently, the fixed key problem can be solved. Related analysis and experimental results have demonstrated that the proposed image encryption algorithm can be a secure model for image communication. There are two contributions, i.e., avoiding the low sensitivity in case of summation invariance and solving the fixed key and producing the effect of a dynamic key.

#### Data Availability

The 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.

#### Acknowledgments

This work was fully supported by the National Natural Science Foundations of China (no. 61602124, no. 61702116), the Natural Science Foundation of Guangdong Province of China (no. 2016A030310333), the Science and Technology Planning Project of Guangdong Province of China (no. 2017A010101025), the Program for Scientific Research Start-up Funds of Guangdong Ocean University of China (no. R17037), the Special Funding Program for Excellent Young Scholars of Guangdong Ocean University of China (no. HDYQ2017006), and the Natural Science Foundation of Guangdong Ocean University of China (no. P15238).