A visually secure image encryption method
Through adaptive block compression perception and non-negative matrix decomposition technology, the problems of sparseness determination and insufficient attack resistance in existing image encryption methods are solved, and efficient image encryption and decryption effects are achieved.
Patent Information
- Application Number
- CN202211168486.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-09-19
AI Technical Summary
The existing image encryption method based on block compression perception cannot effectively determine the appropriate sparseness of the image, resulting in poor encryption effect and ineffective resistance to attackers' various attack methods.
Adaptive block compression perception method is adopted to generate a sparse coefficient matrix through Tetrolet transformation and matrix chaos, and compress and mess with the block sampling strategy based on region energy and the measurement matrix generated by the chaotic system. Combined with non-negative matrix decomposition technology, secret images are embedded into the carrier image to generate ciphertext images.
It improves the effect of image encryption and anti-attack ability, ensures the visual security of ciphertext images and the reconstruction quality of decrypted images.
Smart Images

Figure CN115473625B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of compressed sensing and image encryption, and in particular to a visual security image encryption method based on adaptive block compressed sensing and non-negative matrix decomposition. Background Art
[0002] In recent years, image encryption technology has become increasingly mature, especially when combined with compression technology, which can greatly reduce the transmission and storage space, while ensuring information security and alleviating the pressure of signal transmission. Image compression methods based on block compressed sensing are one of the more popular research directions in recent years. Since this type of method can simplify the operation object from the entire image matrix to a single image block matrix, it greatly saves storage space and computational complexity, thereby greatly improving practicality. However, the inability to determine the appropriate sparsity of the image, the use of a fixed sampling rate, and the inability to construct a suitable measurement matrix make the encryption method based on the traditional block compressed sensing theory fail to achieve good results. Therefore, these have become three problems that need to be solved in this field, and are also our main research direction. In addition, facing various attack methods of attackers, more and more pure image encryption methods cannot eliminate the risk of being cracked. Therefore, some encryption methods based on visual security as a protection method have been proposed one after another, that is, the ciphertext image containing secret information is just a natural image from a visual point of view, which will not attract the attention of attackers and reduce the risk of being cracked. Non-negative matrix decomposition is a widely used data processing tool in the field of signal processing. Its non-negative limitation leads to the sparsity of the corresponding description to a certain extent, making the description of data convenient and reasonable. At the same time, it can also suppress the influence of external interference factors on data feature extraction to a certain extent. Therefore, it has the advantages of simplicity in implementation, interpretability of decomposition form and decomposition results, and less storage space, thus providing a new idea for information hiding. Summary of the invention
[0003] In order to overcome the shortcomings of the prior art, the present invention proposes a visual security image encryption method based on adaptive block compressed sensing and non-negative matrix decomposition, improves the traditional block compressed sensing theory, designs a new adaptive block compressed sensing method, and designs a new scrambling and diffusion algorithm with the help of the four-grid puzzle generated in the Tetrolet transformation process. Finally, a new information hiding method is realized by using non-negative matrix decomposition, and a ciphertext image with better encryption effect and a decrypted image with better decryption effect are obtained.
[0004] The technical solution adopted by the present invention to solve the technical problem is: a visual security image encryption method, comprising the following steps:
[0005] Generate the parameters and initial values of the six-dimensional hyperchaotic system and the mixed chaotic system according to the information of the plaintext image;
[0006] The chaotic sequence is generated through iteration of the six-dimensional hyperchaotic system, and the random sequence is constructed using the generated chaotic sequence.
[0007] Perform Tetrolet transform on the plaintext image, generate a coefficient matrix and perform matrix scrambling on the coefficient matrix in an optimized manner;
[0008] For the scrambled coefficient matrix, the number of samples allocated to each block after the coefficient matrix is divided into blocks is calculated according to the block sampling strategy based on regional energy;
[0009] The chaotic sequence is generated through iteration of the hybrid chaotic system, the initial measurement matrix is constructed by using the generated chaotic sequence, and the initial measurement matrix is optimized and normalized to obtain the final measurement matrix.
[0010] According to the block compressed sensing theory, the corresponding block coefficient matrix is measured using the block measurement matrix to obtain the measurement value matrix;
[0011] Quantizing the measurement value matrix to obtain a quantized measurement value matrix;
[0012] The quantized measurement value matrix is scrambled at pixel level using a scrambling method based on the domino tiling problem to obtain a measurement value matrix after the first scrambling;
[0013] The measurement value matrix after the first scrambling is scrambled at the bit level using a scrambling method based on the domino knocking problem to obtain the measurement value matrix after the second scrambling;
[0014] The measurement value matrix after the second scrambling is diffused by using a diffusion method based on a four-grid puzzle to obtain a diffused measurement value matrix, and a reverse diffusion operation is performed on the diffused measurement value matrix to obtain a secret image matrix;
[0015] The secret image matrix is embedded into the carrier image using non-negative matrix factorization to obtain the ciphertext image.
[0016] Furthermore, the parameters and initial values of the six-dimensional hyperchaotic system and the hybrid chaotic system are generated according to the information of the plaintext image, and the generation method is specifically as follows:
[0017] First, use the SHA512 function to generate a 512-bit hash value K of the plaintext image.
[0018] K = SHA512 (img)
[0019] Convert 8 bits into 64 decimal numbers, recorded as array k, and get matrices k11-k62 and k7 through k. The calculation process is as follows:
[0020]
[0021] For k11-k62, the calculation is performed as follows:
[0022]
[0023] Among them, KR is used to calculate the Khatri-Rao product of two matrices;
[0024] k7 is used to perform operations with kr1-kr6 respectively: the Kronecker product of k7 and kr1 is calculated to obtain a 6×8 matrix kro71, the average value of kro71 is recorded as Mkro71, kro71 is converted to a one-dimensional matrix kro71', and Mkro71 is added to the end of the one-dimensional matrix kro71' to form a 1×49 matrix kro71" and rearranged into a 7×7 matrix kro71"':
[0025]
[0026] Perform SVD singular value decomposition on kro71"' to obtain the diagonal matrix s1 containing singular values, and use the average value me1 of s1 to get key1:
[0027]
[0028] According to the above calculation method of k7 and kr1, key2-key6 are obtained in sequence.
[0029] key1, key2, key3, key4, key5, key6 form a group of keys that serve as the initial values x0, y0, z0, u0, v0, w0 of the six-dimensional hyperchaotic system respectively.
[0030] Using the array k generated by the hash value of the plaintext image above, we can get the matrix k1-k4
[0031]
[0032] Calculate the Hadamard product of k1 and k4 to get k14, and calculate the Hadamard product of k2 and k3 to get k23:
[0033]
[0034] Perform SVD singular value decomposition on k14 and k23 respectively to obtain two diagonal matrices s14 and s23 containing singular values. The average values me14 and me23 in s14 and s23 are used to obtain Key14 and key23 as the parameters r0 and initial values xx0 of the hybrid chaotic system:
[0035]
[0036] Furthermore, the chaotic sequence is generated through iteration of the six-dimensional hyperchaotic system, and the generated chaotic sequence is used to construct a random sequence, specifically:
[0037] Assume that the size of the image matrix is M'×N', the total number of pixels is num, and the sampling interval of the chaotic sequence is d;
[0038] First, substitute the initial values x0, y0, z0, u0, v0, w0 of the six-dimensional hyperchaotic system into the six-dimensional hyperchaotic system, iterate num×d times, generate six corresponding chaotic sequences xn, yn, zn, un, vn, wn, use d to sample the six chaotic sequences respectively, and get the corresponding subsequences:
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045] Quantize the subsequences w1, w2, w4, v3, v4 to between [0, 1]:
[0046]
[0047] The threshold sequence thresholdSeq is obtained by quantizing the sequence between [0,1] for the bit-level scrambling process:
[0048]
[0049] Among them, the ones() function is used to construct an all-1 matrix. After that, 12 random number sequences seq11-seq43 are constructed and inserted into the outside of the image matrix for the diffusion process:
[0050]
[0051]
[0052]
[0053]
[0054] Construct rotSeq1, rotSeq2 and chSeq for the diffusion process:
[0055]
[0056] Reconstruct the sequences S1 and S2 to diffuse the image matrix:
[0057]
[0058]
[0059]
[0060]
[0061] Furthermore, the number of samples allocated to each block after the coefficient matrix is divided into blocks is calculated according to the block sampling strategy based on regional energy for the scrambled coefficient matrix, and the specific calculation method is:
[0062] Set the block area size B, image sampling rate SR, weight matrix W, and set the size of B to 4, 8, or 16:
[0063]
[0064] Calculate the number of image blocks G and the number of samples SF:
[0065] G=num1 / B 2
[0066] SF=num1×SR
[0067] Where num1 represents the number of elements in the coefficient matrix after scrambling;
[0068] Divide the image into blocks and calculate the energy E of the pixels in the block area i :
[0069]
[0070] Among them, X i is an image block;
[0071] Calculate the energy occupancy rate PE of each image block i :
[0072]
[0073] Calculate the number of samples AM for each image block i :
[0074] AM i =PE i ×SF,i=1,2…G
[0075] The matrix composed of the sampling numbers of the image blocks at the corresponding positions is the sampling matrix AM of the entire image:
[0076]
[0077] Round off to get the actual number of samples of the image block AM i 'And the image sampling matrix AM':
[0078] AM i ′=round(PE i ×SF),i=1,2…G
[0079]
[0080] Sort AM' in ascending order to obtain the index sequence ind_AM:
[0081] [~,ind_AM]=sort(AM')
[0082] Adjust the largest element in AM' so that the total number of samples remains unchanged:
[0083] AM′(ind_AM(end))=AM′(ind_AM(end))+round(sum(AM)-sum(AM i ′)).
[0084] Furthermore, the chaotic sequence is generated through iteration of the hybrid chaotic system, the initial measurement matrix is constructed using the generated chaotic sequence, and the initial measurement matrix is optimized and normalized to obtain the final measurement matrix, which is:
[0085] The image size is M0×N0. According to the maximum image block sampling number maxAM, the hybrid chaotic system is iterated maxAM×M0×N0+t times, the first t values are discarded, and the remaining values generate the initial measurement matrix chaosMat of (maxAM×M0)×N0; the initial measurement matrix chaosMat is optimized to obtain the optimized measurement matrix Φ'. The optimization process is as follows:
[0086] Set the block size B, divide the image into blocks and calculate the sum of the absolute values of the pixel values in the blocks to obtain the matrix Sum, arrange the elements in Sum in descending order to obtain the sorting index value, recorded as Pos; adjust the generated initial measurement matrix chaosMat to a matrix of M1×N1, where N1=num1 / B 2, num1 represents the number of elements in the coefficient matrix after scrambling; M1 = Num' / N1, Num' is the number of elements in the initial measurement matrix chaosMat; calculate the sum of the mean and median of the absolute values of the column vectors of the initial measurement matrix and assign corresponding weights to obtain the sequence Sum1:
[0087] Sum1(i)=w1×sum(abs(chaosMat(:,i))+w2×median(abs(chaosMat(:,i)))where w1 and w2 are weight coefficients;
[0088] Sort Sum1 in descending order to get the index sequence Pos1, and rearrange the column vectors of the initial measurement matrix chaosMat of the corresponding size according to the size of the image block pixel sum to get Φ:
[0089] Φ(:,Pos(i))=chaoMat(:,Pos1(i))
[0090] Finally, normalization is performed to obtain the optimized measurement matrix Φ'. The normalization process is as follows:
[0091]
[0092] Furthermore, the quantized measurement value matrix is scrambled at the pixel level using a scrambling method based on the domino tiling problem to obtain the measurement value matrix after the first scrambling, which is specifically:
[0093] First, perform modular operation on the subsequence x1, y1 of the six-dimensional hyperchaotic system to obtain x1', y1':
[0094]
[0095] Each element in the sequence x1' is used as the number of the four-square puzzle, and mask segmentation is performed. The mask encoding rule is used to encode the character sequence dominoesSeq containing '_' and '|'. y1' is used as the index sequence to index each character sequence dominoesSeq, and a flag flag is obtained, with a value of 0 or 1, and finally a flag matrix Flags is obtained:
[0096]
[0097] According to the theory of domino tiling problem, two sequences Num2 and Num3 are obtained, where Num2 and Num3 are the sequences consisting of the number of methods for 2×N and 3×N domino tiling problems without considering the shape of dominoes when the length N of the rectangle in the domino tiling problem is 0-255;
[0098] Next, initialize the following matrices: Initial, Full, Finish, Flags1, S; where Initial represents the initial value of the image matrix, Full is the target value to be achieved for each element in the image matrix, Finish is the result after the image matrix is scrambled, Flags1 is a flag matrix used to record the position of the elements in the image matrix that have been scrambled, and S is an index matrix used to determine the position of the next element to be found by the current matrix element;
[0099] The six-dimensional hyperchaotic system subsequence z1, u1 is rearranged to obtain matrices z1' and u1' with the same dimensions as the image matrix, and then the length N of the rectangle in the domino tiling problem is determined:
[0100] N=u1′(i,j)
[0101] u1'(i,j) represents the element in the i-th row and j-th column of the matrix u1';
[0102] The construction process of the matrix Full and S is as follows:
[0103]
[0104]
[0105] Among them, dominoesTile is the solution function of the corresponding problem considering the shape of dominoes, and n represents the width of the rectangle in the domino tiling problem;
[0106] The nine special cases are as follows:
[0107]
[0108] Use the index matrix S to scramble the image matrix elements: expand the image matrix I and the index matrix S into sequences I' and S' respectively, each time taking half of the length len of the I' sequence as the starting point start, taking the element s' at the corresponding position in S' as the index value, taking the element i' at ((start+s') mod len) in I' and adding it to the end of the new sequence E, and taking the position of the element i' as the new starting point start, and repeating the above process until all elements in I' are scrambled;
[0109] The above scrambling process is repeated at most twice, and a screening is performed after each scrambling. The screening conditions are as follows:
[0110] Finish(i,j)=E(i,j),if Ininal(i,j)+roundCount×E(i,j)≥Full(i,j)
[0111] Among them, roundCount is the number of scrambling rounds;
[0112] In addition, the length N of the rectangle and the index matrix S in the domino tiling problem are updated once:
[0113]
[0114] Where m is the row dimension of the image matrix, len1 is the length of z1', NZRows and NZCols are arrays of rows and columns of non-zero elements in Flags1 in the Flags1 matrix, and the sequence of remaining elements after screening is restE. If there are still elements that have not been scrambled after two scrambling processes, the remaining elements are put into the remaining positions in sequence, and the whole scrambling process ends.
[0115] Furthermore, the scrambling method based on the domino knocking problem is used to perform bit-level scrambling on the measurement value matrix after the first scrambling to obtain the measurement value matrix after the second scrambling, specifically:
[0116] The six-dimensional hyperchaotic system subsequence v1 is used as the mask sequence coveringSeq1, and the threshold sequence thresholdSeq is used to generate the index sequences resultLR and resultUD for binary shift.
[0117] dominoes=divideDominoes(coveringSeq1)
[0118]
[0119]
[0120]
[0121]
[0122]
[0123] The divideDominoes function is used to determine the result after the four-square puzzle represented by the mask sequence is divided, and the getFinalState function is used to solve the state of the dominoes represented by the simulation sequence after they are pushed down. Then, the decimal r×c image matrix is converted into a binary r×(c×8) binary matrix bita, and the rows and columns of the matrix bita are shifted using the circshift function to obtain the binary matrix bitb, which is then converted into a decimal matrix:
[0124]
[0125]
[0126]
[0127]
[0128] Furthermore, the measurement value matrix after the second scrambling is diffused using a diffusion method based on a four-grid puzzle to obtain a diffused measurement value matrix, and a reverse diffusion operation is performed on the diffused measurement value matrix to obtain a secret image matrix, specifically:
[0129] During the diffusion process, the image matrix I is preprocessed, that is, a random number sequence seq11-seq41 is added to the outside of the image matrix I to prevent overflow:
[0130] I=[seq31,seq32,seq33,[seq11;seq12;seq13;I;seq23;seq22;seq21],seq43,seq42,seq41]
[0131] Then, the sequences v2 and w3 are used as mask sequences coveringSeq2 and coveringSeq3 to segment the four-grid puzzle into 15 mask shapes. According to the mask shapes, a diffusion operation is performed on the preprocessed image matrix. This operation is defined as shape_bitxor. According to the parameter shape, three adjacent pixels of pixel I(i,j) are selected to obtain I'(i',j'):
[0132]
[0133] The matrix obtained by performing shape_bitxor diffusion operation on the preprocessed image matrix is recorded as Y6, and further modulo operation is performed to obtain matrix Y7. Finally, modulo operation is performed on Y7 to obtain the secret image matrix Y8:
[0134]
[0135] Y8(i)=mod(Y8(i+1)+S2(i)+Y7(i),256)
[0136] Where n5 represents the number of columns of the preprocessed image matrix; (i-3, j-3) represents the i-3th row and j-3th column; (i-4, n5-6) represents the i-4th row and n5-6th column.
[0137] Furthermore, the secret image matrix is embedded into the carrier image using non-negative matrix decomposition to obtain the ciphertext image. Specifically, the rank of the non-negative matrix decomposition is set to 256, and the initial iteration matrix Winit, Hinit is obtained using the subsequence v56, w56:
[0138]
[0139] Then, the carrier image matrix is divided into blocks of B3×B3, and the secret image matrix Y8, initial iteration matrix Winit, and Hinit are divided into Then, the block matrix of the carrier image is decomposed by integer wavelet to obtain the block high-frequency coefficient matrix HH i , for the matrix HH i Perform non-negative matrix decomposition to obtain the matrix W i ,H i :
[0140] [W i ,H i ]=nmf(HH i ,Winit i ,Hinit i )
[0141] Where nmf is the non-negative matrix factorization function;
[0142] Then for the matrix H i , find its orthogonal matrix:
[0143] OH i =orth(H i )
[0144] If H i If it is not a full rank matrix, then change the rank of the matrix. The process is as follows:
[0145] First, the matrix H i Perform SVD singular value decomposition
[0146] [u,s,v]=svd(H i )
[0147] For the singular values in the singular value matrix s, if the condition is satisfied
[0148] s(i,j)<1 -10
[0149] Then assign the elements in s to the new matrix s', and let
[0150] s′(i,j)=s(i-1,j-1)
[0151] Then, the new submatrix H is obtained by matrix multiplication i'
[0152] H i '=u×s'×v T
[0153] where v T is the transposed matrix of v;
[0154] The next step is to embed the block matrix information of the secret image into the submatrix W using the addition rule. i , we get W i ':
[0155] W i ′=W i +α×secImg i
[0156] where secImg i is the secret image block matrix, α is the embedding strength;
[0157] Then we get the high-frequency coefficient matrix HH after embedding the information. i ':
[0158] HH i ′=W i ′×OH i
[0159] The block high frequency coefficient matrix HH i 'The matrix HH is obtained by combining them, and finally the final ciphertext image is obtained by the inverse transformation of the integer wavelet transform.
[0160] The encryption method of the present invention is used to encrypt the plaintext image, and the whole process is closely related to the plaintext information, so that the whole encryption system has a strong ability to resist chosen plaintext attacks and known plaintext attacks. The embedding method of the present invention is used to hide the secret image, which not only ensures the security of the embedding process, but also achieves the effect of visual security.
[0161] Compared with the existing methods, the present invention has the following advantages:
[0162] Instead of setting a fixed number of samples for each block of the image, the sampling process is made adaptive to the image information, and an adaptive block sampling strategy based on regional energy is proposed, so that the number of samples in the block is more reasonably distributed; the construction process of the measurement matrix is optimized, and the proportion of large coefficients is increased or reduced according to the contribution value of the image coefficients to signal recovery, thereby improving the recovery effect of image information; based on the four-grid puzzle in the construction process of Tetrolet transform and combined with related mathematical problems, a pixel-level scrambling method based on the domino tiling problem, a bit-level scrambling method based on the domino toppling problem, and a diffusion method based on the four-grid puzzle are designed, which closely combine the plaintext information with the encryption process and improve the anti-attack capability; the non-negative matrix decomposition technology is introduced to embed the secret image into the carrier image, which can not only retain the image information to a large extent, but also suppress the influence of external changes to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0163] Figure 1 This is a flow chart of the image encryption process of the present invention;
[0164] Figure 2 Schematic diagram of 16 four-grid puzzles;
[0165] Figure 3 It is a schematic diagram of the puzzle segmentation;
[0166] Figure 4 It is a schematic diagram of the puzzle coding;
[0167] Figure 5 Example diagram for the domino toppling problem;
[0168] Figure 6 Schematic diagram of preprocessing for diffusion operation;
[0169] Figure 7 Schematic diagram of 15 mask shapes;
[0170] Figure 8 PSNR value and MSSIM value of the simulation results;
[0171] Fig. 9 is the correlation coefficient between the plaintext image and the secret image;
[0172] Fig.10 For plaintext sensitivity testing;
[0173] Fig.11 is the secret image x 2 value. DETAILED DESCRIPTION
[0174] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments: this example is used to further describe the present application.
[0175] The present invention discloses a visual security image encryption method based on adaptive block compressed sensing and non-negative matrix decomposition, which combines block compressed sensing theory with non-negative matrix decomposition and can solve the problems of poor reconstruction quality of decrypted images and insufficient encryption effect.
[0176] First, Tetrolet transform is performed on the plaintext image, and then the sparsity of the sparse matrix is optimized and the matrix is scrambled to equalize the sparsity in each block area of the image matrix. Then the sampling number of the block area is calculated according to the image information, and the measurement matrix is constructed and optimized. The image is compressed using the optimized measurement matrix. Then the compressed image is scrambled and diffused to complete the encryption process. Finally, the image information is embedded into the carrier image through non-negative matrix decomposition to obtain a visually secure ciphertext image. The decryption process is the inverse process of the encryption process.
[0177] The present invention uses two chaotic systems, namely a six-dimensional hyperchaotic system and a mixed chaotic system. The mixed chaotic system is used to construct a measurement matrix, and the six-dimensional hyperchaotic system is used to generate random sequences required for scrambling, diffusion and embedding processes.
[0178] The mathematical formula of the six-dimensional hyperchaotic system is as follows:
[0179]
[0180] Among them, (h,l,f,k,g,m,r)=(10,100,2.7,2,-3,1,1).
[0181] The mathematical formula of the hybrid chaotic system is as follows:
[0182]
[0183] Where r∈[1.4,4].
[0184] The mathematical theory used in the present invention is the domino tiling problem. The generating functions of the 2×N domino tiling problem and the 3×N domino tiling problem are respectively. Without considering the shape of the dominoes, the generating function of the solution of the 2×N domino tiling problem is:
[0185]
[0186] The generating function for the 3×N domino tiling problem is:
[0187]
[0188] Among them, z represents domino.
[0189] Considering the shape of dominoes, the generating function of the solution to the 2×N domino tiling problem is:
[0190]
[0191] The generating function for the 3×N domino tiling problem is:
[0192]
[0193] Here, a and b represent vertical and horizontal dominoes respectively.
[0194] Example 1
[0195] The embodiments of the present invention are implemented based on the technical methods of the present invention. The present invention provides detailed implementation methods and specific operation processes, but the protection scope of the present invention is not limited to the following embodiments.
[0196] The parameters used in the example include sampling rate SR = 0.25, threshold TS = 11, block size B1 = 64, B2 = 8, B3 = 16, chaotic system sampling interval d = 4, additional iteration number of chaotic system t = 800, embedding strength factor α = 0.15. The chaotic system used is as described above.
[0197] Generate the parameters and initial values of the six-dimensional hyperchaotic system and the mixed chaotic system according to the information of the plaintext image;
[0198] The chaotic sequence is generated through iteration of the six-dimensional hyperchaotic system, and the random sequence is constructed using the generated chaotic sequence.
[0199] Perform Tetrolet transform on the plaintext image to generate a coefficient matrix;
[0200] Generate an optimized scrambled matrix and scramble the coefficient matrix;
[0201] For the scrambled coefficient matrix, the number of samples allocated to each block after the coefficient matrix is divided into blocks is calculated according to the block sampling strategy based on regional energy;
[0202] The chaotic sequence is generated through iteration of the hybrid chaotic system, and the initial measurement matrix is constructed using the generated chaotic sequence;
[0203] Optimize and normalize the initial measurement matrix to obtain the final measurement matrix;
[0204] According to the block compressed sensing theory, the corresponding block coefficient matrix is measured using the block measurement matrix to obtain the measurement value matrix;
[0205] Quantizing the measurement value matrix to obtain a quantized measurement value matrix;
[0206] The quantized measurement value matrix is scrambled at pixel level using a scrambling method based on the domino tiling problem to obtain the measurement value matrix after the first scrambling;
[0207] The measurement value matrix after the first scrambling is scrambled at the bit level using a scrambling method based on the domino knocking problem to obtain the measurement value matrix after the second scrambling;
[0208] The diffusion method based on the four-grid puzzle is used to diffuse the measurement value matrix after the second scrambling to obtain the diffused measurement value matrix;
[0209] Afterwards, the diffused measurement value matrix is subjected to a reverse diffusion operation to obtain the secret image matrix;
[0210] Finally, the secret image matrix is embedded into the carrier image using non-negative matrix factorization to obtain the ciphertext image.
[0211] The encryption process is as follows Figure 1 The following is a detailed description of the above steps:
[0212] Step 1: First, use the SHA512 function to generate a 512-bit hash value K of the plaintext image.
[0213] K = SHA512 (img)
[0214] Convert 8 bits into 64 decimal numbers, recorded as array k, and get matrices k11-k62 and k7 through k. The calculation process is as follows:
[0215]
[0216] For k11-k62, the calculation is performed as follows:
[0217]
[0218] Among them, KR is used to calculate the Khatri-Rao product of two matrices.
[0219] k7 is used to perform operations with kr1-kr6 respectively. For example, the Kronecker product of k7 and kr1 is calculated to obtain a 6*8 matrix kro71, and the average value of kro71 is recorded as Mkro71. kro71 is converted into a one-dimensional matrix kro71', and Mkro71 is added to the end of the matrix to form a 1*49 matrix and rearranged into a 7*7 matrix.
[0220]
[0221] Perform SVD on kro71”’ to obtain the diagonal matrix s1 containing singular values, and use the average value me1 of s1 to obtain key1
[0222]
[0223] Similarly, we can get key2-key6, key1, key2, key3, key4, key5, key6 form a group of keys which are used as the initial values x0, y0, z0, u0, v0, w0 of the six-dimensional hyperchaotic system respectively.
[0224] Use the array k generated by the hash value of the plaintext image to get the matrix k1-k4
[0225]
[0226] Calculate the Hadamard product of k1 and k4 to get k14, calculate the Hadamard product of k2 and k3 to get k23
[0227]
[0228]
[0229] Perform SVD on k14 and k23 respectively to obtain two diagonal matrices s14 and s23 containing singular values. The average values me14 and me23 in s14 and s23 are used to obtain Key14 and key23 as the parameters r0 and initial values xx0 of the hybrid chaotic system.
[0230]
[0231] Step 2: Assume that the size of the image matrix is M'×N', the total number of pixels is num, and the sampling interval of the chaotic sequence is d;
[0232] First, the initial values of the chaotic system x0, y0, z0, u0, v0, w0 are substituted into the six dimensions, and iterated num×d times to generate six corresponding chaotic sequences xn, yn, zn, un, vn, wn. The six chaotic sequences are sampled using d to obtain the corresponding subsequences.
[0233]
[0234]
[0235]
[0236]
[0237]
[0238]
[0239] Quantize the sequence w1,w2,w4,v3,v4 to between [0,1],
[0240]
[0241] Further operations are performed on the above sequence to obtain the threshold sequence thresholdSeq for the bit-level scrambling process:
[0242]
[0243] Among them, the ones() function is used to construct a matrix of all 1s. After that, 12 random number sequences seq11-seq43 are constructed and inserted into the outside of the image matrix for the diffusion process.
[0244]
[0245]
[0246]
[0247]
[0248] Construct rotSeq1, rotSeq2 and chSeq for the diffusion process:
[0249]
[0250] Then, sequences S1 and S2 are constructed to diffuse the image matrix.
[0251]
[0252]
[0253]
[0254]
[0255] Step 3: The low-frequency and high-frequency coefficient matrices generated after the plaintext image is transformed by Tetrolet are arranged in a new coefficient matrix X with low frequencies on top and high frequencies on the bottom. Set the block size B1, rearrange X into a matrix X1 with a row dimension of B1, and perform matrix scrambling on X1 with the goal of balancing block sparsity to obtain X2 in order to reduce the maximum block sparsity and improve sampling efficiency.
[0256] Step 4: Set the block size B, image sampling rate SR, and weight matrix W. Considering the computational complexity and the correlation between adjacent pixels of the image, we set the size of B to 4, 8, and 16.
[0257]
[0258] Calculate the number of image blocks G and the number of samples SF
[0259] G=num1 / B 2
[0260] SF=num1×SR
[0261] Where num1 represents the number of elements in the coefficient matrix after scrambling;
[0262] Divide the image into blocks and calculate the energy E of the pixels in the block area i
[0263]
[0264] Among them, X i is an image block.
[0265] Calculate the energy occupancy rate PE of each image block i
[0266]
[0267] Calculate the number of samples AM for each image block i
[0268] AM i =PE i ×SF,i=1,2…G
[0269] The matrix composed of the sampling numbers of the image blocks at the corresponding positions is the sampling matrix AM of the entire image.
[0270]
[0271] Considering that the sampling number may not be an integer, the actual image block sampling number AM is obtained by rounding. i 'And the image sampling matrix AM'
[0272] AM i ′=round(PE i ×SF),i=1,2…G
[0273]
[0274] Sort AM' in ascending order to obtain the index sequence ind_AM
[0275] [~,ind_AM]=sort(AM')
[0276] Adjust the largest element in AM' to keep the total number of samples unchanged
[0277] AM′(ind_AM(end))=AM′(ind_AM(end))+round(sum(AM)-sum(AM i ′))
[0278] The largest element in AM' is maxAM, which is used in the iterative process of the chaotic system.
[0279] maxAM=max(AM′)
[0280] Step 5: Assume that the image size is M0×N0, iterate the hybrid chaotic system maxAM×M0×N0+t times according to the maximum block sampling number maxAM, discard the first t values, and use the remaining values to generate the initial measurement matrix chaosMat of (maxAM×M0)×N0.
[0281] Step 6: Optimize the measurement matrix chaosMat to obtain the optimized measurement matrix Φ'. The optimization process is as follows: set the block area size B, divide the image into blocks and calculate the sum of the absolute values of the pixel values in the blocks to obtain the matrix Sum, arrange the elements in Sum in descending order to obtain the sorting index value, recorded as Pos; adjust the generated initial measurement matrix chaosMat to a matrix of M1×N1, where N1=num1 / B 2 , num1 represents the number of elements in the coefficient matrix after scrambling; M1 = Num' / N1, Num' is the number of elements in the initial measurement matrix chaosMat; calculate the sum of the mean and median of the absolute values of the column vectors of the initial measurement matrix and assign corresponding weights to obtain the sequence Sum1:
[0282] Sum1(i)=w1×sum(abs(chaosMat(:,i)))+w2×median(abs(chaosMat(:,i))) where w1 and w2 are weight coefficients; in this embodiment, w1=0.5, w2=0.5;
[0283] Sort Sum1 in descending order to obtain the index sequence Pos1. Rearrange the column vectors of the measurement matrix chaosMat of corresponding size according to the size of the image block pixel sum to obtain Φ
[0284] Φ(:,Pos(i))=chaoMat(:,Pos1(i))
[0285] Finally, normalization is performed to obtain the measurement matrix Φ'. The normalization process is as follows:
[0286]
[0287] Step 7: Determine the final block measurement matrix Φ according to the block sampling rate. Divide X2 into blocks according to the set block size B2 and convert each block into a column vector to obtain the matrix X3. Use block compressed sensing to compress the coefficient matrix to obtain the measurement value matrix Y1.
[0288]
[0289] Among them, Φ i is AM'(i)×B2 2 The matrix is composed of column vectors Φ'(1:AM'(i)×B2 2 ,i) rearrange to get, i=1,2…l,l=M0×N0 / B2 2 .
[0290] The measurement process is as follows:
[0291] Y i =Φ i X3(:,i)
[0292]
[0293] Afterwards, Y1 is rearranged into a matrix of (SR×M0)×N0.
[0294] Step 8: Quantize the elements of the measurement matrix to the interval [0,255] to obtain the matrix Y2.
[0295]
[0296] Among them, Min and Max are the maximum and minimum values of Y1 respectively.
[0297] Step 9: First, perform modular operation on the six-dimensional hyperchaotic system subsequence x1, y1 to obtain x1', y1':
[0298]
[0299] Each element in the sequence x1' is taken as Figure 2 The numbering of the four-grid puzzle is based on Figure 3 Perform mask segmentation and use Figure 4 By encoding according to the encoding rules, we can get a character sequence dominoesSeq containing '_' and '|'. Using y1' as the index sequence to index each character sequence, we can get a flag bit flag, with a value of 0 or 1, and finally get a flag bit matrix Flags.
[0300]
[0301] According to the relevant theories of the domino tiling problem, the two sequences Num2 and Num3 are obtained, where Num2 and Num3 are the sequences composed of the number of methods for the 2×N and 3×N domino tiling problems that do not consider the shape of the dominoes when the length N of the rectangle in the domino tiling problem is 0-255. Then, initialize the following matrices: Initial, Full, Finish, Flags1, S. Among them, Initial represents the initial value of the image matrix, Full is the target value to be achieved for each element in the image matrix, Finish is the result after the image matrix is scrambled, Flags1 is the flag matrix used to record the position of the elements in the image matrix that have been scrambled, and S is the index matrix used to determine the next element position to be found by the current matrix element.
[0302] Rearrange the sequence z1,u1 to obtain matrices z1' and u1' with the same dimensions as the image matrix, and then determine the length N of the rectangle in the domino tiling problem
[0303] N=u1′(i,j)
[0304] u1'(i,j) represents the element in the i-th row and j-th column of the matrix u1';
[0305] The construction process of the matrix Full and S is as follows:
[0306]
[0307]
[0308] Among them, dominoesTile is the solution function of the corresponding problem considering the shape of dominoes; n represents the width of the rectangle in the domino tiling problem; however, not all inputs can be solved, and the nine special cases are as follows:
[0309]
[0310] Use the index matrix S to scramble the elements of the image matrix. Expand the image matrix I and the index matrix S into sequences I' and S' respectively. Each time, take half of the length len of the sequence I' as the starting point start, and take the element s' at the corresponding position in S' as the index value. Take the element i' at ((start+s') mod len) in I' and add it to the end of the new sequence E. The position of the element i' is used as the new starting point start. Repeat the above process until all elements in I' are scrambled. In order to make the scrambling process more complicated, the scrambling algorithm in the method will repeat the above scrambling process at most twice. Perform a screening after each scrambling, and the screening conditions are as follows:
[0311] Finish(i,j)=E(i,j),if Initial(i,j)+roundCount×E(i,j)≥Full(i,j)
[0312] Among them, roundCount is the number of scrambling rounds.
[0313] In addition, N and matrix S need to be updated once:
[0314]
[0315] Among them, m is the row dimension of the image matrix, len1 is the length of z1', NZRows and NZCols are arrays of rows and columns of non-zero elements in Flags1 in the Flags1 matrix. Let the sequence of remaining elements after screening be restE. If there are still elements that have not been scrambled after two scrambling processes, the remaining elements are put into the remaining positions in sequence, and the entire scrambling process of Y2 is completed, and Y3 is obtained.
[0316] Step 10: Use sequence v1 as the mask sequence coveringSeq1 and the threshold sequence thresholdSeq to generate the index sequences resultLR and resultUD for binary shift.
[0317] dominoes=divideDomines(coveringSeq1)
[0318]
[0319]
[0320]
[0321]
[0322]
[0323] The divideDominoes function is used to determine the Figure 3 For the result after the four-square puzzle represented by the mask sequence is segmented, the getFinalState function is used to solve the state after the dominoes represented by the simulation sequence are pushed down. Figure 5 This is an example of the domino toppling problem. Then, the decimal r×c image matrix Y3 is converted into a binary r×(c×8) binary matrix bita, and the rows and columns of the matrix bita are shifted using the circshift function to obtain the binary matrix bitb, and then bitb is converted into the decimal matrix Y4.
[0324]
[0325] Step 11: During the diffusion process, the image matrix I (i.e. Y4) needs to be preprocessed to obtain Y5, such as Figure 6 That is, a random number sequence seq11-seq41 is added to the outside of the image matrix to prevent overflow.
[0326] I=[seq31,seq32,seq33,[seq11;seq12;seq13;I;seq23;seq22;seq21],seq43,seq42,seq41]
[0327] Then, sequences v2 and w3 are used as masking sequences coveringSeq2 and coveringSeq3. Figure 2 The four-grid puzzle is divided into Figure 7 According to the mask shape, a diffusion operation is performed on the preprocessed image matrix. This operation is defined as shape_bitxor. According to the parameter shape, three adjacent pixels of pixel I(i,j) are selected to obtain I'(i',j').
[0328]
[0329] Perform shape_bitxor diffusion operation on the preprocessed image matrix Y5 to obtain Y6. Perform further modulus operation on Y6 to obtain Y7
[0330]
[0331] Where n5 represents the number of columns of the preprocessed image matrix; (i-3, j-3) represents the i-3th row and j-3th column; (i-4, n5-6) represents the i-4th row and n5-6th column.
[0332] Step 12: Obtain Y8 by performing a modulo operation on Y7.
[0333] Y8(i)=mod(Y8(i+1)+S2(i)+Y7(i),256)
[0334] Step 13: First, set the rank of the non-negative matrix factorization to 256, and use the sequence v56, w56 to obtain the initial iteration matrix Winit, Hinit.
[0335]
[0336] Then, the carrier image matrix is divided into blocks of B3×B3, and the secret image matrix Y8 and the initial iteration matrix Winit, Hinit are divided into Then, the block matrix of the carrier image is decomposed by integer wavelet to obtain the block high-frequency coefficient matrix HH i , for the matrix HH i Perform non-negative matrix decomposition to obtain the matrix W i ,H i .
[0337] [W i ,H i ]=nmf(HH i ,Winit i ,Hinit i )
[0338] Where nmf is the non-negative matrix factorization function;
[0339] Then for the matrix H i , find its orthogonal matrix
[0340] OH i =orth(H i )
[0341] If H i It is not a full rank matrix, and the rank of the matrix needs to be changed. The process is as follows:
[0342] First, the matrix H i Perform SVD
[0343] [u,s,v]=svd(H i )
[0344] For the singular values in the singular value matrix s, if the condition is satisfied
[0345] s(i,j)<1 -10
[0346] Then assign the elements in s to the new matrix s', and let
[0347] s′(i,j)=s(i-1,j-1)
[0348] Then, the new submatrix H is obtained by matrix multiplication i '
[0349] H i '=u×s'×v T
[0350] where v T is the transposed matrix of v.
[0351] The next step is to embed the block matrix information of the secret image into the submatrix W using the addition rule. i , we get W i '.
[0352] W i ′=W i +α×secImg i
[0353] where secImg i is the secret image block matrix, α is the embedding strength;
[0354] Then we get the high-frequency coefficient matrix HH after embedding the information. i '
[0355] HH i ′=W i ′×OH i
[0356] The block high frequency coefficient matrix HH i 'The matrix HH is obtained by combining them, and finally the final ciphertext image is obtained by the inverse transformation of the integer wavelet transform.
[0357] The present invention proposes an image encryption method based on adaptive compressed sensing and non-negative matrix decomposition, which is mainly divided into two stages. In the first stage, after the plaintext image is sparsed by Tetrolet transformation, the image is compressed by the process of adaptive block compressed sensing, and then the image is encrypted into a noise-like secret image by means of the proposed scrambling and diffusion method. In the second stage, the secret image is embedded into the high-frequency coefficients of the carrier image by non-negative matrix decomposition to obtain a meaningful ciphertext image. The present invention is simulated in MATLAB R2016a, and the operating environment is Win10 Intel Core I5-10500, ARM 16.0GB, through Figure 8-Figure 11 The results show that the encryption and decryption effects obtained in this example are better than those of other methods.
[0358] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical method and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A visually secure image encryption method, characterized in that: The steps include: Generate the parameters and initial values of the six-dimensional hyperchaotic system and the mixed chaotic system according to the information of the plaintext image; The chaotic sequence is generated through iteration of the six-dimensional hyperchaotic system, and the random sequence is constructed using the generated chaotic sequence. Perform Tetrolet transform on the plaintext image, generate a coefficient matrix and perform matrix scrambling on the coefficient matrix in an optimized manner; For the scrambled coefficient matrix, the number of samples allocated to each block after the coefficient matrix is divided into blocks is calculated according to the block sampling strategy based on regional energy; The chaotic sequence is generated through iteration of the hybrid chaotic system, the initial measurement matrix is constructed by using the generated chaotic sequence, and the initial measurement matrix is optimized and normalized to obtain the final measurement matrix. According to the block compressed sensing theory, the corresponding block coefficient matrix is measured using the block measurement matrix to obtain the measurement value matrix; Quantizing the measurement value matrix to obtain a quantized measurement value matrix; The quantized measurement value matrix is scrambled at pixel level using a scrambling method based on the domino tiling problem to obtain a measurement value matrix after the first scrambling; Using a scrambling method based on the domino knocking problem, the measurement value matrix after the first scrambling is scrambled at the bit level to obtain the measurement value matrix after the second scrambling; The measurement value matrix after the second scrambling is diffused by using a diffusion method based on a four-grid puzzle to obtain a diffused measurement value matrix, and a reverse diffusion operation is performed on the diffused measurement value matrix to obtain a secret image matrix; The secret image matrix is embedded into the carrier image using non-negative matrix decomposition to obtain the ciphertext image. The parameters and initial values of the six-dimensional hyperchaotic system and the mixed chaotic system are generated according to the information of the plaintext image, and the generation method is specifically as follows: First, use the SHA512 function to generate a 512-bit hash value K of the plaintext image. K = SHA512 (img) Convert 8 bits into 64 decimal numbers, recorded as array k, and get matrices k11-k62 and k7 through k. The calculation process is as follows: For k11-k62, the calculation is performed as follows: Among them, KR is used to calculate the Khatri-Rao product of two matrices; k7 is used to perform operations with kr1-kr6 respectively: the Kronecker product of k7 and kr1 is calculated to obtain a 6×8 matrix kro71, the average value of kro71 is recorded as Mkro71, kro71 is converted to a one-dimensional matrix kro71', and Mkro71 is added to the end of the one-dimensional matrix kro71' to form a 1×49 matrix kro71" and rearranged into a 7×7 matrix kro71"': Perform SVD singular value decomposition on kro71"' to obtain the diagonal matrix s1 containing singular values, and use the average value me1 of s1 to get key1: According to the above calculation method of k7 and kr1, key2-key6 are obtained in sequence. key1, key2, key3, key4, key5, key6 form a group of keys as the initial values x0, y0, z0, u0, v0, w0 of the six-dimensional hyperchaotic system; Using the array k generated by the hash value of the plaintext image above, we can get the matrix k1-k4 Calculate the Hadamard product of k1 and k4 to get k14, and calculate the Hadamard product of k2 and k3 to get k23: Perform SVD singular value decomposition on k14 and k23 respectively to obtain two diagonal matrices s14 and s23 containing singular values. The average values me14 and me23 in s14 and s23 are used to obtain Key14 and key23 as the parameters r0 and initial values xx0 of the hybrid chaotic system: The chaotic sequence is generated by iteration of the six-dimensional hyperchaotic system, and the generated chaotic sequence is used to construct a random sequence, specifically: Assume that the size of the image matrix is M'×N', the total number of pixels is num, and the sampling interval of the chaotic sequence is d; First, substitute the initial values x0, y0, z0, u0, v0, w0 of the six-dimensional hyperchaotic system into the six-dimensional hyperchaotic system, iterate num×d times, generate six corresponding chaotic sequences xn, yn, zn, un, vn, wn, use d to sample the six chaotic sequences respectively, and get the corresponding subsequences: Quantize the subsequences w1, w2, w4, v3, v4 to between [0, 1]: The threshold sequence thresholdSeq is obtained by quantizing the sequence between [0,1] for the bit-level scrambling process: Among them, the ones() function is used to construct an all-1 matrix. After that, 12 random number sequences seq11-seq43 are constructed and inserted into the outside of the image matrix for the diffusion process: Construct rotSeq1, rotSeq2 and chSeq for the diffusion process: Reconstruct the sequences S1 and S2 to diffuse the image matrix: The number of samples allocated to each block after the coefficient matrix is divided into blocks is calculated for the scrambled coefficient matrix according to the block sampling strategy based on regional energy. The specific calculation method is: Set the block area size B, image sampling rate SR, weight matrix W, and set the size of B to 4, 8, or 16: Calculate the number of image blocks G and the number of samples SF: G=num1 / B 2 SF=num1×SR Where num1 represents the number of elements in the coefficient matrix after scrambling; Divide the image into blocks and calculate the energy E of the pixels in the block area i : Among them, X i is an image block; Calculate the energy occupancy rate PE of each image block i : Calculate the number of samples AM for each image block i : AM i =PE i ×SF,i=1.2…G The matrix composed of the sampling numbers of the image blocks at the corresponding positions is the sampling matrix AM of the entire image: Round off to get the actual number of samples of the image block AM i 'And the image sampling matrix AM': AM′ i =round(PEi×SF),i=1,2…G Sort AM' in ascending order to obtain the index sequence ind_AM: [~,ind_AM]=sort(AM') Adjust the largest element in AM' so that the total number of samples remains unchanged: AM′(ind_AM(end))=AM′(ind_AM(end))+round(sum(AM)-sum(AM i '))。 2. A visual security image encryption method according to claim 1, characterized in that: The chaotic sequence is generated by iterative hybrid chaotic system, and the initial measurement matrix is constructed by using the generated chaotic sequence. The initial measurement matrix is optimized and normalized to obtain the final measurement matrix, which is: The image size is M0×N0. According to the maximum image block sampling number maxAM, the hybrid chaotic system is iterated maxAM×M0×N0+t times, the first t values are discarded, and the remaining values generate the initial measurement matrix chaosMat of (maxAM×M0)×N0; the initial measurement matrix chaosMat is optimized to obtain the optimized measurement matrix Φ'. The optimization process is as follows: Set the block size B, divide the image into blocks and calculate the sum of the absolute values of the pixel values in the blocks to obtain the matrix Sum, arrange the elements in Sum in descending order to obtain the sorting index value, recorded as Pos; adjust the generated initial measurement matrix chaosMat to a matrix of M1×N1, where N1=num1 / B 2 , num1 represents the number of elements in the coefficient matrix after scrambling; M1 = Num' / N1, Num' is the number of elements in the initial measurement matrix chaosMat; calculate the sum of the mean and median of the absolute values of the column vectors of the initial measurement matrix and assign corresponding weights to obtain the sequence Sum1: Sum1(i)=w1×sum(abs(chaosMat(:,i)))+w2×median(abs(chaosMat(:,i))) Where w1 and w2 are weight coefficients; Sort Sum1 in descending order to get the index sequence Pos1, and rearrange the column vectors of the initial measurement matrix chaosMat of the corresponding size according to the size of the image block pixel sum to get Φ: Φ(:,Pos(i))=chaoMat(:,Pos1(i)) Finally, normalization is performed to obtain the optimized measurement matrix Φ'. The normalization process is as follows:
3. A visual security image encryption method according to claim 2, characterized in that: The quantized measurement value matrix is scrambled at the pixel level using the scrambling method based on the domino tiling problem to obtain the measurement value matrix after the first scrambling, which is specifically: First, perform modular operation on the subsequence x1, y1 of the six-dimensional hyperchaotic system to obtain x1', y1': Each element in the sequence x1' is used as the number of the four-square puzzle, and mask segmentation is performed. The mask encoding rule is used to encode the character sequence dominoesSeq containing '_' and '|'. y1' is used as the index sequence to index each character sequence dominoesSeq, and a flag flag is obtained, with a value of 0 or 1, and finally a flag matrix Flags is obtained: According to the theory of domino tiling problem, two sequences Num2 and Num3 are obtained, where Num2 and Num3 are the sequences consisting of the number of methods for 2×N and 3×N domino tiling problems without considering the shape of dominoes when the length N of the rectangle in the domino tiling problem is 0-255; Next, initialize the following matrices: Initial, Full, Finish, Flags1, S; where Initial represents the initial value of the image matrix, Full is the target value to be achieved for each element in the image matrix, Finish is the result after the image matrix is scrambled, Flags1 is a flag matrix used to record the position of the elements in the image matrix that have been scrambled, and S is an index matrix used to determine the position of the next element to be found by the current matrix element; The six-dimensional hyperchaotic system subsequence z1, u1 is rearranged to obtain matrices z1' and u1' with the same dimensions as the image matrix, and then the length N of the rectangle in the domino tiling problem is determined: N=u1′(i,j) u1'(i,j) represents the element in the i-th row and j-th column of the matrix u1'; The construction process of the matrices Full and S is as follows: Among them, dominoesTile is the solution function of the corresponding problem considering the shape of dominoes, and n represents the width of the rectangle in the domino tiling problem; The nine special cases are as follows: Use the index matrix S to scramble the image matrix elements: expand the image matrix I and the index matrix S into sequences I' and S' respectively, each time taking half of the length len of the I' sequence as the starting point start, taking the element s' at the corresponding position in S' as the index value, taking the element i' at ((start+s') mod len) in I' and adding it to the end of the new sequence E, and taking the position of the element i' as the new starting point start, and repeating the above process until all elements in I' are scrambled; The above scrambling process is repeated at most twice, and a screening is performed after each scrambling. The screening conditions are as follows: Finish(i,j)=E(i,j),ifInitial(i,j)+roundCount×E(i,j)≥Full(i,j) Among them, roundCount is the number of scrambling rounds; In addition, the length N of the rectangle and the index matrix S in the domino tiling problem are updated once: Where m is the row dimension of the image matrix, len1 is the length of z1', NZRows and NZCols are arrays of rows and columns of non-zero elements in Flags1 in the Flags1 matrix, and the sequence of remaining elements after screening is restE. If there are still elements that have not been scrambled after two scrambling processes, the remaining elements are put into the remaining positions in sequence, and the whole scrambling process ends.
4. A visual security image encryption method according to claim 3, characterized in that: The scrambling method based on the domino knocking problem is used to perform bit-level scrambling on the measurement value matrix after the first scrambling to obtain the measurement value matrix after the second scrambling, which is specifically: The six-dimensional hyperchaotic system subsequence v1 is used as the mask sequence coveringSeq1, and the threshold sequence thresholdSeq is used to generate the index sequences resultLR and resultUD for binary shift. dominoes=divideDominoes(coveringSeq1) The divideDominoes function is used to determine the result after the four-square puzzle represented by the mask sequence is divided, and the getFinalState function is used to solve the state of the dominoes represented by the simulation sequence after they are pushed down. Then, the decimal r×c image matrix is converted into a binary r×(c×8) binary matrix bita, and the rows and columns of the matrix bita are shifted using the circshift function to obtain the binary matrix bitb, which is then converted into a decimal matrix:
5. A visual security image encryption method according to claim 4, characterized in that: The measurement value matrix after the second scrambling is diffused using a diffusion method based on a four-grid puzzle to obtain a diffused measurement value matrix. The diffused measurement value matrix is subjected to a reverse diffusion operation to obtain a secret image matrix, which is specifically: During the diffusion process, the image matrix I is preprocessed, that is, a random number sequence seq11-seq41 is added to the outside of the image matrix I to prevent overflow: I=[seq31,seq32,seq33,[seq11;seq12;seq13;I;seq23;seq22;seq21],seq43,seq42,seq41] Then use sequences v2,w3 as mask sequences coveringSeq2,coveringSeq3, segment the four-grid puzzle to form 15 mask shapes, and perform diffusion operation on the preprocessed image matrix according to the mask shape. This operation is defined as shape_bitxor. According to the parameter shape, three adjacent pixels of pixel point I(i,j) are selected to obtain I'(i',j'): The matrix obtained by performing shape_bitxor diffusion operation on the preprocessed image matrix is recorded as Y6, and further modulo operation is performed to obtain matrix Y7. Finally, modulo operation is performed on Y7 to obtain the secret image matrix Y8: Y8(i)=mod(Y8(i+1)+S2(i)+Y7(i),256) Where n5 represents the number of columns of the preprocessed image matrix; (i-3, j-3) represents the i-3th row and j-3th column; (i-4, n5-6) represents the i-4th row and n5-6th column.
6. A visual security image encryption method according to claim 5, characterized in that: The method of using non-negative matrix decomposition to embed the secret image matrix into the carrier image to obtain the ciphertext image is as follows: the rank of the non-negative matrix decomposition is set to 256, and the initial iteration matrix Winit, Hinit is obtained by using the subsequence v56, w56: Then, the carrier image matrix is divided into blocks of B3×B3, and the secret image matrix Y8, initial iteration matrix Winit, and Hinit are divided into Then, the block matrix of the carrier image is decomposed by integer wavelet to obtain the block high-frequency coefficient matrix HH i , for the matrix HH i Perform non-negative matrix decomposition to obtain the matrix W i ,H i : [W i ,H i ]=nmf(HH i ,Winit i ,Hinit i ) Where nmf is the non-negative matrix factorization function; Then for the matrix H i , find its orthogonal matrix: OH i =orth(H i ) If H i If it is not a full rank matrix, then change the rank of the matrix. The process is as follows: First, the matrix H i Perform SVD singular value decomposition [u,s,v]=svd(H i ) For the singular values in the singular value matrix s, if the condition is satisfied s(i,j)<1 -10 Then assign the elements in s to the new matrix s', and let s′(i,j)=s(i-1,j-1) Then, the new submatrix H is obtained by matrix multiplication i ' H i '=u×s'×v T where v T is the transposed matrix of v; The next step is to embed the block matrix information of the secret image into the submatrix W using the addition rule. i , we get W i ': IN i ′=W i +α×secImg i where secImg i is the secret image block matrix, α is the embedding strength; Then we get the high-frequency coefficient matrix HH after embedding the information. i ': HH i ′=W i ′×OH i The block high frequency coefficient matrix HH i 'The matrix HH is obtained by combining them, and finally the final ciphertext image is obtained by the inverse transformation of the integer wavelet transform.