Image encryption processing method and device

CN116305211BActive Publication Date: 2026-09-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310280643.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2026-09-22
Estimated Expiration
2043-03-21

AI Technical Summary

Technical Problem

[0003]由于数字图像存在如数据量大、二维空间分布不均匀和原始图像数据存在大量冗余等问题,使得传统的通用加密算法并不是非常适合数字图像加密

Benefits of technology

[0041]本发明实施例提供的图像加密处理方法及装置,对待加密图像进行切分,得到各图像块,根据所述待加密图像的图像大小确定第一混沌映射形式的迭代次数,并根据第一混沌映射参数和所述迭代次数生成第一混沌序列;计算所述待加密图像的散列值,并对所述散列值进行等分,得到与图像块数量相等的片段,根据各个片段和所述图像大小确定所述第一混沌序列的混沌数,根据各混沌数确定与各图像块分别对应的猫脸变换的变换次数,根据各变换次数分别对各图像块进行猫脸变换,得到分块变换置乱后的加密矩阵;根据第二混沌映射形式的第二混沌映射参数和所述迭代次数生成第二混沌序列,根据所述第二混沌序列和所述分块变换置乱后的加密矩阵,得到分块交换和混沌映射混合加密后的加密图像,保证了加密图像的安全性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116305211B_ABST
    Figure CN116305211B_ABST
Patent Text Reader

Abstract

The application provides an image encryption processing method and device, relates to the technical field of information security, and can be applied to the financial field or other technical fields.The method comprises the following steps: determining the iteration number of a first chaotic mapping form according to the image size of an image to be encrypted, and generating a first chaotic sequence; calculating the hash value of the image to be encrypted, equally dividing the hash value, obtaining a segment equal to the number of image blocks, determining chaotic numbers of the first chaotic sequence according to each segment and the image size, determining the transformation number of cat face transformation corresponding to each image block according to each chaotic number, respectively performing cat face transformation on each image block according to each transformation number, and obtaining an encrypted matrix after block transformation and disordering; generating a second chaotic sequence, and obtaining an encrypted image according to the second chaotic sequence and the encrypted matrix after block transformation and disordering.The device executes the above method.The method and device provided in the application embodiment guarantee the security of the encrypted image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, specifically to an image encryption processing method and apparatus. Background Technology

[0002] Image recognition is widely used in various banking business scenarios, such as facial recognition, fingerprint recognition, and recognition of personal ID information. With the rapid development of network and multimedia technologies, digital images, as one of the most important information carriers, are increasingly in demand, especially in the commercial and financial sectors. Therefore, research on the security of digital images has received widespread attention.

[0003] Due to problems such as large data volume, uneven distribution in two-dimensional space, and a large amount of redundancy in the original image data, traditional general encryption algorithms are not very suitable for digital image encryption. Summary of the Invention

[0004] To address the problems in the prior art, embodiments of the present invention provide an image encryption processing method and apparatus, which can at least partially solve the problems existing in the prior art.

[0005] On one hand, the present invention proposes an image encryption processing method, comprising:

[0006] The image to be encrypted is segmented to obtain image blocks. The number of iterations for the first chaotic mapping form is determined based on the image size of the image to be encrypted. A first chaotic sequence is generated based on the first chaotic mapping parameters and the number of iterations.

[0007] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block based on each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0008] A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image after block exchange and chaotic mapping hybrid encryption is obtained.

[0009] The step of determining the number of chaotic segments in the first chaotic sequence based on each segment and the image size includes:

[0010] The data of each segment is converted to obtain a decimal number;

[0011] Based on the image size, perform modulo operations on each decimal number to obtain the chaos number of the first chaotic sequence.

[0012] The step of determining the number of transformations corresponding to each image block based on each chaos number includes:

[0013] Each chaotic number is rounded down to obtain an integer value corresponding to each chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch.

[0014] The step of obtaining the encrypted image after hybrid encryption of block swapping and chaotic mapping based on the second chaotic sequence and the scrambled encryption matrix of the block transformation includes:

[0015] The encryption matrix after block transformation and scrambling is reconstructed to obtain a reconstructed matrix; each element of the second chaotic sequence is placed into an array, and each element in the array is normalized to obtain a normalized array;

[0016] Perform a bitwise XOR operation on the normalized array and the reconstructed matrix to obtain the encrypted matrix after chaotic mapping scrambling;

[0017] The encrypted matrix after scrambling the chaotic mapping is rearranged, and the rearranged matrix is ​​used as the encrypted image after block swapping and chaotic mapping are mixed encryption.

[0018] The step of rounding each chaotic number to obtain the corresponding integer value includes:

[0019] The parameters of the remainder function are determined based on the control factor, and the integer values ​​corresponding to each chaotic number are calculated based on the remainder function after the parameters are determined.

[0020] The image encryption processing method further includes:

[0021] Obtain scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the first chaotic mapping parameters, and the second chaotic mapping parameters;

[0022] The scrambling parameters are used as plaintext, and the plaintext is encrypted with a public key to obtain ciphertext.

[0023] The image encryption method further includes the following steps after encrypting the plaintext with a public key to obtain ciphertext:

[0024] The ciphertext is decrypted using the private key to obtain the scrambling parameters;

[0025] The encrypted image is restored using the scrambling parameters to obtain the original image to be encrypted.

[0026] On one hand, the present invention proposes an image encryption processing device, comprising:

[0027] The generation unit is used to segment the image to be encrypted to obtain image blocks, determine the number of iterations of the first chaotic mapping form according to the image size of the image to be encrypted, and generate a first chaotic sequence according to the first chaotic mapping parameters and the number of iterations.

[0028] The transformation unit is used to calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. The chaos number of the first chaotic sequence is determined according to each segment and the image size. The number of transformations of the cat face transformation corresponding to each image block is determined according to each chaos number. The cat face transformation is performed on each image block according to each number of transformations to obtain the encryption matrix after block transformation and scrambling.

[0029] An encryption unit is used to generate a second chaotic sequence based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations, and to obtain an encrypted image after block exchange and chaotic mapping hybrid encryption based on the second chaotic sequence and the encryption matrix after block transformation scrambling.

[0030] In another aspect, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a bus, wherein,

[0031] The processor and the memory communicate with each other via the bus;

[0032] The memory stores program instructions that can be executed by the processor, and the processor can execute the following methods by calling the program instructions:

[0033] The image to be encrypted is segmented to obtain image blocks. The number of iterations for the first chaotic mapping form is determined based on the image size of the image to be encrypted. A first chaotic sequence is generated based on the first chaotic mapping parameters and the number of iterations.

[0034] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block based on each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0035] A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image after block exchange and chaotic mapping hybrid encryption is obtained.

[0036] This invention provides a non-transitory computer-readable storage medium, comprising:

[0037] The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the following methods:

[0038] The image to be encrypted is segmented to obtain image blocks. The number of iterations for the first chaotic mapping form is determined based on the image size of the image to be encrypted. A first chaotic sequence is generated based on the first chaotic mapping parameters and the number of iterations.

[0039] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block based on each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0040] A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image after block exchange and chaotic mapping hybrid encryption is obtained.

[0041] The image encryption processing method and apparatus provided in this invention segment the image to be encrypted to obtain image blocks. The iteration number of a first chaotic mapping form is determined based on the image size of the image to be encrypted, and a first chaotic sequence is generated based on the first chaotic mapping parameters and the iteration number. The hash value of the image to be encrypted is calculated, and the hash value is divided equally to obtain segments equal to the number of image blocks. The chaos number of the first chaotic sequence is determined based on each segment and the image size. The transformation number of the cat-face transformation corresponding to each image block is determined based on each chaos number. The cat-face transformation is performed on each image block according to each transformation number to obtain an encryption matrix after block transformation scrambling. A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the iteration number. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image obtained by a combination of block swapping and chaotic mapping encryption is obtained, ensuring the security of the encrypted image. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0043] Figure 1 This is a schematic flowchart of an image encryption processing method provided in an embodiment of the present invention.

[0044] Figure 2 This is a flowchart illustrating an image encryption processing method provided in another embodiment of the present invention.

[0045] Figure 3 This is a schematic diagram of the structure of an image encryption processing device provided in an embodiment of the present invention.

[0046] Figure 4 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments and descriptions of the present invention are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other.

[0048] Figure 1 This is a flowchart illustrating an image encryption processing method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the image encryption processing method provided in this embodiment of the invention includes:

[0049] Step S1: Divide the image to be encrypted into image blocks, determine the number of iterations for the first chaotic mapping form based on the image size of the image to be encrypted, and generate a first chaotic sequence based on the first chaotic mapping parameters and the number of iterations.

[0050] Step S2: Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block according to each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0051] Step S3: Generate a second chaotic sequence based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, obtain the encrypted image after block exchange and chaotic mapping hybrid encryption.

[0052] In step S1 above, the device segments the image to be encrypted into image blocks, determines the number of iterations for the first chaotic mapping form based on the image size of the image to be encrypted, and generates a first chaotic sequence based on the first chaotic mapping parameters and the number of iterations. The device can be a computer device executing this method, such as a server. It should be noted that the data acquisition and analysis involved in this embodiment of the invention are authorized by the user. The image to be encrypted can further be a grayscale image to be encrypted.

[0053] The image to be encrypted can be represented by a matrix, denoted as an N×N two-dimensional matrix A (where N is the image size). The elements in the matrix represent pixel grayscale values, and the positions of the matrix elements represent pixel positions.

[0054] If the number of rows and columns of a matrix are different, the matrix can be augmented to obtain a matrix with the same number of rows and columns. For example... Figure 2 As shown, this two-dimensional matrix A corresponds to Figure 2 The grayscale image A to be encrypted.

[0055] like Figure 2 As shown, the number of image blocks in each image block obtained after segmentation is denoted as l.

[0056] If the image size is N, then the number of iterations for the first chaotic mapping form is N×N.

[0057] The first chaotic mapping can be specifically a Sine chaotic mapping, and the parameters of the first chaotic mapping may include a given initial value X(0) and a system parameter α; correspondingly, a first chaotic sequence is generated according to the first chaotic mapping parameters and the number of iterations, including:

[0058] For a given initial value X(0) and system parameter α, perform N×N iterations on the Sine chaotic map to generate a dataset of size 1×N. 2 The first chaotic sequence, which is a one-dimensional chaotic sequence, can be represented as:

[0059]

[0060] In step S2 above, the device calculates the hash value of the image to be encrypted, divides the hash value into equal parts to obtain segments equal to the number of image blocks, determines the chaos number of the first chaotic sequence based on each segment and the image size, determines the number of cat face transformations corresponding to each image block based on each chaos number, and performs cat face transformations on each image block according to each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0061] Furthermore, the hash value of the grayscale image to be encrypted can be calculated using the Secure Hash Algorithm-512 (SHA-512), and the result is a 512-bit binary number.

[0062] Determining the number of chaotic segments in the first chaotic sequence based on each segment and the image size includes:

[0063] The data of each segment is converted to obtain a decimal number;

[0064] Based on the image size, perform modulo operations on each decimal number to obtain the chaos number of the first chaotic sequence.

[0065] The hash value can be divided into l segments, with any remaining digits padded with zeros, and each segment converted to a decimal number M = (M1, M2, ..., Mn). l ).

[0066] Using the above decimal numbers as the number of digits, select the chaotic number from the first chaotic sequence K to obtain... M j =mod(M j N 2 And j = 1, 2, ..., l.

[0067] The step of determining the number of transformations corresponding to each image patch based on each chaos number includes:

[0068] Each chaotic number is rounded down to obtain an integer value corresponding to each chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch.

[0069] The step of rounding each chaotic number to obtain the corresponding integer value includes:

[0070] The parameters of the remainder function are determined based on the control factor, and the integer values ​​corresponding to each chaotic number are calculated based on the remainder function after the parameters are determined.

[0071] For the above chaotic numbers Rounding down, we get And j = 1, 2, ..., l, where β is the control factor.

[0072] Cat face transformation is performed on each image block according to each transformation number, resulting in an encryption matrix after block transformation and scrambling, including:

[0073] Let k1, k2, ..., k l The number of transformations for each image block is taken as the number of transformations to perform the cat face transformation. The cat face transformation is then performed on each image block to obtain the encryption matrix B after block transformation and scrambling. The cat face transformation is the Arnold transformation.

[0074] In step S3 above, the device generates a second chaotic sequence based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, it obtains an encrypted image after block swapping and chaotic mapping hybrid encryption. The second chaotic mapping can be a Logistic chaotic mapping, and the second chaotic mapping parameters can include a given initial value Y(0) and system parameters μ. For the Logistic chaotic mapping with the given initial value and Y(0) and system parameters μ, N×N iterations are performed to generate a 1×N... 2 The second chaotic sequence, specifically a one-dimensional chaotic sequence.

[0075] The step of obtaining the encrypted image after hybrid encryption of block swapping and chaotic mapping based on the second chaotic sequence and the scrambled encryption matrix after block transformation includes:

[0076] The scrambled encryption matrix after the block transformation is reconstructed to obtain a reconstructed matrix; the elements of the second chaotic sequence are placed into an array, and the elements in the array are normalized to obtain a normalized array; the encryption matrix B can be reconstructed by rearranging its elements into a 1×N matrix according to the column order of the matrix. 2 The matrix C. The elements of the second chaotic sequence are sequentially placed into the array x(i) (i = 1, 2, ..., N). 2 In the array x(i), the elements of the array x(i) are normalized to obtain the normalized array x'(i), so that all its elements are in the range [0,255].

[0077] Perform a bitwise XOR operation on the normalized array and the reconstructed matrix to obtain the encrypted matrix after chaotic mapping scrambling; perform a bitwise XOR operation on the normalized array x'(i) and the reconstructed matrix C to obtain the encrypted matrix D after chaotic mapping scrambling, which has a size of 1×N. 2 .

[0078] The scrambled encryption matrix obtained by the chaotic mapping is rearranged, and the rearranged matrix is ​​used as the encrypted image after block swapping and chaotic mapping hybrid encryption. (The last part, "1×N," appears to be an unrelated fragment and is omitted from the translation.) 2 The encryption matrix D is rearranged into a matrix E of size N×N. This matrix E is the image obtained by combining block swapping and chaotic mapping to encrypt the two-dimensional matrix A of the image to be encrypted.

[0079] The image encryption processing method further includes:

[0080] Obtain the scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the first chaotic mapping parameters, and the second chaotic mapping parameters; the cat face transformation parameters may specifically include a and b, which will be explained in detail in the subsequent Arnold block transformation operation. Other parameters can be referred to the above description and will not be repeated here.

[0081] The scrambling parameters are used as plaintext, and the plaintext is encrypted using a public key to obtain ciphertext. Using the scrambling parameters (l, β, a, b, X(0), α, Y(0), μ) = P as plaintext, the plaintext can be encrypted using the RSA encryption algorithm with a public key to obtain ciphertext R.

[0082] After the step of encrypting the plaintext with a public key to obtain ciphertext, the image encryption method further includes:

[0083] The ciphertext is decrypted using the private key to obtain the scrambling parameters; the ciphertext R is then decrypted using the private key to obtain the various scrambling parameters P.

[0084] The encrypted image E is restored using the scrambling parameter P to obtain the original image to be encrypted.

[0085] The following is a supplementary explanation of the above Sine chaotic mapping:

[0086] The Sine chaotic map is a one-dimensional chaotic map algorithm, and its formula is as follows:

[0087] X(t+1)=αsin[πX(t)], t=0,1,2,...,n (1)

[0088] Where X(t) is the mapping variable; α is the system parameter.

[0089] The following is an additional explanation of the Arnold block transform:

[0090] Assuming the grayscale image to be encrypted is an N×N two-dimensional matrix A, the Arnold transform formula for a two-dimensional image is as follows:

[0091]

[0092] Where x and y represent the position of a pixel in a grayscale image of size N×N before the transformation; N is the size of the matrix; x' and y' represent the pixel position after the transformation; and a and b are control parameters.

[0093] The inverse Arnold block transform formula is:

[0094]

[0095] Due to the periodicity of the Arnold transform, assuming a period of T, an image scrambled k times will be restored to the original image after being transformed (Tk) times. Furthermore, the period T is positively correlated with the size N of the image matrix. To address this issue, this invention employs a block-based transform strategy, dividing the original image into l blocks and performing the Arnold transform on each sub-block. Since the number of scrambling iterations for each sub-block is k1, k2, ..., k... l Their sizes vary, effectively avoiding the risk that encrypted images can be easily recovered.

[0096] The following is an additional explanation of the Logistic chaotic mapping:

[0097] The Logistic mapping is a one-dimensional chaotic mapping algorithm, and its formula is as follows:

[0098] Y(t+1)=μY(t)[1-Y(t)], t=0,1,2,...,n, μ∈(0,4) (4)

[0099] Where Y(t) is the mapping variable; μ is the system parameter. When 0 < Y(0) < 1 and 3.5699456 < μ < 4 are satisfied, the Logistic function is in a chaotic state, generating an unpredictable and disordered sequence of numbers. For a given initial value Y(0), after N×N iterations, Y(1), Y(2), ..., Y(N) are generated. 2 A set of unordered sequences.

[0100] The specific formula for normalizing array x(i) is as follows:

[0101] x'(i)=mod(256×x(i), 256), (i=1,2,...,N 2 (5)

[0102] The specific formula for the bitwise XOR operation is as follows:

[0103] D(i)=bitxor(x'(i),C(i)), (i=1,2,...,N 2 (6)

[0104] The function `bitxor` performs a bitwise XOR operation on `x'(i)` and `C(i)`, returning `D(i)`. Furthermore, due to the properties of XOR, performing the same XOR operation twice on a given value will restore it to its original value. `C(i)` represents the matrix element `C` mentioned above.

[0105] The image encryption processing method provided in this invention first introduces hash values ​​and Sine chaotic mapping on the basis of traditional block transformation, proposing an unordered block transformation method. Then, the unordered block transformation method is combined with Logistic chaotic mapping to scramble and encrypt the image. This aims to effectively avoid the defect of restoring the original image after multiple transformations by repeatedly scrambling the image through unordered block transformation and chaotic mapping. Finally, to avoid image security risks caused by the leakage of scrambling parameters, RSA encryption is applied to various parameters of the unordered block transformation and Logistic chaotic mapping, effectively improving the security of the encrypted image.

[0106] The image encryption processing method provided in this invention involves segmenting the image to be encrypted into image blocks, determining the number of iterations for a first chaotic mapping form based on the image size of the image to be encrypted, and generating a first chaotic sequence based on the first chaotic mapping parameters and the number of iterations; calculating the hash value of the image to be encrypted and dividing the hash value equally into segments equal to the number of image blocks, determining the chaos number of the first chaotic sequence based on each segment and the image size, determining the number of cat face transformations corresponding to each image block based on each chaos number, performing cat face transformations on each image block based on each number of transformations, and obtaining an encryption matrix after block transformation scrambling; generating a second chaotic sequence based on the second chaotic mapping parameters for a second chaotic mapping form and the number of iterations, and obtaining an encrypted image after block swapping and chaotic mapping hybrid encryption based on the second chaotic sequence and the encryption matrix after block transformation scrambling, thus ensuring the security of the encrypted image.

[0107] Further, determining the number of chaotic segments in the first chaotic sequence based on each segment and the image size includes:

[0108] The data of each segment is converted to obtain a decimal number; the above embodiments can be referred to for explanation, and will not be repeated here.

[0109] Based on the image size, perform modulo operations on each decimal number to obtain the chaos number of the first chaotic sequence. This can be referred to the above embodiment for explanation, and will not be repeated here.

[0110] The image encryption processing method provided in this embodiment of the invention can quickly and conveniently determine the chaos number of the first chaotic sequence.

[0111] Furthermore, determining the number of transformations for the cat face transformation corresponding to each image patch based on each chaos number includes:

[0112] Each chaotic number is rounded down to obtain its corresponding integer value. Each integer value is then used as the number of transformations required for the cat face transformation corresponding to each image patch. This can be referred to the above embodiment for further explanation, and will not be repeated here.

[0113] The image encryption processing method provided in this invention can quickly and conveniently determine the number of transformations of the cat face transformation corresponding to each image block.

[0114] Further, obtaining the encrypted image after hybrid encryption of block swapping and chaotic mapping based on the second chaotic sequence and the scrambled encryption matrix after block transformation includes:

[0115] The encrypted matrix after block transformation and scrambling is reconstructed to obtain a reconstructed matrix; each element of the second chaotic sequence is placed into an array, and each element in the array is normalized to obtain a normalized array; the above embodiments can be referred to for explanation, and will not be repeated here.

[0116] Perform a bitwise XOR operation on the normalized array and the reconstructed matrix to obtain the encrypted matrix after chaotic mapping scrambling; the above embodiments can be referred to for explanation, and will not be repeated here.

[0117] The scrambled encryption matrix obtained by the chaotic mapping is rearranged, and the rearranged matrix is ​​used as the encrypted image after block swapping and chaotic mapping hybrid encryption. This can be referred to the above embodiments for further explanation, and will not be repeated here.

[0118] The image encryption processing method provided in this embodiment of the invention further ensures the security of encrypted images.

[0119] Further, the step of rounding each chaotic number to obtain the corresponding integer value includes:

[0120] The parameters of the modulo function are determined based on the control factor, and the integer values ​​corresponding to each chaotic number are calculated using the modulo function after determining the parameters. This can be referred to the above embodiment for explanation, and will not be repeated here.

[0121] The image encryption processing method provided in this embodiment of the invention can further quickly and conveniently determine the chaos number of the first chaotic sequence.

[0122] Furthermore, the image encryption processing method further includes:

[0123] Obtain the scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the first chaotic mapping parameters, and the second chaotic mapping parameters; the above embodiments can be referred to for explanation, and will not be repeated here.

[0124] The scrambling parameters are used as plaintext, and the plaintext is encrypted using a public key to obtain ciphertext. This can be referred to the above embodiments for further explanation, and will not be repeated here.

[0125] The image encryption processing method provided in this embodiment of the invention further ensures the security of encrypted images.

[0126] Furthermore, after the step of encrypting the plaintext with a public key to obtain ciphertext, the image encryption processing method further includes:

[0127] The ciphertext is decrypted using the private key to obtain the scrambling parameters; this can be referred to the above embodiments for explanation, and will not be repeated here.

[0128] The encrypted image is then restored using the scrambling parameters to obtain the original image to be encrypted. This can be explained with reference to the above embodiments and will not be repeated here.

[0129] The image encryption processing method provided in this embodiment of the invention can restore the image and obtain the original image to be encrypted.

[0130] It should be noted that the image encryption processing method provided in this embodiment of the invention can be used in the financial field, or in any technical field other than the financial field. This embodiment of the invention does not limit the application field of the image encryption processing method.

[0131] Figure 3 This is a schematic diagram of the structure of an image encryption processing device provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the image encryption processing apparatus provided in this embodiment of the invention includes a generation unit 301, a transformation unit 302, and an encryption unit 303, wherein:

[0132] The generation unit 301 is used to segment the image to be encrypted to obtain image blocks, determine the number of iterations of the first chaotic mapping form according to the image size of the image to be encrypted, and generate a first chaotic sequence according to the first chaotic mapping parameters and the number of iterations. The transformation unit 302 is used to calculate the hash value of the image to be encrypted, divide the hash value equally to obtain segments equal to the number of image blocks, determine the chaos number of the first chaotic sequence according to each segment and the image size, determine the number of transformations of the cat face transformation corresponding to each image block according to each chaos number, and perform cat face transformation on each image block according to each number of transformations to obtain the encryption matrix after block transformation scrambling. The encryption unit 303 is used to generate a second chaotic sequence according to the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations, and obtain an encrypted image after block swapping and chaotic mapping hybrid encryption according to the second chaotic sequence and the encryption matrix after block transformation scrambling.

[0133] Specifically, the generation unit 301 in the device is used to segment the image to be encrypted to obtain image blocks, determine the number of iterations of the first chaotic mapping form according to the image size of the image to be encrypted, and generate a first chaotic sequence according to the first chaotic mapping parameters and the number of iterations; the transformation unit 302 is used to calculate the hash value of the image to be encrypted, divide the hash value equally to obtain segments equal to the number of image blocks, determine the chaos number of the first chaotic sequence according to each segment and the image size, determine the number of transformations of the cat face transformation corresponding to each image block according to each chaos number, and perform cat face transformation on each image block according to each number of transformations to obtain the encryption matrix after block transformation scrambling; the encryption unit 303 is used to generate a second chaotic sequence according to the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations, and obtain an encrypted image after block swapping and chaotic mapping hybrid encryption according to the second chaotic sequence and the encryption matrix after block transformation scrambling.

[0134] The image encryption processing apparatus provided in this invention segmentes an image to be encrypted into image blocks. It determines the number of iterations for a first chaotic mapping form based on the image size of the image to be encrypted, and generates a first chaotic sequence based on the first chaotic mapping parameters and the number of iterations. It calculates the hash value of the image to be encrypted and divides the hash value equally into segments equal to the number of image blocks. It determines the number of chaotic elements in the first chaotic sequence based on each segment and the image size, determines the number of cat-face transformations corresponding to each image block based on each number of chaotic elements, and performs cat-face transformations on each image block based on each number of transformations to obtain an encryption matrix after block transformation scrambling. It generates a second chaotic sequence based on the second chaotic mapping parameters for a second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, it obtains an encrypted image after a hybrid encryption of block swapping and chaotic mapping, ensuring the security of the encrypted image.

[0135] Furthermore, the transformation unit 302 is specifically used for:

[0136] The data of each segment is converted to obtain a decimal number;

[0137] Based on the image size, perform modulo operations on each decimal number to obtain the chaos number of the first chaotic sequence.

[0138] The image encryption processing device provided in this embodiment of the invention can quickly and conveniently determine the number of chaos in the first chaotic sequence.

[0139] Furthermore, the transformation unit 302 is specifically used for:

[0140] Each chaotic number is rounded down to obtain an integer value corresponding to each chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch.

[0141] The image encryption processing device provided in this embodiment of the invention can quickly and conveniently determine the number of transformations of the cat face transformation corresponding to each image block.

[0142] Furthermore, the encryption unit 303 is specifically used for:

[0143] The encryption matrix after block transformation and scrambling is reconstructed to obtain a reconstructed matrix; each element of the second chaotic sequence is placed into an array, and each element in the array is normalized to obtain a normalized array;

[0144] Perform a bitwise XOR operation on the normalized array and the reconstructed matrix to obtain the encrypted matrix after chaotic mapping scrambling;

[0145] The encrypted matrix after scrambling the chaotic mapping is rearranged, and the rearranged matrix is ​​used as the encrypted image after block swapping and chaotic mapping are mixed encryption.

[0146] The image encryption processing device provided in this embodiment of the invention further ensures the security of encrypted images.

[0147] Furthermore, the transformation unit 302 is specifically used for:

[0148] The parameters of the remainder function are determined based on the control factor, and the integer values ​​corresponding to each chaotic number are calculated based on the remainder function after the parameters are determined.

[0149] The image encryption processing device provided in this embodiment of the invention can further quickly and conveniently determine the chaos number of the first chaotic sequence.

[0150] Furthermore, the image encryption processing device is also used for:

[0151] Obtain scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the first chaotic mapping parameters, and the second chaotic mapping parameters;

[0152] The scrambling parameters are used as plaintext, and the plaintext is encrypted with a public key to obtain ciphertext.

[0153] The image encryption processing device provided in this embodiment of the invention further ensures the security of encrypted images.

[0154] Furthermore, after the step of encrypting the plaintext with a public key to obtain ciphertext, the image encryption processing device is further configured to:

[0155] The ciphertext is decrypted using the private key to obtain the scrambling parameters;

[0156] The encrypted image is restored using the scrambling parameters to obtain the original image to be encrypted.

[0157] The image encryption processing device provided in this embodiment of the invention can restore the image and obtain the original image to be encrypted.

[0158] The embodiments of the image encryption processing apparatus provided in this invention can be used to execute the processing flow of the above-described method embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the above-described method embodiments.

[0159] Figure 4 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 4 As shown, the electronic device includes: a processor 401, a memory 402, and a bus 403;

[0160] The processor 401 and the memory 402 communicate with each other via the bus 403.

[0161] The processor 401 is used to call program instructions in the memory 402 to execute the methods provided in the above-described method embodiments, including, for example:

[0162] The image to be encrypted is segmented to obtain image blocks. The number of iterations for the first chaotic mapping form is determined based on the image size of the image to be encrypted. A first chaotic sequence is generated based on the first chaotic mapping parameters and the number of iterations.

[0163] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block based on each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0164] A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image after block exchange and chaotic mapping hybrid encryption is obtained.

[0165] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the methods provided in the above-described method embodiments, such as:

[0166] The image to be encrypted is segmented to obtain image blocks. The number of iterations for the first chaotic mapping form is determined based on the image size of the image to be encrypted. A first chaotic sequence is generated based on the first chaotic mapping parameters and the number of iterations.

[0167] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block based on each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0168] A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image after block exchange and chaotic mapping hybrid encryption is obtained.

[0169] This embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided in the above-described method embodiments, including, for example:

[0170] The image to be encrypted is segmented to obtain image blocks. The number of iterations for the first chaotic mapping form is determined based on the image size of the image to be encrypted. A first chaotic sequence is generated based on the first chaotic mapping parameters and the number of iterations.

[0171] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block based on each number of transformations to obtain the encryption matrix after block transformation scrambling.

[0172] A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image after block exchange and chaotic mapping hybrid encryption is obtained.

[0173] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0174] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0175] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0176] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0177] In the description of this specification, the references to terms such as "an embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0178] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An image encryption processing method, characterized in that, include: The image to be encrypted is segmented to obtain image blocks. The number of iterations for the first chaotic mapping form is determined based on the image size of the image to be encrypted. A first chaotic sequence is generated based on the first chaotic mapping parameters and the number of iterations. Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the first chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block based on each number of transformations to obtain the encryption matrix after block transformation scrambling. A second chaotic sequence is generated based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations. Based on the second chaotic sequence and the encryption matrix after block transformation scrambling, an encrypted image after block exchange and chaotic mapping hybrid encryption is obtained. The step of obtaining the encrypted image after hybrid encryption of block swapping and chaotic mapping based on the second chaotic sequence and the scrambled encryption matrix of the block transformation includes: The elements in the scrambled encryption matrix after the block transformation are reconstructed according to the matrix order to obtain the reconstructed matrix; the elements of the second chaotic sequence are placed into an array, and the elements in the array are normalized to obtain a normalized array; Perform a bitwise XOR operation on the normalized array and the reconstructed matrix to obtain the encrypted matrix after chaotic mapping scrambling; The encrypted matrix after scrambling the chaotic mapping is rearranged, and the rearranged matrix is ​​used as the encrypted image after block swapping and chaotic mapping are mixed encryption.

2. The image encryption processing method according to claim 1, characterized in that, Determining the number of chaotic segments in the first chaotic sequence based on each segment and the image size includes: The data of each segment is converted to obtain a decimal number; Based on the image size, perform modulo operations on each decimal number to obtain the chaos number of the first chaotic sequence.

3. The image encryption processing method according to claim 1, characterized in that, The step of determining the number of transformations corresponding to each image patch based on each chaos number includes: Each chaotic number is rounded down to obtain an integer value corresponding to each chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch.

4. The image encryption processing method according to claim 3, characterized in that, The step of rounding each chaotic number to obtain the corresponding integer value includes: The parameters of the remainder function are determined based on the control factor, and the integer values ​​corresponding to each chaotic number are calculated based on the remainder function after the parameters are determined.

5. The image encryption processing method according to claim 4, characterized in that, The image encryption processing method further includes: Obtain scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the first chaotic mapping parameters, and the second chaotic mapping parameters; The scrambling parameters are used as plaintext, and the plaintext is encrypted with a public key to obtain ciphertext.

6. The image encryption processing method according to claim 5, characterized in that, After the step of encrypting the plaintext with a public key to obtain ciphertext, the image encryption method further includes: The ciphertext is decrypted using the private key to obtain the scrambling parameters; The encrypted image is restored using the scrambling parameters to obtain the original image to be encrypted.

7. An image encryption processing device, characterized in that, include: The generation unit is used to segment the image to be encrypted to obtain image blocks, determine the number of iterations of the first chaotic mapping form according to the image size of the image to be encrypted, and generate a first chaotic sequence according to the first chaotic mapping parameters and the number of iterations. The transformation unit is used to calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. The chaos number of the first chaotic sequence is determined according to each segment and the image size. The number of transformations of the cat face transformation corresponding to each image block is determined according to each chaos number. The cat face transformation is performed on each image block according to each number of transformations to obtain the encryption matrix after block transformation and scrambling. An encryption unit is used to generate a second chaotic sequence based on the second chaotic mapping parameters of the second chaotic mapping form and the number of iterations, and to obtain an encrypted image after block exchange and chaotic mapping hybrid encryption based on the second chaotic sequence and the encryption matrix after block transformation scrambling. The encryption unit is specifically used for: The elements in the scrambled encryption matrix after the block transformation are reconstructed according to the matrix order to obtain the reconstructed matrix; the elements of the second chaotic sequence are placed into an array, and the elements in the array are normalized to obtain a normalized array; Perform a bitwise XOR operation on the normalized array and the reconstructed matrix to obtain the encrypted matrix after chaotic mapping scrambling; The encrypted matrix after scrambling the chaotic mapping is rearranged, and the rearranged matrix is ​​used as the encrypted image after block swapping and chaotic mapping are mixed encryption.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image encryption method and device based on chaotic system, medium and electronic equipment

    CN113726975A

  • Image encryption method based on parallel compressed sensing and secret sharing

    CN114944911A