An Image Encryption Algorithm Based on Compressive Sensing and M Sequence

In this article, a new image encryption algorithm based on compressive sensing (CS) and M sequence is proposed to decrease the image communication load and improve the security of image communication in the internet of things. Most of the available image encryption schemes are based on chaotic systems to shuffle the image pixels. Before shuffling the image pixels, the random sequence, which is produced by a chaotic system, need to be sorted. This sorting operation is avoided by utilizing a modified linear feedback shift register (LFSR) state sequence. Then, the security of the proposed scheme is improved by combining CS with an improved 1D chaotic system, which is used to construct a measurement matrix. The computational complexity is reduced by the use of the improved 1D chaotic system. Simultaneously, the amount of image data is reduced. Simulation results and performance analyses demonstrate that the proposed encryption scheme can greatly reduce the amount of image data and has good security and robustness.


I. INTRODUCTION
Image encryption is a critical issue for confidentiality and security. Chaotic maps have been widely used in image encryption owing to the characteristics of high sensitivity to initial conditions and control parameters in [1]- [4]. In the recent years, some other technologies have been combined with chaotic systems to encrypt images. For example, the sensitivity mechanism is built up by utilizing the information entropy of the plain-image in [5]. A novel image encryption algorithm is introduced based on the two-dimensional logistic map and the Latin square image cipher in [6]. An image encryption scheme combining chaos-memory cellular automata and weighted histogram is proposed in [7]. DNA computing in [8]- [11] is applied to chaos based image encryption system due to its several good characteristics, such as massive parallelism, huge storage and ultralow power consumption, etc. With the development of the internet of things, the amount of image data is constantly increasing and the images needs to be compressed. Hence, compressive sensing becomes a hotspot.
The associate editor coordinating the review of this manuscript and approving it for publication was Lefei Zhang . Compressive sensing (CS) is a novel sampling paradigm. The concept of CS was formally proposed by Candes and Donho In 2006 in [12], [13]. The theory of CS Mainly includes three aspects: sparse representation, measurement matrix and signal reconstruction. Measurement matrix needs to satisfy Restricted isometry property (RIP) in [14] or the robust null space property (RNSP) in [15], [16].As for measurement matrix it can be Gaussian, Bernoulli and Fourier in [17], or binary measurement matrix in [15]. As for reconstruction algorithms, by using l 1 norm minimization the original signal can be exactly recovered by solving a simple convex optimization problem through linear programming in [18], [19]. Some reconstruction techniques are based on l 0 norm minimization such as Matching Pursuit (MP) in [20], Orthogonal Matching Pursuit (OMP) in [21] and SL0 algorithm in [22]. A sparse recovery algorithm by utilizing the probability-based prior information is proposed in [23] for compressed sensing system.
Recently, it is necessary to compress and encrypt plain images simultaneously and many novel encryption schemes based on CS and chaotic systems have been proposed [24]- [34]. A novel digital image information encryption method based on CS and Arnold transformation is proposed in [25]. To further enhance the performance, the double random phase encoding (DRPE) optical encryption technique is utilized. An efficient image compressionencryption scheme based on Chen's hyper-chaotic system and 2D compressive sensing is proposed in [26], in which the hyper-chaotic system is used to generate two measurement matrices. A novel encrypted compressive sensing of images based on fractional order hyper chaotic Chen system and DNA operation is proposed in [27] in which 4-Dimensioanal Fractional order hyper chaotic chen system is used to generate the measurement matrix. A game-of-life-based scrambling method (PDGSM) in [28] is introduced to shuffle the sparse coefficient matrix of the plain image, in which the respective permutation matrix is constructed by the rules of game of life. In this encryption scheme, chaotic sequences are generated from a 5D memristive hyper chaotic system.
However, in most of the above algorithms combining compressive sensing and chaotic maps the measurement matrices are generated by adopting multi-dimensional chaotic maps. Owing to the complex structure and multiple parameters of the multi-dimensional chaotic maps, the difficulty of implementation and the computation complexity increase. On the contrary, 1D chaotic maps in [35]- [40] have the advantages that their structures are simple and they are easy to implement. In this article, an improved 1D chaotic map in [41] is used to construct the measurement matrix for compressed sensing.
Linear feedback shift register (LFSR) have been widely used in modern communication systems, coding theory and cryptography. The mathematical theory of M sequences is firstly described in [42]. A pseudo random n-order M sequence is the longest linear feedback of a shift register sequence of 2 n −1 length in which consecutive n-length strings exactly experience all binary n-length strings in [43]. To improve the linear complexity of LFSR sequences, nonlinear feedback shift register sequences (NLFSR) are presented such as [44], [45]. However, NLFSR sequences don't experience all binary n-length strings only once.
M-sequences have attracted much attention due to their good randomness properties [46]- [49]. Based on the knowledge of finite fields, many research results about M-sequences have been obtained in [47], [48]. As for constructing M-sequences, some combinatorial algorithms are presented in [52]- [54]. Recently, the new construction method by the semi-prefer-XOR rule is proposed in [55]. In general, M sequence can be used in MIMO radar systems in [56], magneto-acoustic imaging in [57] and stream cipher in [58].
According to the above analyses, a novel image compression and encryption algorithm is introduced based on compressed sensing, M sequence and the improved 1D system. M sequence is one of stream cipher, which is usually used to change image pixel value by XOR operation. In this article, the LFSR state sequence is modified into an appropriate sequence which experiences all binary n-length numbers only once. When the plain image is shuffled, the sorting process can be avoided by the use of the modified LFSR state sequence. Meanwhile, the better permutation effect is attained. Then, CS is utilized to reduce the data amount of the plain image through the measurement matrix, which is produced by the improved 1D chaotic system. Furthermore, the security of the proposed encryption scheme is improved by regarding the control parameters of the improved 1D chaotic system as secret keys. For the meantime, the computational complexity is reduced by the use of the improved 1D chaotic system. Furthermore, the SHA-512 hash function value of the plain image is used to produce the control parameters of the improved 1D map and linear feedback shift register (LFSR) to increase the correlation of the proposed encryption scheme and the plain image.
This article is organized as follows. In Section II a brief introduction about compressive sensing is firstly given. Then, M sequence and the improved chaotic map are elaborated. The proposed image encryption scheme is explained in Section III. In Section IV, the experimental results and the performance of the proposed scheme are discussed. Finally, the conclusion is drawn in Section V.

A. M SEQUENCE
The logic expression is of n-order LFSR as the following a n = C 1 a n−1 ⊕ C 2 a n−2 ⊕ C 3 a n−3 ⊕ · · · ⊕ a 0 (1) where ⊕ represents module-2 sum. The flow is shown in Fig.1. Each register state will change as the clock triggers. Move a n from the left to the right of Equation 1 and the following equation is obtained Define a polynomial of F (x) corresponding to Equation (3) as below which is called characteristic polynomial. If the characteristic polynomial is a primitive one, the pseudo random sequence generated by the LFSR will have a 2 n − 1 length period and it will be called M sequence. VOLUME 8, 2020 The polynomial F (x) of degree n is a primitive polynomial if can be treated as a secret key. The LFSR state sequence can be noted as S = (a n−1 a n−2 a n−3 · · · a 0 ) where the period length of S is 2 n − 1. S can also be treated as a secret key. Convert S into a decimal number of DS by Equation (4). DS = a n−1 × 2 n−1 + a n−2 × 2 n−2 + a n−3 × 2 n−3 + · · · + a 0 (4) DS will experience all the integers from 1 to 2 n −1 and each value will be experienced only once. The number of n-order For example, F (x) = x 4 + x + 1 is a 4-order primitive polynomial. We can get the corresponding linear feedback expression as Equation (5) The state transition table is shown in Table 1. As can be seen from Table 1, DS will experience all the integers from 1 to 15 and each value will be experienced only once in each cycle.

B. COMPRESSIVE SENSING
If a signal of s in R N can be sparsely represented by an orthogonal basis in CS theory [12], which means its most weighting coefficients are zeros or close to zero, s can be expressed as Equation 6 where is the orthogonal basis matrix and ξ is the weighting coefficient vector in R N . The measurement result y can be obtained by a measurement matrix with size M × N as the following formula where N < M and = . is called sensor matrix. If the measurement matrix satisfies the Restricted Isometry Property (RIP), the signal s can be recovered by solving the non-convex problem as the following . This problem can be solved by the algorithms such as Matching Pursuit (MP) in [20], Orthogonal Matching Pursuit (OMP) in [21] and SL0 algorithm in [22].

C. IMPROVED 1D CHAOTIC MAP
1D chaotic maps have simple structures, so that they are widely used in image encryption such as Logistic, Sine and Chevyshev maps. To improve the chaotic performance of 1D chaotic maps the new chaotic map is introduced in [36] which is defined by the following equation where F chaos (u, x n ) is one of 1D chaotic maps as Logistic map, Sine map and Chebyshev map. x n is the output chaotic sequence, which is acquired by iterating the new chaotic system M×3N+N 0 times and discarding the former N 0 elements. u ∈ (0 , 10] and k ∈ [8,20] are the control parameters. x 0 is the initial value. The parameters of x 0 , u and k are utilized as the security keys. • Logistic-Logistic system (LLS) The logistic map, which is a simple dynamic nonlinear equation with complex chaotic behavior, is one of the famous 1D chaotic system. It can be expressed in the following equation where u is a control parameter with range of u ∈ (0 , 4] x 0 is the initial value of chaotic map, and x n is the output chaotic sequence. LLS is defined as • Sine-Sine system (SSS) The Sine map is one of 1D chaotic maps and has a similar chaotic behavior with the Logistic map. The definition can be described by the following equation.
where parameter r ∈ (0 , 1] and x n is the output chaotic sequence. SSS is defined as the following equation • Chebyshev-Chebyshev system (CCS) The Chebyshev map is also one of 1D chaotic systems and can be described by the following equation.
where parameter a ∈ N . CCS is defined as The dynamical analysis in [39] has shown that the improved 1D chaotic systems have excellent chaotic behaviors. For example, the bifurcation diagram and Lyapunov exponent of LLS are shown in Fig.2 and Fig.3, which indicate that The chaotic range of LLS is (0, 10) and is much larger than Logistic System.

III. PROPOSED IMAGE ENCRYPTION SCHEME A. GENERATION OF THE INITIAL CONDITION OF THE IMPROVED 1D CHAOTIC MAP
SHA-512 hash function is used to generate the control parameters of the 1D improved map for establishing the relationship between the encryption scheme and the plain image. A sequence of hexadecimal value that consists of 512 bits is generated by the SHA-512 hash function. The 512-bit hash value of the plain image is divided into 8-bit blocks which can be converted to 64 decimal numbers: h 1 , h 2 , · · · , h 64 . The corresponding initial values are computed via t 1 , t 2 and t 3 are the external keys.

B. GENERATION OF THE INITIAL CONDITION OF LFSR
If LFSR is n-order, there should be the condition of 2 n − 1 ≥ M × N where M × N is the pixel number of the plain image. The initial state can be acquired by selecting n bit binary values from 512 bit hash values.

C. PROCESS OF ENCRYPTION ALGORITHM
As shown in Fig. 4, the steps for the encryption algorithm can be descripted as follows.
Step 1: The SHA-512 hash function of the plain image is generated and the secret keys are obtained according to Part A and Part B of section III Step 2: The sparse coefficients matrix α is obtained by transform the plain image I into discrete wavelet transform (DWT) domain of .
Step 4: The n-order LFSR state sequence DS is obtained by selecting a primitive polynomial of F (x) according to the initial value. The permutation position sequence T is obtained by Algorithm 1.
Step 6: Reshape P' into Matrix U with size M × N . The measurement matrix of size M × N is constructed by the improved chaotic sequence X according to [39] with the initial condition of (x 0 , u, k). The measurement result Y is acquired by   Step 7: Q is obtained by quantifying the elements of matrix Y into the range from 0 to 255 with the sigmoid function in [60].
Step 8: The diffusion matrix W is obtained by the following equation Step 9: Reshape matrix Q into a sequence of Q' and obtain the diffused sequence C by the following equations.
Step 10 Reshape sequence C into matrix C' with the same size of Y and C' is the final encrypted image.

D. PROCESS OF THE DECRYPTION ALGORITHM
The decryption procedure is the reverse of encryption process. The flowchart of the decryption is shown in Fig.5. The detailed process is as follows.
Step 1: Produce the chaotic sequence X according to [36] with the secret keys and obtain W according to X . Matrix Q is obtained by executing the inverse diffusion process.
Step 2: Y is obtained by executing the inverse quantization according to the inverse sigmoid function.
Step 3: Construct the measurement matrix and reconstruct the matrix U from Y by SL0 algorithm.
Step 4: Obtain the LFSR state sequence DS and acquire the permutation sequence T according to Algorithm 1.
Step 5: Obtain the sparse coefficient matrix α and acquire the original plain image by inverse discrete wavelet transform (IDWT).

IV. SIMULATIONS AND SECURITY ANALYSIS
Simulation results and security analyses of the proposed encryption scheme are given out in this section. Eight grayscale images, including 'Lena', 'Pepper', 'Baboon', 'Boat', 'man', 'Lake', 'Run' and 'Sat', which are shown in Fig. 6,   volume ratio between compressed image and plain image which is computed according to the following equation where h I and w I denote the height and width of the original image and h c and w c are that of the cipher image. According to Figs. 7-11, it is evident that the cipher images are unrecognizable and the image data amount is reduced according to CR. Compared to the original images, the decrypted images have preserved the main information of the original images and they become more similar when CR is increasing.

B. PSNR AND SSIM ANALYSIS
The quality of the reconstructed image is evaluated by the Peak Signal to Noise Ratio (PSNR) which is calculated by VOLUME 8, 2020 where X (i, j) is the plain image and X (i, j) is the reconstructed image. The image of 'Lena' is used to verify our proposed encryption scheme. The PSNR values are listed in Table 2 with the different CR values. As can be seen from Table 2, the quality of the reconstructed image of the proposed scheme is better than the encryption schemes in [29], [30], [34], [35]. The Structural similarity (SSIM) is used to evaluate the similarity of two images which is defined by where µ X and µ X represent the average values of the plain image X and the reconstructed image X '. σ X and σ X are the corresponding standard deviations. σ XX is the crosscovariance of X and X '. C 1 and C 2 are constants. The similarity between X and X ' is higher when the SSIM value is higher. The images of 'Baboon', 'Boat', 'Lake', 'man', 'Peppers', 'Run' and 'Sat' are utilized to verify our proposed scheme.

C. HISTOGRAM ANALYSIS
Histogram graphically represents the distribution of the pixel values of an image. It is needed that the histogram of the encrypted image has a uniform distribution. Fig. 12 shows that the histograms of the plain images and the histograms  of their corresponding encrypted images are uniform. Hence, the proposed scheme is robust against statistical attacks.

D. PIXEL CORRELATION ANALYSIS
It is well-known that there are high correlations between the adjacent pixels, and a secure encryption algorithm should reduce the correlation to improve the ability of resistance to statistical attacks. The correlation coefficient is defined according to the following equation where x and y are gray values of the adjacent pixels in the images and M is the total number randomly chosen from the test image.
The correlation diagram among adjacent pixels at horizontal, vertical and diagonal directions of the plain image of 'Lena' and the corresponding cipher image with CR equal to 0.5 are shown as in Fig.13. The size of cipher images are 128 × 256. Table 4 shows the correlation coefficients of horizontally, vertically and diagonally of the plain images of 'Baboon', 'Boat', 'Lake', 'man', 'Peppers', 'Run' and 'Sat' and the corresponding cipher image with CR equal to 0.5. According to Table 4 the correlation coefficients of plain image are near 1 and those of the cipher images are almost equal to 0 which means the correlation between the adjacent pixels has been greatly reduced.

E. KEY SPACE ANALYSIS
The key space of an image encryption scheme, which can resist brute-force attacks, should be more than 2 100 in [59]. In this article the secret keys of the proposed encryption algorithm mainly include: x 0 ∈ (0 , 1], u 1 ∈ (0 , 10], k 1 ∈ [8,20] , S and the coefficient of F (x). S is generally larger than 2 16 . If the computational precision of the computer is 10 −14 , the key space is about 10 14 × 10 14 × 10 × 2 16 × λ ≈ λ2 112 .
Hence, the key space of our method is large enough to resist all kinds of brute-force attacks.

F. KEY SENSITIVITY ANALYSIS
A good encryption scheme should be very sensitive to secret keys. The sensitivity can be evaluated by Number of pixel change rate (NPCR) and unified average change intensity (UACI) which are defined by the VOLUME 8, 2020 following formulas. where and c 1 and c 2 are the encrypted images corresponding to two slightly deferent keys.
The image of 'Lena' is used to verify key sensitivity. After slightly changing the value of parameter x 0 from 0.5321 to0.53210000000001 the obtained NPCR and UACI betweenthe cipher images are 99.6570 and 33.3159. After slightly changing the value of parameter x 0 from 0.5321 to 0.53209999999999, the obtained NPCR and UACI between the cipher images are 99.6151 and 33.2703. After slightly changing the value of parameter u 1 from to 5.43740000000001 the obtained NPCR and UACI between the cipher images are 99.5789 and 33.3727. After slightly changing the value of parameter u 1 from 5.43740000000000 to 5.43739999999999 the obtained NPCR and UACI between the cipher images are 99.5903 and 33.3532. The results show that the proposed encryption scheme is highly sensitive to a slight change of the secret keys.

G. INFORMATION ENTROPY ANALYSIS
The information entropy formula is as the following where p(x i ) is the probability of a message of x i and v is the number of the messages of the information source. For an image with 256 gray levels, v is equal to 256. Table 5 presents the information entropies of the plain images and cipher images (CR = 0.75). The last row gives out the average values of the information entropies of the plain images and cipher images. The information entropies of the corresponding cipher images are all more than 7.99 as shown in Table 5.
It is evident that our encryption algorithm has better performance than the schemes in. [24], [34], [35].

H. ROBUSTNESS ANALYSIS
Cipher images are easily influenced by noise and data loss during image transmission. A good image encryption scheme should be able to resist these attacks. The image of 'milkdrop' is used to test the ability of the proposed encryption scheme. At first, the image is encrypted by the proposed scheme and the encrypted image is shown as Fig.14 (a1) Then, Fig.14 (a1) is attacked by 'salt&pepper' noise whose intensity is 0.0001 and the result is shown as Fig.14 (b1). At last Fig.14 (a1) is cropped with data loss size of 64 × 64 VOLUME 8, 2020 the cropped encrypted image is shown as Fig.14 (c1). The corresponding decrypted images are shown as Fig.14 (a2, b2, c2). As can be seen, they contain the main information of the original image when noise and crop attacks occur.

V. CONCLUSION
In this article the modified LFSR state sequence is utilized to shuffle the sparse coefficient matrix of the plain image and good permutation effect has been achieved. Then, the amount of image data is greatly reduced by the use of CS. For the meantime, CS is combined with the improved 1D chaotic system, by which the security of the proposed encryption scheme is improved. The improved 1D chaotic is used to construct the measurement matrix and the initial parameters are used as the secret keys. Simulation results demonstrate the proposed encryption scheme can reduce the amount of image data and improve the security of image communication simultaneously. Performance analyses demonstrate that the proposed encryption scheme has a large key space and high key sensitivity and good robustness to noise and data loss. For the meantime, our scheme can resist statistical attack and differential attack. He is currently an Associate Professor with the College of Computer and Information Engineering, Henan Normal University, China. His research interests include multimedia security, information hiding, and compressive sensing. VOLUME 8, 2020