An image visual security encryption method based on compressed sensing and least significant bit
By employing a visual security encryption method based on compressed sensing and least significant bits, a pseudo-random sequence is generated using a one-dimensional highly random chaotic system. Combined with compression encryption and embedding schemes, the problem of insecurity in intermediate state ciphertext is solved, achieving image encryption with high security and visual quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HARBIN INST OF TECH AT WEIHAI
- Filing Date
- 2021-12-23
- Publication Date
- 2026-06-19
AI Technical Summary
Existing image compression and light encryption methods are not secure enough in intermediate-state ciphertext, which is easily cracked by attackers using the least significant bit method, resulting in reduced security.
An image visual security encryption method based on compressed sensing and least significant bit is adopted. A pseudo-random sequence is generated by a one-dimensional highly random chaotic system. Combining compression encryption and embedding scheme, a measurement matrix is generated and a diffusion XOR operation is performed through a chaotic system pseudo-random sequence generator and a compression encryption embedding module, and then embedded into the carrier image.
It improves the security and visual quality of intermediate-state ciphertext, enhances the overall security of the image, effectively resists attacks, and maintains visual security.
Smart Images

Figure CN114331795B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information security technology, specifically relating to an image visual security encryption method based on compressed sensing and least significant bits. Background Technology
[0002] With the rapid development of information technology in the Internet age, people are increasingly using images to acquire and convey information. To prevent information leakage during communication transmission, visual security operations such as image encryption and embedding are crucial. When a large number of images need to be encrypted, embedded, and transmitted, pre-compression of the images becomes a necessary operation.
[0003] Compressed sensing is widely used in image signal processing because it can achieve the Anyquist sampling rate without losing important information. Compressed sensing can rapidly compress images and recover the main information of an image to the greatest extent possible. However, compressed sensing alone is not secure enough against statistical attacks, so other encryption techniques are often used before and after compression. [1-4] Besides one-dimensional compressed sensing, some researchers have achieved better compression results by using two-dimensional compressed sensing and incorporating new compression schemes, thus avoiding widespread loss of image information. [5] Chaotic systems are highly stochastic, nonlinear dynamic systems. Therefore, many researchers have begun to apply chaotic systems to compressed sensing and encryption processes, typically in encryption operations and the construction of measurement matrices, which are used in the compressed sensing process. To make encrypted images more secure and resistant to stronger attacks, more and more researchers are using more complex encryption algorithms. [6-7] Lu [8] A method for encrypting image information based on compressed sensing and dual random phase coding was proposed. This method employs dual random phase coding, based on irrational number sequences and using a small random phase mask, to re-encrypt measurements with low data volume. This encryption scheme features low encrypted data volume and high information security. However, in some scenarios, simply compressing and encrypting the image to obtain a ciphertext image is insufficient. Therefore, some researchers have explored embedding the compressed image into a carrier image to achieve visual security. [9-10] .
[0004] This invention studies the optimization of compressed sensing and measurement matrices, which improves the visual quality of image reconstruction after compression. At the same time, it uses a highly complex encryption algorithm to ensure the security of the intermediate ciphertext of the image. After embedding, the image is visually indistinguishable from the carrier image, thus ensuring the visual security of the image. Summary of the Invention
[0005] The purpose of this invention is to address the issue that currently, a large number of images are compressed, lightly encrypted, and embedded in carrier images. The intermediate-state ciphertext within these images is not secure enough. When an attacker uses the least significant bit method to extract the ciphertext image from the carrier image, the intermediate-state image is easily cracked due to its insecurity, resulting in a significant reduction in security. This invention specifically claims protection for an image compression and encryption method based on compressed sensing and nonlinear diffusion, including its overall algorithm and specific implementation methods.
[0006] The technical solution adopted by this invention to solve the above-mentioned technical problems is: an image visual security encryption method based on compressed sensing and least significant bits. This solution mainly includes two modules: a chaotic system pseudo-random sequence generator and a compressed encryption embedding module.
[0007] 1. Chaotic systems and pseudo-random generators
[0008] One-dimensional logistic chaotic systems and one-dimensional sine mappings are two classic one-dimensional chaotic systems. Based on these two classic chaotic systems, a new highly stochastic one-dimensional chaotic system is designed, and its equations are expressed as follows:
[0009] (1)
[0010] in, As a control parameter, when the control parameter is greater than 200, its Lyapunov exponent reaches 24. The Lyapunov exponent represents the orbital separation velocity, indicating that the equation has strong randomness. A plaintext image is subjected to a SHA-512 operation to obtain a hexadecimal number. This hexadecimal number is then converted to decimal and rounded down to its decimal value as the initial value of the system. The system is iterated 4*M*N times, where M and N are the length and width of the plaintext image. The first M*N values are discarded, and the last 3*M*N values are divided into three equal parts to obtain a random sequence. This is used for the steps of encrypting and generating the measurement matrix.
[0011] 2. Compression, Encryption, and Embedding Scheme Design
[0012] To ensure both visual security and the security of the intermediate ciphertext, this invention employs compressed sensing and embedding, along with a complex encryption algorithm. First, let's understand the principles of compressed sensing and the construction and optimization of the measurement matrix:
[0013] 2.1 Compressed Sensing Principle
[0014] Compressed sensing is a new sampling theory that allows the Nyquist sampling rate to be achieved without losing important information [8]. When a signal is sparse or sparsely represented, it can still be reconstructed without distortion even if the signal is much lower than the Nyquist sampling rate. The compressed sensing process is as follows:
[0015] (2)
[0016] Where the sparse basis is the measurement matrix of size and is the sensing matrix. During the reconstruction stage, equation (2) needs to be solved. Since the unknown N is greater than the measurement equation M, the signal X cannot be obtained by general methods. We solve it by adding constraints. For a signal in the domain, we find the vector with the smallest coefficient in the domain, i.e., the one with the smallest norm, as shown below:
[0017] (3)
[0018] This is an NP-hard non-convex optimization problem. Generally, relaxation techniques are used to approximate convex problems. Methods for solving convex problems (i.e., commonly used methods for signal recovery) include: basis pursuit method (…). Orthogonal matching pursuit method ( ) and smooth norm ( This method will employ orthogonal matching pursuit (or similar methods). To reconstruct the signal.
[0019] 2.2 Construction and Optimization of Measurement Matrix
[0020] The generated pseudo-random sequence The method for generating the measurement matrix is as follows:
[0021] (4)
[0022] Since the measurement matrix in the algorithm is randomly generated, a good measurement matrix... and Between The mean is the smallest, which is called minimum coherence. The purpose of optimizing the measurement matrix is to reduce the minimum coherence between matrices.
[0023] The specific algorithm is as follows:
[0024]
[0025] in, and As shown below, For control parameters:
[0026] (5)
[0027] (5)
[0028] 2.3 Compression Encryption and Embedding Scheme
[0029] First, a multidimensional discrete wavelet transform is performed on the plaintext image. The transformed wavelet coefficients are then sparsified by setting a threshold, with all values below the threshold set to zero. Next, a three-layer indexing network is used to scramble the wavelet sparse coefficients, resulting in a preliminary encryption matrix. This matrix is then subjected to compressed sensing measurements using a pre-generated and optimized measurement matrix. These measurements are then XORed with the plaintext to obtain a relatively secure intermediate-state compressed encrypted image. Next, a carrier image is read, and its spatial pixel values are converted to binary. The intermediate-state compressed encrypted image is also converted to binary. The least significant bit of each bit plane in the carrier image is converted to the binary value of the intermediate-state compressed encrypted image until all bits are embedded. Finally, the carrier image is converted to decimal to obtain the visually secure image.
[0030] 3. Compression performance and safety analysis
[0031] This section uses experimental simulation tests to generate experimental results and data, thereby visually demonstrating the security of the algorithm.
[0032] 3.1 Keystream Testing
[0033] We typically analyze a large number of pseudo-random sequences generated by chaotic sequences to determine their randomness, thereby evaluating the performance of the chaotic equation. The NIST SP800 test, as commonly used by the US National Security and Technology Council, is generally employed. This test involves 100 sets of 1,000,000-bit pseudo-random sequence keystreams. A pass rate as close to 1 as possible is desirable, and the p-value must be greater than a threshold of 0.01; otherwise, the test is considered a failure. The results are shown in the table below:
[0034] Table 1 NIST SP800 Test Results
[0035]
[0036] The results in Table 1 show that the pseudo-random key stream generated by the one-dimensional highly random chaotic equation proposed in this invention has good randomness and can provide good randomness and security.
[0037] 3.2 Key Space Analysis
[0038] Since this method uses hashing to generate initial values, it generates 512-bit binary numbers from plaintext images. According to the IEEE 754-2008 standard, it uses double-precision (binary64) data type for storage, with eight bytes representing one double-precision number. Therefore, the key space for this method is... We generally consider the key space to be larger than... It is safe and can resist brute-force attacks.
[0039] 3.3 Performance Analysis of Compression and Reconstruction
[0040] The visual quality of the reconstructed image after compression is also an important indicator of an algorithm's performance. We typically use Peak Signal-to-Noise Ratio (PSNR) to calculate the difference between corresponding pixels in the original and reconstructed images to measure the quality of the reconstructed image. Generally, a PSNR above 25 indicates that the image is visually indistinguishable from the original, and the higher the value, the closer the reconstructed image is to the original. The formula for calculating PSNR is as follows:
[0041] (7)
[0042] (8)
[0043] To verify the compression and reconstruction performance of this invention, we selected standard images from the USC-SIPI database for testing, and the results are shown below:
[0044] Table 2 PSNR (dB) of the reconstructed images after compression and encryption
[0045]
[0046] The results in Table 2 show that the reconstructed images still have high visual quality at lower compression ratios, while at higher compression ratios, their visual quality is almost indistinguishable from that of the plaintext images.
[0047] 3.4 Measurement Matrix Optimization Analysis
[0048] Regarding the construction of the measurement matrix, since the measurement matrix in this method is generated from a random sequence, a good measurement matrix... and Between The mean is the smallest, which is called minimum coherence. The purpose of optimizing the measurement matrix is to reduce the minimum coherence between matrices.
[0049] The possible measure of minimum coherence is expressed as:
[0050] (9)
[0051] The measurement matrix is optimized using the equiangular tight frame (ETF) theory. Since the ETF matrix has been shown to have minimal correlation, the Gram matrix generated by the cyclic shrinking sensing matrix is optimized by approximating the ETF. The Gram matrix is shown below:
[0052] (10)
[0053] Under the condition that other factors remain unchanged, this method was tested and its performance was compared between the measurement matrix generated by the one-dimensional logistic chaotic equation (without optimization algorithm) and the measurement matrix generated by the one-dimensional highly random chaotic equation proposed in this method (with optimization algorithm) after compression and reconstruction. The results are as follows:
[0054] Table 3 Test results of compression and reconstruction performance with measurement matrix optimization
[0055]
[0056] The results in Table 3 show that the one-dimensional highly random chaotic equation and measurement matrix optimization algorithm proposed in this invention can significantly improve the compression and reconstruction performance of images, and can effectively improve the visual quality after compression and reconstruction.
[0057] 3.5 Embedded Performance Analysis
[0058] After the intermediate-state encrypted image is embedded into the carrier image, the difference between the visual security image and the carrier image is also an important metric that needs to be measured. Peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM) are commonly used for testing. Structural similarity index is more in line with human visual perception of image quality; its value ranges from 0 to 1, with a value closer to 1 being better. The calculation formula is as follows:
[0059] (11)
[0060] To verify the embedding performance of this invention, we selected standard images from the USC-SIPI database for testing, and the results are shown below:
[0061] Table 4 Embedded Performance Analysis
[0062]
[0063] The results in Table 4 show that the embedding performance of the present invention is good, the peak signal-to-noise ratio of the embedded image is large, and the similarity of the results is very close to 1.
[0064] 3.6 Correlation Analysis of Adjacent Pixels in Intermediate-State Ciphertext Image
[0065] Adjacent pixel correlation reflects the degree of correlation between pixel values at adjacent positions in an image. A good image encryption algorithm can reduce the correlation between adjacent pixels, aiming for near-zero correlation. Generally, it involves analyzing three aspects: horizontal, vertical, and diagonal pixels. The correlation coefficient is defined as follows:
[0066] (12)
[0067] Table 5 Correlation Analysis of Adjacent Pixels
[0068] The results in Table 5 show that this method can minimize the correlation between adjacent pixels in plaintext images and has good security.
[0069] 3.7 Information Entropy Analysis
[0070] The information entropy of an image reflects its randomness. For ciphertext of length T, the formula for calculating its information entropy is as follows:
[0071] (13)
[0072] The ideal value for information entropy is 8. The closer the encrypted image is to 8, the better its randomness. We tested the information entropy of encrypted images from Lena, Female, Tree, House, and Cameraman (256*256) at a compression ratio of 0.5. The results are shown below:
[0073] Table 6 Information Entropy Analysis Results
[0074]
[0075] The results shown in Table 6 demonstrate that the encryption method of the present invention has excellent randomness. Attached Figure Description
[0076] Figure 1 This is a flowchart of the algorithm of the present invention;
[0077] Figure 2 This is a schematic diagram of the three-layer index network method of the present invention;
[0078] Figure 3 These are the intermediate-state ciphertext image and the embedded visual security image compressed and encrypted by this invention; wherein (a) is the plaintext image, (b) is the intermediate-state ciphertext image, (c) is the carrier image, (d) is the embedded visual security image, (e) is the histogram of the intermediate-state ciphertext image, and (f) is the reconstructed plaintext image.
[0079] Figure 4 The present invention embeds visual security images and their histograms into different carrier images; wherein (a) is a plaintext image, (b)-(e) are carrier images, (f)-(i) are histograms of carrier images, (j)-(m) are embedded visual security images, and (n)-(q) are histograms of visual security images. Detailed Implementation
[0080] The present invention will be further described below with reference to embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0081] The image compression and encryption method proposed in this invention mainly includes the following steps:
[0082] First, select an image of size [size missing]. Image The hash operation is performed to obtain a 512-bit binary number, which is then converted to decimal and fractionalized to obtain the initial key for the equation. ;
[0083] The second step is to use the initial key. Input into a one-dimensional highly random chaotic equation, iterate Next, to ensure good randomness of the pseudo-random sequence, the first... Number, after A pseudo-random sequence of length is divided into three equal parts. Then generate three key streams. The specific generation method is as follows:
[0084] (14)
[0085] (15)
[0086] (16)
[0087] The third step is to extract the image. By using multidimensional discrete wavelet transform, wavelet coefficients are obtained. Then, a threshold T = 0.050 is set, and wavelet coefficients smaller than the threshold T are set to zero to further sparsify the coefficients, resulting in a sparse matrix. ;
[0088] The fourth step is to scramble the sparse matrix D using a three-layer index network. The specific steps are: sorting from largest to smallest. Get a three-level index , , , sparse matrix First, follow the index Perform a shuffle, then use the index. Perform a second scramble, and finally use the index. The scrambling is performed three times, resulting in a sparse matrix. It has been completely disrupted;
[0089] Fifth step, using pseudo-random sequences Generate a measurement matrix, set the compression ratio to CR, and optimize it using a measurement matrix optimization algorithm to obtain a matrix of size [value missing]. Measurement matrix Then for the sparse matrix The calculation formula for compressed sensing measurements is as follows:
[0090] (17)
[0091] Thus, the size is obtained The scrambled matrix ;
[0092] Step 6: The scrambled matrix Convert the array to a one-dimensional array in preparation for the diffusion operation. The specific operation is as follows:
[0093] (18)
[0094] (19)
[0095] (20)
[0096] (twenty one)
[0097] in, E represents the intermediate ciphertext image.
[0098] Step 7: Select a carrier image of size and embed the intermediate ciphertext image into the carrier image using the least significant bit method. Specifically, first decompose the grayscale value of the carrier image into a binary string, then expand the intermediate ciphertext image to the size of the carrier image, then replace the least significant bit value of the carrier image with the value of the intermediate ciphertext image, and finally restore the grayscale value of the carrier image to obtain the visual security image.
[0099] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
[0100] References
[0101] [1] G. R. Chen, T. Ueta. Yet Another Chaotic Attractor[J].International Journal of Bifurcation and Chaos, 1999, 9(7): 1465-1466.
[0102] [2] D.L. DONOHO, Compressive sensing[J]. IEEE Trans. Inform. Theory52 (4) (2006)1289–1306.
[0103] [3] E.J. CANDÈS, T. TAO, Near optimal signal recovery from randomprojections: universal encoding strategies[J]. IEEE Trans. Inform. Theory 52(2006)5406–5425.
[0104] [4] E.J. CANDÈS, Compressive sampling[J]. Proceedings of theInternational Congress of Mathematicians, vol. 3, Madrid, Spain, 2006, pp.1433–1452.
[0105] [5] ZHANG B , XIAO D , XIANG Y . Robust Coding of Encrypted Imagesvia 2D Compressed Sensing[J]. IEEE Transactions on Multimedia, 2020, PP(99):1-1.
[0106] [6] Chai Xiuli, Chen Yiran, Broyde Lucie. A novel chaos-based imageencryption algorithm using DNA sequence operations[J]. Opt Lasers Eng, 2017,88:197-213.
[0107] [7]Feifei Yang, Jun Mou, Jian Liu, Chenguang Ma, Huizhen Yan,Characteristic analysis of the fractional-order hyperchaotic complex systemand its image encryption application[J]. Signal Processing,Volume 169,2020.
[0108] [8] Pei Lu, Zhiyong Xu, Xi Lu, Xiaoyong Liu,Digital image informationencryption based on Compressive Sensing and double random-phase encodingtechnique[J]. Optik,Volume 124, Issue 16, 2013, 2514-2518.
[0109] [9] Xiuli Chai, Haiyang Wu, Zhihua Gan, Yushu Zhang, Yiran Chen, Kentw. Nixon. An efficient visually meaningful image compression and encryptionscheme based on compressive sensing and dynamic LSB embedding[J]. Optics andLasers in Engineering, Volume 124, 2020, 105837.
[0110]
[10] Xiuli Chai, Zhihua Gan, Yiran Chen, Yushu Zhang,A visuallysecure image encryption scheme based on compressive sensing[J]. SignalProcessing,Volume 134,2017,Pages 35-51.
Claims
1. A method for image visual security encryption based on compressed sensing and least significant bits, which is implemented in the following seven steps: First, select an image of size [size missing]. Image The hash operation is performed to obtain a 512-bit binary number, which is then converted to decimal and fractionalized to obtain the initial key for the equation. ; The second step is to use the initial key. Input into a one-dimensional highly random chaotic equation, iterate Next, to ensure good randomness of the pseudo-random sequence, the first... Number, after A pseudo-random sequence of length is divided into three equal parts. Then generate three key streams. The specific generation method is as follows: (1) (2) (3) The third step is to extract the image. By using multidimensional discrete wavelet transform, wavelet coefficients are obtained. Then, a threshold T = 0.050 is set, and wavelet coefficients smaller than the threshold T are set to zero to further sparsify the coefficients, resulting in a sparse matrix. ; The fourth step is to scramble the sparse matrix D using a three-layer index network. The specific steps are: sorting from largest to smallest. Get a three-level index , , , sparse matrix First, follow the index Perform a shuffle, then use the index. Perform a second scramble, and finally use the index. The coefficient matrix is scrambled three times. It has been completely disrupted; Fifth step, using pseudo-random sequences Generate a measurement matrix, set the compression ratio to CR, and optimize it using a measurement matrix optimization algorithm to obtain a matrix of size [value missing]. Measurement matrix Then for the sparse matrix The calculation formula for compressed sensing measurements is as follows: (4) Thus, the size is obtained The scrambled matrix ; Step 6: The scrambled matrix Convert the array to a one-dimensional array in preparation for the diffusion operation. The specific operation is as follows: (5) (6) (7) (8) in, , This is an intermediate-state ciphertext image; Step 7, select a size of The carrier image is used to embed the intermediate ciphertext image into the carrier image using the least significant bit method. Specifically, the grayscale values of the carrier image are first decomposed into binary strings, then the intermediate ciphertext image is expanded to the size of the carrier image, then the least significant bit value of the carrier image is replaced with the value of the intermediate ciphertext image, and finally the grayscale values of the carrier image are restored to obtain the visual security image.