Image encryption compression method and system based on second-order cellular automaton
Through the image encryption and compression method based on second-order cellular automata, the sparse matrix and pseudo-random sequence chaos technology are used to solve the problem of image size unchanged in traditional image encryption technology, and the effective compression and security improvement of images are achieved.
Patent Information
- Application Number
- CN202210276515.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2042-03-21
AI Technical Summary
Traditional image encryption technology has the same image size as the original image after encryption, resulting in high bandwidth pressure when transmitted on a common channel and difficult to achieve effective image compression.
The image encryption and compression method based on second-order cellular automata is adopted to obtain a sparse matrix through discrete wavelet transformation, combining semi-tenster backlog compression perception and pseudo-random sequence chaos to achieve effective compression and encryption of images. The specific steps include discrete wavelet transformation of the plaintext image, constructing a measurement matrix, quantization and matrix transformation, and using a pseudo-random sequence to complete the encrypted compression of the image.
Effective compression of the image is achieved, and the image size can be the same as or smaller as that of the plain text image after encryption, which enhances the disorder and security of the image and reduces the transmission pressure.
Smart Images

Figure CN114866780B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an image encryption compression method and system based on a second-order cellular automaton, belonging to the technical field of image information security. Background Art
[0002] With the rapid development of the information age, the popularization of intelligent devices and the innovation of traditional network technology have led to an explosive growth of data, and information security issues have become increasingly prominent and have become the focus of people's attention. Information security covers many aspects, and image information security is an important branch. Image encryption technology is an effective way to ensure image information security. Traditional image encryption generates noise or texture images from cipher images, which can ensure image security to a certain extent, but the size of the encrypted image is consistent with the size of the original plaintext image. If the plaintext image is too large, the encrypted ciphertext will increase the pressure on bandwidth and transmission when it is transmitted on a public channel. Therefore, there is a greater research prospect in terms of the encrypted size of the ciphertext image.
[0003] Compressed sensing technology has been widely used in the field of image encryption in recent years. It achieves image compression and encryption while sampling with a number of samples far less than that specified by the Nyquist sampling theorem, greatly reducing the sampling rate and the amount of calculation. Compressed sensing technology provides new methods to improve the real-time transmission and security of traditional encryption mechanisms, and can be used as an important tool for image encryption technology. Cellular automata have the characteristics of simplicity of constituent units, locality of action between units, high parallelism of information processing, and complex global characteristics, which make cellular automata have unique advantages in the field of cryptography. Combining it with compressed sensing, on the basis of cellular automata, an efficient encryption compression mechanism is designed, and applied to image encryption, a novel and efficient image encryption scheme can be designed. Summary of the invention
[0004] In order to solve the above-mentioned technical problems, the present invention provides an image encryption compression method and system based on second-order cellular automata.
[0005] The present invention adopts the following technical solutions to solve the above technical problems:
[0006] An image encryption and compression method based on a second-order cellular automaton, comprising:
[0007] Perform discrete wavelet transform on the plaintext image to obtain a sparse matrix;
[0008] The 256-bit binary key K seed , substitute rule number R1 into the second-order cellular automaton to construct the measurement matrix Ψ;
[0009] Applying half tensor product compressed sensing to sparse matrices to obtain a measurement value matrix;
[0010] Quantizing the measurement value matrix to obtain a quantization matrix;
[0011] By matrix transformation, the quantization matrix is transformed into a one-dimensional matrix;
[0012] The 256-bit binary key K seed , substitute rule number R2 into the second-order cellular automaton to generate a pseudo-random sequence;
[0013] Convert the pseudo-random sequence into a real number sequence, and use the sorted real number sequence to scramble the one-dimensional matrix to obtain a scrambled matrix;
[0014] Through matrix transformation, the scrambled matrix is transformed into a matrix with the same dimension as the quantization matrix to complete the encryption compression of the plaintext image.
[0015] Furthermore, the plaintext image is subjected to discrete wavelet transform to obtain a sparse matrix, which is specifically:
[0016] Perform discrete wavelet transform on the plaintext image to obtain a sparse coefficient matrix P1 of the same size as the original image;
[0017] Set the elements in P1 that are less than the set threshold to 0 to obtain the sparse matrix P2.
[0018] Further, the 256-bit binary key K seed , substitute rule number R1 into the second-order cellular automaton to construct the measurement matrix Ψ, which is:
[0019] First, the second-order cellular automaton iterates according to rule R1 times, the length is A sequence of bits O, where M is the length of the plaintext image and N is the width of the plaintext image;
[0020] Then, take the first M×N bits in O as the random sequence E={e1,e2,...,e M×N}, where e i ∈{0,1},i=1,2,3,...,M×N;
[0021] Then, according to the following formula, a new random sequence W with a length of M×N is obtained:
[0022]
[0023] In the formula, w i is the i-th element in W;
[0024] Finally, the measurement matrix Ψ is constructed by organizing W in columns according to the following formula:
[0025]
[0026] Furthermore, the method also includes adopting a semi-tensor product STP strategy to reduce the dimension of the measurement matrix.
[0027] Furthermore, the semi-tensor product compressed sensing is applied to the sparse matrix to obtain the measurement value matrix, which is specifically:
[0028] For each column of the sparse matrix, the measurement matrix is used for parallel sampling to obtain a measurement value matrix.
[0029] Furthermore, the measurement value matrix is quantized to obtain a quantization matrix, which is specifically:
[0030] Find the highest element value max and the lowest element value min in the measurement value matrix, and quantize each element value in the measurement value matrix to [0,255] according to the following formula to obtain the quantization matrix:
[0031]
[0032] Where Y represents the element value after quantization, and d represents the element value before quantization.
[0033] An image encryption and compression system based on a second-order cellular automaton, comprising:
[0034] A pseudo-random number generation module is used to generate pseudo-random number sequences required by the compression encryption module and the scrambling module;
[0035] A compression encryption module is used to construct a measurement matrix based on a pseudo-random number sequence, obtain a sparse matrix of a plaintext image, apply semi-tensor product compressed sensing to the sparse matrix to obtain a measurement value matrix, and quantize the measurement value matrix;
[0036] The scrambling module is used to scramble the quantization matrix output by the compression encryption module based on a pseudo-random number sequence.
[0037] Furthermore, the workflow of the pseudo-random number generation module is as follows: the 256-bit binary key K seed , substitute rule number R1 / R2 into the second-order cellular automaton to generate the first / second pseudo-random sequence; based on the first pseudo-random sequence, construct the measurement matrix Ψ.
[0038] Furthermore, the working process of the compression encryption module is as follows: performing discrete wavelet transform on the plaintext image to obtain a sparse matrix; applying semi-tensor product compressed sensing to the sparse matrix to obtain a measurement value matrix; and quantizing the measurement value matrix to obtain a quantization matrix.
[0039] Furthermore, the working process of the scrambling module is as follows: transforming the quantization matrix into a one-dimensional matrix through matrix transformation; converting the second pseudo-random sequence into a real number sequence, and using the sorted real number sequence to scramble the one-dimensional matrix to obtain a scrambled matrix; transforming the scrambled matrix into a matrix of the same dimension as the quantization matrix through matrix transformation to obtain the final compressed ciphertext image, thereby completing the encryption compression of the plaintext image.
[0040] Compared with the prior art, the present invention adopts the above technical scheme and has the following technical effects: the present invention uses a second-order cellular automaton pseudo-random sequence to control the implementation of the compression algorithm, and uses the pseudo-random sequence to construct a measurement matrix as the key to compression encryption, thereby achieving effective compression of the image; after the compression and encryption is completed, the second-order pseudo-random sequence is used to scramble the compressed image to enhance the disorder and security of the final compressed image, making it possible to select a carrier image with the same size or smaller than the plaintext image. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a flow chart of a pseudo-random number generation method based on a second-order cellular automaton according to an embodiment of the present invention;
[0042] Figure 2 is a compression encryption flow chart of an embodiment of the present invention;
[0043] Figure 3 This is a scrambling flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The present invention is further described below. The following examples are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention. After reading the present invention, the modifications of various equivalent forms of the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0045] like Figure 1 The pseudo-random number generation method based on second-order cellular automaton shown includes the following steps.
[0046] Step A: Let the 256-bit binary key K seed As the initial configuration of the four-domain cellular automaton, (Because the experimental object is a square image with a size of 256, the length of the initial key is set to 256).
[0047] Step B: According to rule R, iterate this cellular automaton d times and generate a configuration sequence C 1 ,C 2 ,C 3 ,C 4 ,C 5 ,C 6,...,C d .
[0048] Step C: Use the time interval technique to perform correlation processing on the bit sequence. Here, the time interval parameter is 5, that is, only C 1 ,C 6 ,C 11 ,...,C i ,C i+5 is considered to be part of the output bit sequence. After processing, the output random sequence is obtained The value can only be 0 or 1. The cell boundary adopts a periodic type. In this embodiment, the value of i is 1-500. The state value of the cell at position i=0 is equal to the state value of the cell at the last position at this moment, that is, the state value of the cell at position i=500; the state value of the cell at position i=501 is equal to the state value of the cell at the first position at this moment, that is, equal to the state value of the cell at position i=1.
[0049] At present, there are no less than a hundred randomness testing methods, among which the more representative one is the SP800-22 standard published by the National Institute of Standards and Technology (NIST) of the United States. This standard provides a statistical test suite STS (Statistical Test Suite), which is a statistical software package that includes 15 different test methods, covering all aspects required for high-quality pseudo-random number sequences.
[0050] Take rule 90_60 as a test example. It can be seen that the second-order cellular automaton has passed all the tests of NIST, proving that the used second-order cellular automaton can generate high-quality pseudo-random number sequences. Table 1 is the test results of the pseudo-random sequence generated by this group of second-order cellular automata.
[0051] Table 1 NIST SP800-22 randomness test of second-order cellular automaton pseudo-random sequence generator
[0052]
[0053] like Figure 2 The compression encryption process shown includes the following steps:
[0054] Step 1: First, perform discrete wavelet transform (DWT) on the original image to obtain a sparse coefficient matrix P1 of the same size as the original image. In order to improve the robustness of the image and further reduce the noise of the image, threshold processing is performed on the elements in P1 that are less than the set threshold V and modified to 0, thereby generating a matrix P2. The threshold processing formula is as follows:
[0055]
[0056] Where P1(i,j) is the element in the i-th row and j-th column of P1, and P2(i,j) is the element in the i-th row and j-th column of P2.
[0057] Step 2: Generate the measurement matrix Ψ using a second-order cellular automaton.
[0058] First, the second-order cellular automaton iterates according to rule R1 times, the length is The first M×N bits in O are taken as the random sequence E=e1,e2,...,e M×N , where e i ∈{0,1},i=1,2,3,...,M×N. According to the formula w i A new random sequence W of length M×N can be obtained. Finally, after the sequence W is organized in columns according to the formula Ψ, the measurement matrix Ψ can be constructed.
[0059] in:
[0060]
[0061]
[0062] in, It is used for orthogonalization. For traditional compressed sensing, the size of the measurement matrix is M = CR × N. If the original image is too large, the size of the measurement matrix will also increase accordingly. Therefore, after the measurement matrix is generated, the STP strategy must be used to reduce the dimension. Through the STP strategy, the size of the measurement matrix can be simplified to (M / N) × (N / n), where n is a positive integer. The measurement matrix finally generated can be simplified to n 2 times.
[0063] Step 3: Apply half tensor product compressed sensing to P2. According to the following formula, each column (P i ) all use the measurement matrix Ψ for parallel sampling. Finally, the measurement value matrix D is obtained, the size of which is M×N, D i Represents the column vector of matrix D.
[0064]
[0065] In traditional compressed sensing, the number of columns (N) of the measurement sensing matrix must be equal to the N-dimensional signal. This results in defects such as large storage space for compressed sensing. The compressed sensing matrix based on the semi-tensor product can successfully compress the size of the measurement matrix to make it an L-dimensional signal, where L≤N. The compressed sensing measurement matrix Ψ obtained in step 2 is an N-dimensional signal. The compressed sensing method based on the semi-tensor product is used to compress and sample the matrix P2 to obtain the measurement value matrix D. This result is consistent with the traditional compressed sensing effect.
[0066] Step 4: Find the highest pixel value max and the lowest pixel value min of the measurement matrix D element, and quantize each element value in the matrix to [0,255]. The specific formula is shown below. The size of the quantized image P3 is M×N.
[0067]
[0068] Where Y represents the element value after quantization, and d represents the element value before quantization.
[0069] like Figure 3 The scrambling process shown includes the following steps:
[0070] Step 1): Get the two-dimensional matrix of the quantized image P3 and transform it into a one-dimensional matrix P4 through matrix transformation
[0071] Step 2): The 256-bit binary key K seed , the rule number R is introduced into the second-order cellular automaton to generate a pseudo-random sequence Q. Because the sequence values are all binary values, it is necessary to convert each 8 bits into a decimal number x, and convert x / 256 into a real number to form a real number sequence Q0. After sorting Q0, scramble P4;
[0072] Step 3: Get the scrambled matrix P5, transform it into the same dimension as the quantized image through matrix transformation, and get the final compressed ciphertext image S.
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An image encryption and compression method based on second-order cellular automata, characterized in that: include: Perform discrete wavelet transform on the plaintext image to obtain a sparse matrix; The 256-bit binary key K seed , substitute rule number R1 into the second-order cellular automaton to construct the measurement matrix Ψ; Applying half tensor product compressed sensing to sparse matrices to obtain a measurement value matrix; Quantizing the measurement value matrix to obtain a quantization matrix; By matrix transformation, the quantization matrix is transformed into a one-dimensional matrix; The 256-bit binary key K seed , substitute rule number R2 into the second-order cellular automaton to generate a pseudo-random sequence; Convert the pseudo-random sequence into a real number sequence, and use the sorted real number sequence to scramble the one-dimensional matrix to obtain a scrambled matrix; Through matrix transformation, the scrambled matrix is transformed into a matrix with the same dimension as the quantization matrix to complete the encryption compression of the plaintext image; The plaintext image is subjected to discrete wavelet transform to obtain a sparse matrix, which is specifically: Perform discrete wavelet transform on the plaintext image to obtain a sparse coefficient matrix P1 of the same size as the original image; Set the elements in P1 that are less than the set threshold to 0 to obtain the sparse matrix P2; The 256-bit binary key K seed , substitute rule number R1 into the second-order cellular automaton to construct the measurement matrix Ψ, which is: First, the second-order cellular automaton iterates according to rule R1 times, the length is A sequence of bits O, where M is the length of the plaintext image and N is the width of the plaintext image; Then, take the first M×N bits in O as the random sequence E={e1,e2,...,e M×N }, where e i ∈{0,1},i=1,2,3,...,M×N; Then, according to the following formula, a new random sequence W with a length of M×N is obtained: In the formula, w i is the i-th element in W; Finally, the measurement matrix Ψ is constructed by organizing W in columns according to the following formula:
2. The image encryption and compression method based on second-order cellular automata according to claim 1, characterized in that: The method also includes adopting the semi-tensor product (STP) strategy to reduce the dimension of the measurement matrix.
3. The image encryption and compression method based on second-order cellular automata according to claim 1, characterized in that: The method of applying half tensor product compressed sensing to a sparse matrix to obtain a measurement value matrix is specifically: For each column of the sparse matrix, the measurement matrix is used for parallel sampling to obtain a measurement value matrix.
4. The image encryption and compression method based on second-order cellular automata according to claim 1, characterized in that: The measurement value matrix is quantized to obtain a quantization matrix, which is specifically: Find the highest element value max and the lowest element value min in the measurement value matrix, and quantize each element value in the measurement value matrix to [0,255] according to the following formula to obtain the quantization matrix: Where Y represents the element value after quantization, and d represents the element value before quantization.
5. An image encryption and compression system based on a second-order cellular automaton, characterized in that: The system performs image encryption compression based on the method as described in any one of claims 1 to 4; The system comprises: A pseudo-random number generation module is used to generate pseudo-random sequences required by the compression encryption module and the scrambling module; A compression encryption module is used to construct a measurement matrix based on a pseudo-random sequence, obtain a sparse matrix of a plaintext image, apply semi-tensor product compressed sensing to the sparse matrix to obtain a measurement value matrix, and quantize the measurement value matrix; A scrambling module, used for scrambling the quantization matrix output by the compression encryption module based on a pseudo-random sequence; The workflow of the pseudo-random number generation module is as follows: seed , substitute the rule number R1 / R2 into the second-order cellular automaton to generate the first / second pseudo-random sequence; based on the first pseudo-random sequence, construct the measurement matrix Ψ; The working process of the compression encryption module is as follows: performing discrete wavelet transform on the plaintext image to obtain a sparse matrix; applying semi-tensor product compressed sensing to the sparse matrix to obtain a measurement value matrix; quantizing the measurement value matrix to obtain a quantization matrix; The working process of the scrambling module is as follows: transforming the quantization matrix into a one-dimensional matrix through matrix transformation; converting the second pseudo-random sequence into a real number sequence, and using the sorted real number sequence to scramble the one-dimensional matrix to obtain a scrambled matrix; transforming the scrambled matrix into a matrix of the same dimension as the quantization matrix through matrix transformation to obtain the final compressed ciphertext image, thereby completing the encryption compression of the plaintext image.
Citation Information
Patent Citations
A signal compression and encryption method based on coupled circuit
AU2020103541A4
Image encryption method based on memristive chaotic system, elementary cellular automaton (ECA) and compression perception
CN107492064A
