Image adaptive encryption and decryption method based on chaotic sequence
Through the image adaptive encryption and decryption method based on SAFD and 1D-Logistic mapping, the problem of easy reverse analysis of frequency domain and poor key universality in the prior art is solved, and high security and efficient image encryption are achieved to adapt to the encryption needs of different image contents.
Patent Information
- Application Number
- CN202510766574.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-12
AI Technical Summary
The existing image encryption technology has problems such as frequency domain methods being easily reversed analysis, chaos methods being difficult to resist clipping and interference attacks, poor key versatility, and complex management.
The correlation coefficient and common atoms are extracted using SAFD-based image decomposition method, combined with 1D-Logistic mapping for encryption and decryption, and the initial value sensitivity and adaptability of the chaotic sequence are used to generate an adaptive key to enhance security and encryption quality.
Adaptive frequency domain encryption method is realized, which improves the security and quality of image encryption, enhances resistance to reverse analysis, reduces the amount of redundant data, and improves the flexibility of key space and encryption parameters.
Smart Images

Figure CN120474683A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image encryption, and in particular to an image adaptive encryption and decryption method based on chaotic sequences. Background Art
[0002] With the rapid development of the Internet and digital information technology, images, as an important carrier of information, are widely used in key fields such as medicine, finance, and the military. During the transmission and storage of image data, they are extremely vulnerable to security threats such as theft and tampering. Therefore, image encryption technology has become an important research direction in the field of information security.
[0003] Existing image encryption technologies can be mainly divided into two categories: spatial domain encryption and frequency domain encryption:
[0004] Spatial Domain Encryption: This type of method directly operates on image pixel values, encrypting them through pixel scrambling or replacement. Examples include image encryption algorithms based on the Arnold transform or the Logistic Chaotic Map. While these methods offer the advantages of high computational efficiency, they often suffer from security risks such as a small key space and weak resistance to statistical analysis. For example, the Logistic Chaotic Map exhibits degenerate and periodic dynamic characteristics, making it vulnerable to brute force attacks.
[0005] Frequency-domain encryption technology: This method uses discrete cosine transform (DCT) and discrete wavelet transform (DWT) techniques to map the image from the spatial domain to the frequency domain before encrypting it. Frequency-domain methods offer better security, but their reliance on fixed basis functions makes them difficult to adapt to varying image content and poses limitations in achieving both image compression and encryption simultaneously.
[0006] In recent years, chaos theory has been widely used in image encryption due to its sensitivity to initial values and pseudo-randomness. Meanwhile, adaptive frequency-domain sparse representation techniques (such as the SAFD method) have demonstrated great potential in the field of image compression, but their application in image encryption is still in its early stages of exploration. However, existing chaos-based image encryption schemes mostly focus on pixel-level scrambling processing and fail to effectively address the problem of compressing redundant image information. Furthermore, the security of existing technologies needs to be improved. For example, frequency-domain methods use fixed basis functions, making them susceptible to reverse analysis; and chaos methods, if not integrated with frequency-domain processing, are difficult to defend against attacks such as cropping and interference. Furthermore, most existing algorithms cannot dynamically adjust encryption parameters based on image content, resulting in poor versatility and complex key management.
[0007] Therefore, an image encryption method with high security and adaptability is needed to solve the above problems in the prior art. Summary of the Invention
[0008] (1) Technical issues to be resolved
[0009] The technical problem to be solved by the present invention is how to provide an image adaptive encryption and decryption method based on chaotic sequences to solve the problems that the frequency domain method uses fixed basis functions and is easily reverse analyzed; the chaotic method is difficult to resist attacks such as clipping and interference if it is not integrated with frequency domain processing; the key has poor universality and is complex to manage.
[0010] (2) Technical solution
[0011] To address the above-mentioned problems in existing image encryption technologies, the present invention proposes an adaptive image encryption and decryption method based on chaotic sequences. This method aims to overcome the limitations of fixed basis functions in traditional frequency domain techniques while combining the advantages of chaos to improve image encryption quality and security. The method comprises the following steps:
[0012] S1. Obtain the original image and fill it;
[0013] S2, reducing the dimension of the image filled in S1 to a two-dimensional matrix, dividing it into blocks, and expanding it into one-dimensional vectors and arranging them row by row to obtain a processing matrix;
[0014] S3, decomposing the processing matrix obtained in S2 using a SAFD-based image decomposition method to obtain decomposition results: correlation coefficient, common atoms, and number of columns;
[0015] S4. Reorganizing the correlation coefficient obtained in S3 into an approximate square matrix, and quantifying the reorganized correlation coefficient and the common atoms obtained in S3;
[0016] S5. Check the key length, encrypt the correlation coefficient using an image encryption method based on 1D-Logistic mapping, and output the final ciphertext image;
[0017] S6. Check the key length and decrypt the correlation coefficient based on 1D-Logistic mapping;
[0018] S7, dequantizing the correlation coefficient and the common atoms, and further obtaining the restored correlation coefficient;
[0019] S8. Restore the decomposition result based on SAFD to obtain the reconstructed matrix;
[0020] S9. Splice, reconstruct, and de-fill the matrix to obtain the restored original image.
[0021] Furthermore, the step of filling the original image in S1 includes:
[0022] The original image is obtained and padded with all zeros to ensure that its size is divisible by the subsequent block parameters. For the H×W×C multi-channel image, the size of the padded image is (H+dh)×(W+dw)×C.
[0023] Furthermore, the step of reducing the dimension of the filled image to a two-dimensional matrix, dividing it into blocks, and expanding it into one-dimensional vectors and arranging them row by row to obtain a processing matrix in S2 includes:
[0024] S21, stitching the multi-channel images in the longitudinal direction according to the channels, and converting the obtained (H+dh)×(W+dw)×C image into a two-dimensional matrix of ((H+dh)C)×(W+dw);
[0025] S22. Divide the two-dimensional matrix into (h_num×w_num) block matrices of size (block_h×block_w) according to the specified block coefficients block_h and block_w.
[0026] S23. Expand the block matrix into a one-dimensional vector and arrange it in rows in sequence to form a processing matrix with the number of rows being the number of blocks (h_num×w_num) and the number of columns being the block size (block_h×block_w).
[0027] Furthermore, the step of decomposing the matrix obtained in S2 using the SAFD-based image decomposition method in S3 includes:
[0028] S31, specifying the decomposition times max_level, the amplitude dictionary or the dictionary maximum value M, and the phase dictionary or the dictionary maximum value L, and applying the SAFD-based method to decompose the processing matrix;
[0029] S32. Obtain decomposition results: correlation coefficient coef (two-dimensional complex number), common atom an, phase t of G, and number of columns K. Correlation coefficient coef is a complex matrix of P×(max_level+1), common atom an is a complex vector of 1×max_level, number of columns K is equal to block_h×block_w, and phase t is equal to 2kΠ / K.
[0030] The real and imaginary parts of the correlation coefficient and the common atom are split into two real number matrices, and then merged row by row to obtain the correlation coefficient coef of (h_num×w_num)×2(max_level+1) and the common atom an of 1×2max_level.
[0031] Furthermore, the step of reshaping the correlation coefficient obtained in S3 into an approximate square matrix and quantifying the obtained correlation coefficient and the common atoms obtained in S3 in S4 includes:
[0032] S41. Reshape the correlation coefficient coef into an approximate square matrix. First, multiply the h_num and w_num, then divide by the number of channels C, and finally multiply by 2 to the power of (max_level+1) to obtain S'; then calculate the integer m so that it satisfies the maximum factor of (S' / C) that is not greater than the square root of (S' / C), and finally obtain an approximate matrix of size (mC)×(S' / (mC)).
[0033] S42. Quantize the correlation coefficient and common atoms. First, linearly map an from (-1, 1) to [0, 255]. Then, perform precision processing on the maximum value of the correlation coefficient (retain two decimal places and enlarge and round). Finally, quantize the correlation coefficient coef to [0, 255] using a linear normalization formula, where the denominator is the maximum value difference (max_coef - min_coef) and the numerator is the offset between x and the minimum value, to obtain the quantized common atom an_q and the quantized correlation coefficient coef_q.
[0034] Furthermore, the step of verifying the key length in S5, encrypting the correlation coefficient using an image encryption method based on 1D-Logistic mapping, and outputting the final ciphertext image includes:
[0035] S51. Verify the length of the key, remove any excess and fill in any shortfall. If the key length is less than 13, extract a number of integers from the public atom an in sequence to complete the key.
[0036] S52. Use the key Key to generate initial chaotic values x and y, initial obfuscation parameter values c10 and c20, and initial obfuscation value c'0. Then, use the initial obfuscation parameter values to generate obfuscation parameters c1 and c2. The obfuscation parameters and initial obfuscation values are used to obfuscate the image pixel values. The following describes the single-round encryption process, where one pixel is scrambled in each round.
[0037] First, multiply x by 10000, then take the product modulo 256, and then round the remainder to get x'. Perform the same process on y to get y'. Set the iterative exit conditions of the chaotic values x and y to be less than or equal to 0.2 or greater than or equal to 0.8, and finally obtain two quantized integer values x' and y'.
[0038] After quantization, the confusion parameters c1 and c2 are calculated as shown below:
[0039]
[0040] Then the pixel value c t Perform confusion scrambling to obtain c'0 confusion initial value, c t and c' t The pixel value of the t-th pixel before and after encryption, c't-1 The encrypted value of the previous pixel is as follows:
[0041] c′ t =((k4+c1)⊕(k5+c2)⊕(k6+c t )⊕(k7+c′ t-1 ))mod256,t∈N * ,
[0042] Finally, according to the following two equations, the chaotic initial values x, y and the key Key are updated respectively, and then the next round of encryption or the last round ends.
[0043]
[0044] Here, {n} is defined as (n-[n]), ensuring that x and y are between (0,1).
[0045]
[0046] At this point, image encryption is completed.
[0047] Furthermore, the step of checking the key length in S6 and decrypting the correlation coefficient based on the Logistic mapping includes:
[0048] S61, verify the key length, consistent with step S51;
[0049] S62: Perform a decryption process. The parameters involved are consistent with the encryption process in terms of definition and value, with the only difference being the pixel value obfuscation step.
[0050] The decrypted pixel value obfuscation is performed by inversely converting the formula of the encryption process, and substituting n=256 to obtain the decrypted pixel value.
[0051] Furthermore, the step of dequantizing the correlation coefficient and the common atoms in S7 and further obtaining the restored correlation coefficient includes:
[0052] S71. First, process the common atom an_q. Divide the quantized common atom value by 128 and then subtract 1 to obtain the original common atom an. Next, process the quantized correlation coefficient coef_q. First, subtract the minimum correlation coefficient value from the maximum correlation coefficient value after quantization to obtain the difference. Then, multiply the quantized correlation coefficient value by this difference and divide the result by 255. Finally, add the minimum correlation coefficient value after quantization to obtain the original correlation coefficient coef.
[0053] S72. The correlation coefficient can be restored according to the number of decompositions in step S31, without retaining the integer m in step S41.
[0054] Furthermore, the step of restoring the decomposition result based on SAFD to obtain a reconstructed matrix in S8 includes:
[0055] The common atom an and the imaginary part of the correlation coefficient coef are restored, and the original image is reconstructed using the correlation coefficient coef, the common atom an, the number of columns K, and the number of decompositions max_level.
[0056] Furthermore, the steps of splicing, reconstructing, and de-filling the matrix to obtain the restored original image in S9 include:
[0057] S91, using any block coefficient block_h or block_w in step S22, and any one of h_num and w_num in step S22, to sequentially stitch together a restoration matrix;
[0058] S92, converting the two-dimensional matrix obtained in step S91 into a reconstructed multi-channel image;
[0059] S93 , using the number of filled rows dh in step S1 and the number of columns W of the input image, de-fill the image obtained in step S92 to restore the original image.
[0060] At this point, the image decryption is completed.
[0061] Further,
[0062] The key of the image adaptive encryption and decryption method based on chaotic sequence includes 8 parameters: chaotic encryption key Key, public atom an, block row number block_h, block column number block_w, filling row number dh, original image column number W, maximum correlation coefficient max_coef and minimum correlation coefficient min_coef.
[0063] The image adaptive encryption and decryption method based on chaotic sequences proposed in this paper first decomposes the input image into two main decomposition components: the common atom an and the correlation coefficient coef using the SAFD method. After quantization, the common atom an becomes part of the decryption key, while the correlation coefficient coef is chaotically encrypted by an image encryption algorithm based on 1D-Logistic mapping, utilizing the advantages of chaos theory to disrupt its data value, further increasing the difficulty of reverse analysis.
[0064] The decryption key consists of three components: a decomposition parameter, a chaotic encryption key, and a public atom. The key length is at least 124 bits, and the key space is sufficiently large. Furthermore, the introduction of public atoms into the key allows the key to adaptively change with the input image, enhancing resistance to known-plaintext and chosen-plaintext attacks. Ultimately, the algorithm described in this invention combines the advantages of both methods, achieving integrated compression and encryption while also achieving higher security.
[0065] (3) Beneficial effects
[0066] The present invention proposes an image adaptive encryption and decryption method based on chaotic sequence, which has the following beneficial effects:
[0067] (1) Break the limitation of fixed basis functions of traditional frequency domain technology and realize the transformation from frequency domain method based on fixed basis functions to adaptive learning frequency domain method.
[0068] (2) Associate the plaintext image with the key and combine the advantages of chaos to improve the quality and security of image encryption.
[0069] (3) The number of decompositions max_level controls the size of the image decomposition output components. By appropriately reducing the number of decompositions, the size of the decomposition components an and coef can be reduced while improving decomposition efficiency, reducing the amount of data and thus achieving image (size) compression.
[0070] (4) The same encryption parameters will produce different decryption keys when encrypting different images; and different decomposition parameters will produce different decomposition results for the same image, which improves the security of encryption. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a flow chart of an image adaptive encryption and decryption method based on chaotic sequence of the present invention;
[0072] Figure 2 This is a schematic diagram of image filling proposed by the present invention;
[0073] Figure 3 This is a schematic diagram of image segmentation proposed by the present invention;
[0074] Figure 4 A comparison diagram of the original image, encrypted image, and decrypted image in an embodiment of the present invention; DETAILED DESCRIPTION
[0075] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below with reference to the accompanying drawings and examples.
[0076] Figure 1This is a flow chart of an image adaptive encryption and decryption method based on chaotic sequence of the present invention. Figure 1 As shown, the present invention provides an image adaptive encryption and decryption method based on chaotic sequence, comprising the following steps:
[0077] Step S1: Obtain the original image and fill the original image.
[0078] like Figure 2 As shown, the original H×W×C multi-channel image is filled with all zeros, the number of rows H is padded to H+dh, the number of columns W is padded to W+dw, and a padded image of (H+dh)×(W+dw)×C is output.
[0079] Step S2: Reduce the dimension of the image filled in S1 to a two-dimensional matrix, divide it into blocks, and expand it into one-dimensional vectors and arrange them in rows to obtain a processing matrix.
[0080] The S2 specifically includes the following steps:
[0081] S21, stitching the multi-channel images in the longitudinal direction according to the channels, and converting the obtained (H+dh)×(W+dw)×C image into a two-dimensional matrix of ((H+dh)C)×(W+dw);
[0082] S22, such as Figure 3 As shown, according to the specified block coefficients block_h and block_w, the two-dimensional matrix is divided into (h_num×w_num) block matrices of size (block_h×block_w).
[0083] S23. Expand the block matrix into a one-dimensional vector and arrange it in rows in sequence to form a processing matrix with the number of rows being the number of blocks (h_num×w_num) and the number of columns being the block size (block_h×block_w).
[0084] Step S3: Decompose the matrix obtained in S2 using an image decomposition method based on SAFD.
[0085] The S3 specifically includes the following steps:
[0086] S31, specifying the decomposition times max_level, the amplitude dictionary or the dictionary maximum value M, and the phase dictionary or the dictionary maximum value L, and applying the SAFD-based method to decompose the processing matrix;
[0087] S32. Obtain decomposition results: correlation coefficient coef (two-dimensional complex number), common atom an, phase t of G, and number of columns K. Wherein, correlation coefficient coef is a complex matrix of P×(max_level+1), common atom an is a complex vector of 1×max_level, number of columns K is equal to block_h×block_w, and phase t is equal to 2kΠ / K. Then, the real and imaginary parts of the correlation coefficient and common atom are split into two real number matrices, and then merged by row to obtain correlation coefficient coef of (h_num×w_num)×2(max_level+1) and common atom an of 1×2max_level.
[0088] Step S4: reshape the correlation coefficient obtained in S3 into an approximate square matrix, and quantify the obtained correlation coefficient and the common atoms obtained in S3.
[0089] The step S4 specifically includes the following steps:
[0090] S41. Rearrange the correlation coefficient coef into an approximate square matrix, calculate an integer m so that it satisfies the maximum factor of (S' / C) that is not greater than the square root of (S' / C), and obtain an approximate square matrix.
[0091] S42 quantizes the correlation coefficient and common atoms. First, linearly map an from (-1, 1) to [0, 255]. Then, perform precision processing on the maximum value of the correlation coefficient (retain two decimal places and enlarge and round). Finally, quantize the correlation coefficient coef to [0, 255] using a linear normalization formula, where the denominator is the maximum value difference (max_coef - min_coef) and the numerator is the offset between x and the minimum value, to obtain the quantized common atom an_q and the quantized correlation coefficient coef_q.
[0092] Step S5: Check the key length, encrypt the correlation coefficient using an image encryption method based on 1D-Logistic mapping, and output the final ciphertext image.
[0093] The step of S5 specifically includes:
[0094] S51. Verify the length of the key, remove any excess and fill in any shortfall. If the key length is less than 13, extract a number of integers from the public atom an in sequence to complete the key.
[0095] S52. Use the key Key to generate initial chaotic values x and y, initial obfuscation parameter values c10 and c20, and initial obfuscation value c'0. Then, use the initial obfuscation parameter values to generate obfuscation parameters c1 and c2. The obfuscation parameters and initial obfuscation values are used to obfuscate the image pixel values. The following describes the single-round encryption process, where one pixel is scrambled in each round.
[0096] First, multiply x by 10000, then take the product modulo 256, and then round the remainder to get x'. Perform the same process on y to get y'. Set the iterative exit conditions of the chaotic values x and y to be less than or equal to 0.2 or greater than or equal to 0.8, and finally obtain two quantized integer values x' and y'.
[0097] After quantization, the confusion parameters c1 and c2 are calculated as shown below:
[0098]
[0099] Then the pixel value c t Perform confusion scrambling to obtain c'0 confusion initial value, c t and c' t The pixel value of the t-th pixel before and after encryption, c' t-1 The encrypted value of the previous pixel is as follows:
[0100] c′ t =((k4+c1)⊕(k5+c2)⊕(k6+c t )⊕(k7+c′ t-1 ))mod256,t∈N *
[0101] Finally, according to the following two equations, the chaotic initial values x, y and the key Key are updated respectively, and then the next round of encryption or the last round ends.
[0102]
[0103] Here, {n} is defined as (n-[n]), ensuring that x and y are between (0,1).
[0104]
[0105] At this point, image encryption is completed.
[0106] Step S6: Check the key length and decrypt the correlation coefficient based on the Logistic mapping.
[0107] S61, verify the key length, consistent with step S51;
[0108] S62: Perform a decryption process. The parameters involved are consistent with the encryption process in terms of definition and value, with the only difference being the pixel value obfuscation step.
[0109] The decrypted pixel value obfuscation is performed by inversely converting the formula of the encryption process, and substituting n=256 to obtain the decrypted pixel value.
[0110] Step S7: Dequantize the correlation coefficient and the common atoms, and further obtain the restored correlation coefficient.
[0111] The corresponding step S7 specifically includes:
[0112] S71. First, process the common atom an_q. Divide the quantized common atom value by 128 and then subtract 1 to obtain the original common atom an. Next, process the quantized correlation coefficient coef_q. First, subtract the minimum correlation coefficient value from the maximum quantized correlation coefficient value to obtain the difference. Then, multiply the quantized correlation coefficient value by this difference and divide it by 255. Finally, add the minimum quantized correlation coefficient value to obtain the original correlation coefficient coef. S72. Restore the correlation coefficient based on the number of decompositions in step S31.
[0113] Step S8: Restore the decomposition result based on SAFD to obtain a reconstructed matrix.
[0114] The common atom an and the imaginary part of the correlation coefficient coef are restored, and the original image is reconstructed using the correlation coefficient coef, the common atom an, the number of columns K, and the number of decompositions max_level.
[0115] Step S9: splicing, reconstructing, and de-filling the matrix to obtain the restored original image.
[0116] The step S9 specifically includes:
[0117] S91, using any block coefficient block_h or block_w in step S22, and any one of h_num and w_num in step S22, to sequentially stitch together the restoration matrix;
[0118] S92, converting the two-dimensional matrix obtained in step S91 into a reconstructed multi-channel image;
[0119] S93. Use the number of padded rows dh in step S1 and the number of columns W of the input image to de-padded the image obtained in step S92 to restore the original image.
[0120] At this point, the image decryption is completed.
[0121] The key of the image adaptive encryption and decryption method based on chaotic sequence includes 8 parameters: chaotic encryption key Key, public atom an, block row number block_h, block column number block_w, filling row number dh, original image column number W, maximum correlation coefficient max_coef and minimum correlation coefficient min_coef.
[0122] like Figure 4 As shown, the results of the comparative analysis of the embodiment are as follows:
[0123] In terms of efficiency, the algorithm proposed in the present invention relies on efficient image decomposition and a relatively efficient chaotic encryption algorithm, and has high execution efficiency.
[0124] In terms of compression, SAFD-based image sparse decomposition eliminates some redundant data of the original image, and the compression rate of the ciphertext image can be easily manipulated by adjusting the decomposition level.
[0125] In terms of image reconstruction quality, although quantization inevitably brings a certain amount of quality loss, the overall similarity is relatively high, and the evaluation results of the PSNR and MSSSIM indicators are both good.
[0126] In terms of security, tests of entropy and correlation between adjacent pixels show that the ciphertext images generated by the proposed image encryption algorithm exhibit good uncertainty and low correlation. The grayscale histogram exhibits uniform and consistent characteristics due to the participation of a chaotic system. The introduction of the SAFD method improves the compression rate of ciphertext images while using the common atoms of one of the plaintext image decomposition components as a partial key. This significantly expands the key space and strengthens the connection between the key and the plaintext image, enhancing resistance to brute force, known plaintext, and chosen-plaintext attacks.
[0127] While the above description has been made with reference to the accompanying drawings, it should be understood that the above is merely one embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Persons skilled in the art will recognize that any changes, modifications, substitutions, and variations of the above embodiment are within the scope of protection of the present invention.
Claims
1. A new image adaptive encryption and decryption method based on chaotic sequence, the method comprising the following steps: S1. Obtain the original image and fill it; S2, reducing the dimension of the image filled in S1 to a two-dimensional matrix, dividing it into blocks, and expanding it into one-dimensional vectors and arranging them row by row to obtain a processing matrix; S3, decomposing the processing matrix obtained in S2 using a SAFD-based image decomposition method to obtain decomposition results: correlation coefficient, common atoms, and number of columns; S4. Reorganizing the correlation coefficient obtained in S3 into an approximate square matrix, and quantifying the reorganized correlation coefficient and the common atoms obtained in S3; S5. Check the key length, encrypt the correlation coefficient using an image encryption method based on 1D-Logistic mapping, and output the final ciphertext image; S6. Check the key length and decrypt the correlation coefficient based on 1D-Logistic mapping; S7, dequantizing the correlation coefficient and the common atoms, and further obtaining the restored correlation coefficient; S8. Restore the decomposition result based on SAFD to obtain the reconstructed matrix; S9. Splice, reconstruct, and de-fill the matrix to obtain the restored original image.
2. The image adaptive encryption and decryption method based on chaotic sequence according to claim 1 is characterized in that: The steps of S1 include: The original image is obtained and padded with all zeros to ensure that its size is divisible by the subsequent block parameters. For the H×W×C multi-channel image, the size of the padded image is (H+dh)×(W+dw)×C.
3. The image adaptive encryption and decryption method based on chaotic sequence according to claim 2 is characterized in that: The steps of S2 include: S21, stitching the multi-channel images in the longitudinal direction according to the channels, and converting the obtained (H+dh)×(W+dw)×C image into a two-dimensional matrix of ((H+dh)C)×(W+dw); S22. Divide the two-dimensional matrix into (h_num×w_num) block matrices of size (block_h×block_w) according to the specified block coefficients block_h and block_w. S23. Expand the block matrix into a one-dimensional vector and arrange it in rows in sequence to form a processing matrix with the number of rows being the number of blocks (h_num×w_num) and the number of columns being the block size (block_h×block_w).
4. The image adaptive encryption and decryption method based on chaotic sequence according to claim 3 is characterized in that: The steps of S3 include: S31, specifying the decomposition times max_level, the amplitude dictionary or the dictionary maximum value M, and the phase dictionary or the dictionary maximum value L, and applying the SAFD-based method to decompose the processing matrix; S32. Obtain decomposition results, including the correlation coefficient coef, the common atom an, the phase t of G, and the number of columns K. The correlation coefficient coef is a complex matrix of P×(max_level+1), the common atom an is a complex vector of 1×max_level, the number of columns K is equal to block_h×block_w, and the phase t is equal to 2kΠ / K.
5. The image adaptive encryption and decryption method based on chaotic sequence according to claim 4 is characterized in that: The steps of S4 include: S41. Reshape the correlation coefficient coef into an approximate square matrix. First, multiply the h_num and w_num, then divide by the number of channels C, and finally multiply by 2 to the power of (max_level+1) to obtain S'; then calculate the integer m so that it satisfies the maximum factor of (S' / C) that is not greater than the square root of (S' / C), and finally obtain an approximate square matrix of size (mC)×(S' / (mC)). S42. Quantize the correlation coefficient and common atoms. First, linearly map an from (-1, 1) to [0, 255]. Then, perform precision processing on the maximum value of the correlation coefficient (retain two decimal places and enlarge and round). Finally, quantize the correlation coefficient coef to [0, 255] using a linear normalization formula, where the denominator is the maximum value difference (max_coef - min_coef) and the numerator is the offset between x and the minimum value, to obtain the quantized common atom an_q and the quantized correlation coefficient coef_q.
6. The image adaptive encryption and decryption method based on chaotic sequence according to claim 5 is characterized in that: The steps of S5 include: S51. Verify the length of the key, remove any excess and fill in any shortfall. If the key length is less than 13, extract a number of integers from the public atom an in sequence to complete the key. S52 uses the key Key to generate initial chaotic values x and y, initial obfuscation parameter values c10 and c20, and initial obfuscation value c'0. The initial obfuscation parameter values are then used to generate obfuscation parameters c1 and c2. The obfuscation parameters and initial obfuscation values are then used to obfuscate the image pixel values. The following describes the single-round encryption process, where one pixel is scrambled in each round. First, multiply x by 10000, then take the product modulo 256, and then round the remainder to get x'. Perform the same process on y to get y'. Set the iterative exit conditions of the chaotic values x and y to be less than or equal to 0.2 or greater than or equal to 0.8, and finally obtain two quantized integer values x' and y'. After quantization, the confusion parameters c1 and c2 are calculated as shown below: Then the pixel value c t Perform confusion scrambling to obtain c'0 confusion initial value, c t and c' t The pixel value of the t-th pixel before and after encryption, c' t-1 The encrypted value of the previous pixel is as follows: Finally, the chaotic initial values x, y and the key Key are updated according to the following two equations, and then the next round of encryption or the last round ends. Here, {n} is defined as (n-[n]), ensuring that x and y are between (0,1).
7. The image adaptive encryption and decryption method based on chaotic sequence according to claim 6 is characterized in that: The steps of S6 include: S61, verify the key length, consistent with step S51; S62: Perform a decryption process. The parameters involved are consistent with the encryption process in terms of definition and value, with the only difference being the pixel value obfuscation step. The decrypted pixel value obfuscation is performed by inversely converting the formula of the encryption process, and substituting n=256 to obtain the decrypted pixel value.
8. The image adaptive encryption and decryption method based on chaotic sequence according to claim 7 is characterized in that: The steps of S7 include: S71. First, process the common atom an_q. Divide the quantized common atom value by 128 and then subtract 1 to obtain the original common atom an. Next, process the quantized correlation coefficient coef_q. First, subtract the minimum correlation coefficient value from the maximum correlation coefficient value after quantization to obtain the difference. Then, multiply the quantized correlation coefficient value by this difference and divide the result by 255. Finally, add the minimum correlation coefficient value after quantization to obtain the original correlation coefficient coef. S72. Restore the correlation coefficient according to the number of decompositions in S31, without retaining the integer m in step S41.
9. The image adaptive encryption and decryption method based on chaotic sequence according to claim 8, characterized in that: The step of S8 includes: The original image is reconstructed according to the correlation coefficient coef, the common atom an, the number of columns K and the number of decompositions max_level obtained by the decryption.
10. The image adaptive encryption and decryption method based on chaotic sequence according to claim 9, characterized in that: The steps of S9 include: S91, using any block coefficient block_h or block_w in step S22, and any one of h_num and w_num in step S22, to sequentially stitch together a restoration matrix; S92, converting the two-dimensional matrix obtained in step S91 into a reconstructed multi-channel image; S93 , using the number of filled rows dh in step S1 and the number of columns W of the input image, de-fill the image obtained in step S92 to restore the original image.
11. The image adaptive encryption and decryption method based on chaotic sequence according to claim 9, characterized in that: The key of the image adaptive encryption and decryption method based on chaotic sequence includes 8 parameters: chaotic encryption key Key, public atom an, block row number block_h, block column number block_w, filling row number dh, original image column number W, maximum correlation coefficient max_coef and minimum correlation coefficient min_coef.