Abstract

This paper proposes a new image compression-encryption algorithm based on a meaningful image encryption framework. In block compressed sensing, the plain image is divided into blocks, and subsequently, each block is rendered sparse. The zigzag scrambling method is used to scramble pixel positions in all the blocks, and subsequently, dimension reduction is undertaken via compressive sensing. To ensure the robustness and security of our algorithm and the convenience of subsequent embedding operations, each block is merged, quantized, and disturbed again to obtain the secret image. In particular, landscape paintings have a characteristic hazy beauty, and secret images can be camouflaged in them to some extent. For this reason, in this paper, a landscape painting is selected as the carrier image. After a 2-level discrete wavelet transform (DWT) of the carrier image, the low-frequency and high-frequency coefficients obtained are further subjected to a discrete cosine transform (DCT). The DCT is simultaneously applied to the secret image as well to split it. Next, it is embedded into the DCT coefficients of the low-frequency and high-frequency components, respectively. Finally, the encrypted image is obtained. The experimental results show that, under the same compression ratio, the proposed image compression-encryption algorithm has better reconstruction effect, stronger security and imperceptibility, lower computational complexity, shorter time consumption, and lesser storage space requirements than the existing ones.

1. Introduction

In the background of rapid development of information networks, emergence of artificial intelligence, big data, 5G cellular communication, and the Internet of Things, technology is imperceptibly changing the way of life for most people, bringing convenience into their lives, while also increasing the exposure of private and personal data. Digital images occupy the major share in information transmission carriers, because of the intuitive nature and large quantity of information they carry. Due to low operation costs, the copying, cropping, and forwarding of images make important information available on unsafe public channels, which seriously infringes on users’ data privacy. Therefore, the efficient protection of digital images on unsafe public channels has become a popular field of research for experts and scholars, and a series of image encryption algorithms have been proposed.

The original image encryption algorithms were based on the “confusion-diffusion” encryption framework proposed by Fridrich. With the continuous development of hardware technology and cryptanalysis technology, most of the current image encryption algorithms are designed by integrating various technologies, such as DNA coding [1], optical technology [2], cellular automata [3, 4], and asymmetric cryptosystems [5], which guarantees the security of image transmission and storage on some resource sharing platforms. However, with the rapid development of communication networks, the increasing demand for real-time transmission, and increasing image sizes, ensuring the security and real-time performance of the transmission of massive images in bandwidth-constrained networks has become an urgent problem that needs to be solved.

This provides the scope for image compression to be used, due to the characteristics of the human visual system (HVS) and the high redundancy of the sampled and quantized digital images. The compressed image has wider applicability and is more efficient in storing and transmitting in a bandwidth-constrained network, which greatly alleviates network congestion. In 2006, the introduction of compressive sensing brought a new perspective on image compression technology [6, 7]. Compressive sensing theory points out that, under the premise that the sampling rate is far less than Nyquist’s, the signal can be sampled and compressed simultaneously because of the its sparsity in a transform domain. The process of reconstructing the signal is an optimization problem, and the original signal is reconstructed with high probability from little observations by solving this optimization problem. Following this principle, many image encryption algorithms were developed based on compressive sensing [818]. Zhou et al. [8] proposed combining high-dimensional chaotic systems to compress and encrypt the image with 2D compressed sensing and then to reencrypt the image by the cyclic shift operation. This algorithm has higher security, but the original image reconstruction effect is poor. Similarly, Xu et al. [9] designed a new 2D-SLIM chaotic map, which uses compressive sensing to compress and encrypt the image along both row and column directions, which is 2D compressed encryption, and then reencrypt along row and column directions. The proposed algorithm has low complexity and high security, but the robustness of the algorithm is not great, and the reconstruction effect of the original image is poor. Chai et al. [10] used the memristive chaotic system, elementary cellular automata (ECA), and compressive sensing (CS) to encrypt and compress images. This can resist plaintext attacks with high robustness and security. Compressive sensing is suitable not only for ordinary digital images but also for compression and encryption of medical images. Reference [11] applies compressive sensing to medical images, achieving compression and confidentiality for them. Gong et al. [12] used compressive sensing to compress and encrypt images using bitwise XOR operations and pixel scrambling. Compressive sensing greatly improves the efficiency of image compression and encryption, but when large-scale images are observed and reconstructed, the storage space required is large, the computational complexity of the algorithm is high, and the reconstruction time is long. Therefore, Lu Gan proposed “block compressed sensing” [15], in which an image is divided into uniform nonoverlapping blocks. By observing and reconstructing these blocks separately, the computational complexity is greatly reduced, as is the required storage space. Simultaneously, the time taken for image reconstruction is shortened. Reference [16] divides an image into four equal-sized blocks, uses two different measurement matrices to measure and encrypt each of the images, then employs random pixel scrambling, and finally merges them into a single encrypted image. The security of the resulting algorithm is higher, but the block effect of the cipher image after segmentation is more obvious. In [17], block compression sampling is applied to resource-constrained wireless visual sensor networks (WVSNs), which makes the image more robust when transmitted over unreliable channels. In [18], after the plain image is divided into blocks, the discrete cosine transform is applied to it, and the obtained low frequency, high frequency, and intermediate frequency are observed by different measurement matrices. Following that, forward diffusion, disturbance, and backward diffusion operations are applied to it to generate the final encrypted image. The algorithm is highly efficient and requires a short reconstruction time and low storage space.

Reference [19] proposes a new image encryption framework: encrypting images into visually meaningful cipher images. In fact, it combines image encryption with information hiding technology and hides the original image in a carrier image after encryption, so as to achieve a visually meaningful effect. This image encryption method camouflages the existence of the original image, thus reducing the possibility of being attacked to a certain extent. As of now, many meaningful image encryption algorithms have been proposed [2033]. Inspired by [19], the work of [20] embeds multiple color images into nonessential areas of the carrier image to achieve visually meaningful effects. The algorithm has a large embedding capacity and high robustness. Reference [21] encrypts the original image using zigzag confusion and compressive sensing, and then embeds it into a carrier image. The algorithm is quite robust but suffers from poor real-time performance and long encryption and decryption times. Compared to [21], the paper [22] uses parallel compressive sensing and integer discrete wavelet transform (IWT) to realize meaningful image encryption, which makes the algorithm more applicable and less time-consuming. However, it was pointed out in [23] that the construction of measurement matrices increases the computational complexity and storage requirements. Therefore, combining compressive sensing and DWT, multiple plain images are encrypted and embedded them into the carrier image. Following the HVS model, [25] decomposes the carrier image by lifting wavelet transform (LWT) and then adaptively embeds the preencrypted secret image into the corresponding coefficients of the carrier image to achieve the camouflage. Reference [28] combines DWT and CS to encrypt the image, but the restoration effect of the original image is poor. Reference [31] uses compressive sensing and discrete cosine transform- (DCT-) singular value decomposition (SVD) for medical image steganography. The restoration effect of the algorithm is good, but compressive sensing is performed upon the original image directly. After being attacked on a channel, the restoration effect of the image is observed to be poor and the robustness is not high. Reference [32] embeds the preencrypted secret image into the sparse representation coefficients of the carrier image by dictionary, which has a high embedding rate but poor robustness. In [33], a kind of novel substitution boxes (S-boxes) based on quantum walk is designed, in which LSB algorithm is used to hide the plain image.

In summary, a new image encryption algorithm is proposed in this paper. Firstly, the plain image is divided into four nonoverlapping blocks of equal size, and then the four blocks are rendered sparse by DWT. To reduce the block effect caused by block compression, the sparse plain image is preencrypted by using zigzag confusion before compression, and then each block of the preencrypted image is compressed and combined into the secret image. After the 2-level discrete wavelet transform of the carrier image, the obtained low-frequency and high-frequency coefficients are further subjected to DCT, and the post-DCT coefficients of the secret image are superimposed and restored to obtain the final encrypted image.

The rest of this paper is structured as follows. In Section 2, compressive sensing technology used by the algorithm, chaotic map, and zigzag scrambling are introduced. In Section 3, the encryption algorithm is introduced in detail. In Section 4, the decryption algorithm is introduced in detail. In Section 5, a simulation experiment is presented. In Section 6, the safety analysis and comparison experiments of the algorithm are presented. In Section 6, a conclusion is drawn.

2.1. Compressive Sensing

Compressive sensing can sample and compress the signal simultaneously, as long as sampling rate is far less than the Nyquist sampling rate, and recover the original signal with high probability from small observations. The detailed description is as follows.

Suppose that there is an -dimensional signal , which can be expressed in some transform domain as follows:where represents a set of orthogonal basis matrices, and is the coefficient vector of signal in the transform domain . When there are nonzero values in the vector , , the signal is compressible in the transform domain , which is expressed as follows:where is a measurement matrix with a size of , and is the associated sensor matrix. To correctly reconstruct the original signal from the measured value , the sensor matrix must satisfy the RIP [34]. It has been pointed out in some literatures that an equivalent condition for the sensor matrix to satisfy the RIP is that the measurement matrix is not related to the sparse basis . Therefore, choosing a suitable measurement matrix is conducive to high-quality image restoration. In this paper, a partial Hadamard matrix is selected as the measurement matrix.

In addition, the signal reconstruction process is an optimization process. When the sensor matrix satisfies the RIP condition, the original signal can be recovered with high probability from the observed values by solving the optimization problem presented in

As of now, many reconstruction algorithms have been proposed, such as MP, OMP, BP, and SL0. This paper uses OMP for image reconstruction.

2.2. Chaotic Map
2.2.1. The Logistic Map

The logistic map is one of the classical chaotic systems. The mathematical formulae are as follows:where the parameter . The logistic map is used to control the generation of the measurement matrix.

2.2.2. The Logistic-Tent System

Compared to a single logistic map or a single tent map, the Logistic-Tent System combines these two chaotic systems as seed maps to form a low-dimensional composite chaotic system [35]. The specific expressions are as follows:where the parameter . The Logistic-Tent System has better chaotic characteristics than the logistic map and the tent map. In this paper, we use this map to generate the initial position of zigzag confusion and the scrambling sequence of subsequent scrambling operations.

2.3. Zigzag Confusion

In the image encryption algorithm, zigzag confusion is a common method of scrambling image pixel positions. As shown in Figure 1, starting with the point , zigzag confusion scans the elements of the matrix according to a zigzag path and then stores them in a one-dimensional array. It then rearranges them in a certain order into a two-dimensional array, which disturbs the positions of the pixels in the image and reduces the correlation between adjacent pixels. The initial position of zigzag confusion is particularly important. To improve the ability of the algorithm to resist known-plaintext attacks and chosen-plaintext attacks, this paper takes the information of the original image and uses the Logistic-Tent System to generate the initial position of the scrambling, which improves the security of the algorithm.

Assuming that the size of the plain image is , the sum of the pixel values of the image is , and the block size of the image is , this paper uses the Logistic-Tent System to generate a chaotic sequence with length and discards the first chaotic values to eliminate the transient effect. Then, the starting position of zigzag confusion is generated according to

The remaining chaotic sequence of length is used for subsequent image scrambling operations.

3. The Proposed Image Compression and Encryption Algorithm

Referring to the idea of block compressed sensing, the obtained secret image is embedded into the carrier image using DWT and DCT after plain image block compression. The flow chart of the encryption algorithm is shown in Figure 2. The detailed encryption steps are as follows.

3.1. Block Compression-Encryption Process

The detailed steps are as follows:Step 1: assuming that the size of the plain image is , the plain image is first divided into equal and nonoverlapping blocks, each of which has . Considering the subsequent embedding operations, the plain image is divided into four blocks , i.e., , .Step 2: a sparse base of size is constructed, and DWT is applied separately to each block to render them sparse:Step 3: to reduce the block effect caused by block compression and improve the robustness of the algorithm, the preencrypted block is obtained by scrambling the sparse plain image as described in Section 2.3:where .Step 4: the dimension reduction observation is carried out. Partial Hadamard matrix is constructed by the logistic map to be used as the measurement matrix. The specific construction process is shown in Algorithm 1.

3.2. Embedding Process of the Secret Image

The detailed steps are as follows: (Algorithm 1)Step 1: after applying 2-level DWT to the carrier image , the low-frequency component and the high-frequency component are obtained. Then, a discrete cosine transform (DCT) is performed on and to obtain the corresponding DCT coefficients and .Step 2: to facilitate the embedding of the secret image, it is divided into two blocks, and , of size . Similarly, a discrete cosine transform (DCT) is also used to obtain and .Step 3: the DCT coefficients of low-frequency and high-frequency components of the secret image blocks are embedded into the DCT coefficients of carrier images with a certain embedding strength, as shown inwhere are the embedding intensity factors, both of which take the value 0.1.Step 4: the final encrypted image is obtained by IDCT and IDWT.

Input: The secret key pairs , , compression ratio .
Output: Measurement matrix .
(1)Iterate logistic map times with the initial parameter and ; the first chaotic values are discarded, and two chaotic sequences and of length are obtained.
(2). The index sequence is generated. Similarly, , and the index sequence is generated.
(3)Generate order Hadamard matrix and disturb Hadamard matrix row by row based on index Sequence , i.e., ,
where , and is the compression rate of the image.
(4)Then, disturb Hadamard matrix column by column based on index Sequence , i.e., , where . Finally, measurement matrix is obtained.
Step 5: observe the preencrypted block by generating the partial Hadamard matrix :Here, the measured value image has a size of , .Step 6: considering the subsequent embedding process, we set and then merge the four blocks mentioned above to get a block of size , where , .Step 7: considering the restoration effect of the encrypted image, each image block is quantized uniformly, so that the element value is mapped to the range :where and are the maximum and minimum values in the image , and represents the rounding down operation.Step 8: considering the security and robustness of the algorithm, the merged quantized image is rescrambled. According to the residual chaotic sequence obtained in Section 2.3, the scrambling operation is performed by equation (11) to obtain the secret image :where .

4. Process of Image Decryption

The decryption flow chart is shown in Figure 3. The specific operation is as follows:Step 1: after 2-level DWT is applied to the encrypted image and the carrier image , and , , and are obtained, respectively.Step 2: DCT coefficients of the secret image are restored byStep 3: after the inverse DCT, the left and right image blocks are merged to obtain the secret image .Step 4: inverse quantization is performed after the secret image is inversely scrambled:Step 5: the inverse quantized image is divided, and each block is reconstructed using the reconstruction algorithm OMP, followed by the application of the inverse zigzag confusion and the inverse wavelet transform. Finally, the parts are merged again to obtain the original image .

5. Experimental Results

The encryption algorithm used in this paper is based on the Windows 10 platform using Matlab R2016a. The experiment randomly selects two plain images of size for algorithm testing. The size of the carrier image is taken to be and uniformly selected as a landscape painting. Both chaotic systems are iterated 100 times to eliminate transient effects. The starting position of the zigzag confusion is determined by the pixel sum of the plain image and that of the Logistic-Tent System, which ensures that the algorithm resists known-plaintext attacks and chosen-plaintext attacks. The initial state values are and , the parameters of the logistic map are , the initial state value is , and the parameter of the Logistic-Tent System is . Following that, the DWT chooses the Haar wavelet, and the reconstruction algorithm chooses the OMP because of low complexity and high recovery quality.

Figure 4 shows the encryption and decryption effects for different plain images. Generally, for meaningful image encryption frameworks, peak signal-to-noise ratio (PSNR) or normalized correlation (NC) coefficient are used to evaluate the imperceptibility of the encrypted images or the restoration quality of decrypted images. The unit of PSNR is dB. The PSNR is positively correlated with the imperceptibility of the encrypted image and the restoration quality of the decrypted image and is negatively correlated with image distortion. Similarly, as the NC value increases, the similarity between the two images increases as well. The specific formulae are as follows: if we assume that the size of the plain image is and that the encrypted image or the decrypted image is denoted by , then

A landscape painting is chosen as the carrier image in this experiment. Landscape paintings have a characteristic hazy beauty. As the carrier image, it hides the existence of secret image to a certain extent and achieves an effect of camouflage, increasing the security of the secret image. The compression ratio taken here is 0.5. Figures 4(a), 4(f), and 4(k) are three different plain images and Figures 4(d), 4(i), and 4(n) are the corresponding encrypted images. Their PSNRs are 34.5665 dB, 34.9369 dB, and 34.8205 dB, respectively. Figures 4(e), 4(j), and 4(o) are the corresponding decrypted images, and the corresponding PSNRs are 34.5722 dB, 30.0233 dB, and 29.8787 dB, respectively.

Table 1 shows the hiding effect and recovery quality of different plain images. PSNR1 shows the peak signal-to-noise ratio (PSNR) for the carrier image before and after hiding while PSNR2 shows recovery effect. So, it can be seen that the proposed method has good imperceptibility and recovery effect.

6. Security Analysis

6.1. Key Space Analysis

A secure and efficient encryption algorithm should have a key space of at least . In this paper, the initial state values , the parameters of the logistic map which control the generation of the measurement matrix, the initial state value , and the parameter of the Logistic-Tent System are used to generate the initial position of the zigzag confusion and the subsequent disturbance operation; that is, the key to the encryption algorithm is . When the precision reaches , the key space of the proposed encryption algorithm is . Therefore, the key space of the encryption algorithm proposed in this paper is large enough to resist brute-force attacks.

6.2. Key Sensitivity Analysis

Key sensitivity is an important index to evaluate the security of an encryption algorithm. If the decrypted images are significantly different when the key changes slightly, it shows that the proposed algorithm is sensitive to the key. This paper mainly tests the decryption key sensitivity of the algorithm, as shown in Figure 5. Figure 5(a) is a plain image, Figure 5(b) is the encrypted image, and Figure 5(c) is the decrypted image. In this experiment, , and so Figures 5(d)5(h) modify one of the decrypted keys, while the other keys remain unchanged. It can be seen that when the decryption key changes slightly, the image cannot be restored at all. So the key sensitivity of the algorithm is strong.

6.3. Histogram Analysis

The encryption algorithm proposed in this paper is based on a meaningful image encryption framework. So, our main purpose is to prove the similarity between encrypted image and carrier image by comparing their histograms, i.e., measure the imperceptibility and the difference between the plain image and the encrypted image to establish the security of the algorithm. Thus, the histogram analysis reflects the reliability and security of the algorithm. As shown in Figure 6, the histogram of the carrier image is similar to that of the encrypted image, which shows that the plain image is well camouflaged and that the histograms of the plain image and the encrypted image are quite different, which shows that the algorithm is highly secure.

6.4. Comparison

This paper draws on the idea of block compressed sensing and then compresses and encrypts the plain image and embeds it in a carrier image. Therefore, image reconstruction is less time-consuming than in the case of a general image encryption algorithm based on compressive sensing. The reconstruction algorithm OMP is chosen. Here, [21] and [31] were selected for experimental comparison. The size of the plain image “Lena” is , and the carrier image uniformly selects the landscape painting. Since the internal structure of each algorithm is different, the sizes of the carrier images and the compression ratio of the images will be inconsistent. The carrier image size proposed in the algorithm described in this paper is , and the carrier image size in [21] and [31] is . The compression ratio of [21] is fixed at 0.25, that of [31] is fixed at 1.0, and that of the algorithm proposed in this paper is 0.5. To ensure the validity of the experimental data, the encryption and decryption time of each image is averaged over multiple experiments. The encryption and decryption time for different plain images is shown in Table 2. Table 3 gives the results of normalized correlation test.

According to the data shown in Tables 2 and 3, the compression ratio of the proposed algorithm is twice as large as that of [21], so the decryption time is a little longer, but the encryption time is relatively shorter. NC value of the decrypted image is also larger than [21]. The reason is that [21] uses SHA-256 algorithm to generate the key which increases the transmission burden. Compared with [31], the compression ratio of the proposed algorithm is half that of [31], although the encryption time is relatively longer, but the decryption time is greatly shortened. However, NC values in Table 3 are little lower, but it is also acceptable. Table 4 displays the better performance of block method than nonblock.

7. Conclusions

In conclusion, this paper invokes the idea of block compressed sensing, divides the plain image into blocks, and makes compressive sensing observations. To reduce the block effect caused by this division, zigzag confusion is used to scramble the pixel positions in each block, after each part is rendered sparse. Considering the security of the algorithm and the convenience of subsequent embedding operations, the processed images are merged, then quantized, and scrambled again to obtain the secret image. They are then combined via the 2-level DWT and DCT, and the secret image is embedded into the carrier image. The experimental results prove the efficiency and security of the proposed algorithm. In addition, the size of the measurement matrix is smaller because of the image block operation. Under the same compression ratio, the proposed algorithm needs less storage space and lower computational complexity and achieves faster image reconstruction speeds and better reconstruction effects than the existing ones. Therefore, it has bright prospects in practical applications.

There are three contributions of our method, i.e., (1) generating Hadamard matrix and confusing it with chaotic sequence to form a measurement matrix, (2) using scrambling operation zigzag to sparse the plain image in order to enhance a good recovery effect, and (3) encrypting the quantized image after compressive sensing to achieve a secret image before embedding process.

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 no conflicts of interest.

Acknowledgments

This work was supported in part by the National Natural Science Foundations of China (nos. 61972103 and 61702116), the Natural Science Foundation of Guangdong Province of China (no. 2019A1515011361), 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 Project of Enhancing School with Innovation of Guangdong Ocean University of China (Q18306).