Image encryption method and device
By constructing a two-dimensional chaotic system based on cosine and sine functions, scrambling and diffusing the image, and embedding the ciphertext image into the carrier image, the problem of low image encryption security in the existing technology is solved, and efficient Image encryption effect.
Patent Information
- Application Number
- CN202410951591.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-16
AI Technical Summary
Existing image encryption schemes based on chaotic systems have security flaws in terms of chaos mapping complexity and attack resistance, and the encryption efficiency is low, resulting in insufficient image encryption security.
A two-dimensional chaotic system based on cosine and sine functions is used to obtain system parameters and initial values through the target image, and multiple iterations are performed to generate a chaos matrix. These matrices are used to scramble and diffuse the image, and the ciphertext image is embedded in the carrier. In images, improve the encryption security of images.
It effectively improves the effect and efficiency of image encryption, enhances the randomness of ciphertext images, makes the final encrypted image visually consistent with the carrier image, and significantly improves the security of image encryption.
Smart Images

Figure CN118509537B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image encryption technology, and in particular to an image encryption method and device. Background Art
[0002] With the rapid development of communication networks and Internet technology, a large amount of digital information has been widely transmitted on the Internet. For massive multimedia information, there are mainly text, voice, image, video and other forms. Among them, digital images can convey information more vividly and figuratively, making it the mainstream information transmission medium. Image multimedia communication makes our expression more vivid and concrete, making communication more convenient. However, image multimedia communication is a double-edged sword. Due to the openness and sharing of the network, these digital image information are extremely vulnerable to malicious attacks during the transmission process of the Internet, causing immeasurable losses to the information owner and receiver. Therefore, how to ensure the security of digital image information during storage and transmission has become a hot research direction in the current information security field.
[0003] At present, text encryption technology is very mature. Traditional text encryption algorithms have the disadvantages of high algorithm complexity and low encryption efficiency, and are not suitable for image encryption with large data volumes. The pseudo-random sequence generated by the iteration of chaotic systems is the application of chaos theory in the field of information security. Chaotic systems have many good properties suitable for the encryption field. After introducing chaos theory into image encryption algorithms, more and more chaotic systems are applied in the field of image encryption, and image encryption technology based on chaos theory has become an important research direction in the field of image encryption.
[0004] However, some existing image encryption schemes based on chaotic systems have a series of security defects in chaotic mapping, encryption algorithms, etc. For example, the complexity of chaotic mapping is not high enough, and the chaotic range is small; the encryption algorithm has weak anti-attack ability and low operating efficiency; the ciphertext image is a disordered pixel matrix, which is easy to attract the attention of attackers, etc. It can be seen that there is a problem of low security in image encryption. Summary of the invention
[0005] The present application provides an image encryption method and device, which can solve the problem of low security of image encryption.
[0006] In a first aspect, an embodiment of the present application provides an image encryption method, the image encryption method comprising:
[0007] Obtain a target image and a carrier image; the target image is the image to be encrypted, and the carrier image is used to hide the target image;
[0008] Construct a two-dimensional chaotic system based on cosine function and sine function, and use the target image to obtain the system parameters and initial values of the two-dimensional chaotic system;
[0009] The two-dimensional chaotic system is iterated multiple times using the target image, system parameters and initial values to obtain the first chaotic matrix, the second chaotic matrix and the third chaotic matrix; the elements in the first chaotic matrix are random 0 or 1, and the dimensions of the second chaotic matrix and the third chaotic matrix are the same as the dimensions of the target image;
[0010] Extract the channel images of the three color channels of the target image, and divide the channel images into multiple image blocks for each channel image, and convert each image block into a cell array; the cell array is used to describe the pixel values of all pixels in the corresponding image block;
[0011] All cell arrays are scrambled using the first chaotic matrix to obtain a scrambled image of the target image;
[0012] The pixel value of each pixel in the scrambled image is diffused by using the second chaotic matrix and the third chaotic matrix to obtain a ciphertext image of the target image; the ciphertext image is used to describe all disordered pixel values in the target image;
[0013] Perform discrete cosine transform on each color channel of the carrier image to obtain the color component corresponding to each color channel, and embed the ciphertext image into all color components to obtain the final encrypted image of the target image.
[0014] In a second aspect, an embodiment of the present application provides an image encryption device, comprising:
[0015] An acquisition module acquires a target image and a carrier image; the target image is an image to be encrypted, and the carrier image is used to hide the target image;
[0016] A construction module is used to construct a two-dimensional chaotic system based on cosine function and sine function, and the system parameters and initial values of the two-dimensional chaotic system are obtained using the target image;
[0017] An iteration module, which uses the target image, system parameters and initial values to iterate the two-dimensional chaotic system for multiple times to obtain a first chaotic matrix, a second chaotic matrix and a third chaotic matrix; the elements in the first chaotic matrix are random 0 or 1, and the dimensions of the second chaotic matrix and the third chaotic matrix are the same as the dimensions of the target image;
[0018] The block division module extracts the channel images of the three color channels of the target image, and divides each channel image into multiple image blocks, and converts each image block into a cell array; the cell array is used to describe the pixel values of all pixels in the corresponding image block;
[0019] A scrambling module, using the first chaotic matrix to scramble all cell arrays to obtain a scrambled image of the target image;
[0020] A diffusion module, using the second chaotic matrix and the third chaotic matrix to diffuse the pixel value of each pixel in the scrambled image, to obtain a ciphertext image of the target image; the ciphertext image is used to describe all disordered pixel values in the target image;
[0021] The embedding module performs discrete cosine transform on each color channel of the carrier image to obtain the color component corresponding to each color channel, and embeds the ciphertext image into all color components to obtain the final encrypted image of the target image.
[0022] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned image encryption method when executing the above-mentioned computer program.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above-mentioned image encryption method when executed by a processor.
[0024] The above solution of the present application has the following beneficial effects:
[0025] In an embodiment of the present application, a target image and a carrier image are obtained, and then a two-dimensional chaotic system based on cosine function and sine function is constructed, and the target image is used to obtain the system parameters and initial values of the two-dimensional chaotic system, and then the target image, the system parameters and the initial values are used to iterate the two-dimensional chaotic system multiple times to obtain a first chaotic matrix, a second chaotic matrix and a third chaotic matrix, and then the channel images of the three color channels of the target image are extracted, and for each channel image, the channel image is divided into multiple image blocks, and each image block is converted into a cell array, and then all the cell arrays are scrambled using the first chaotic matrix to obtain a scrambled image of the target image, and then the pixel value of each pixel in the scrambled image is diffused using the second chaotic matrix and the third chaotic matrix to obtain a ciphertext image of the target image, and then each color channel of the carrier image is discrete cosine transformed to obtain the color component corresponding to each color channel, and the ciphertext image is embedded in all color components to obtain the final encrypted image of the target image. Among them, the chaotic characteristics of the two-dimensional chaotic system constructed based on cosine function and sine function are improved. The two-dimensional chaotic system with high chaotic characteristics is used to scramble and diffuse the target image, which can effectively improve the encryption effect and efficiency. At the same time, the second chaotic matrix and the third chaotic matrix are used for diffusion to improve the randomness of the ciphertext image, and the ciphertext image is embedded in the carrier image, so that the final encrypted image is visually the carrier image, further improving the security of image encryption.
[0026] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 A flowchart of an image encryption method provided by an embodiment of the present application;
[0029] Figure 2 A schematic diagram of the calculation process of a two-dimensional chaotic system provided in one embodiment of the present application;
[0030] Figure 3 An attractor phase diagram of a two-dimensional chaotic system provided in one embodiment of the present application;
[0031] Figure 4 A bifurcation diagram of a two-dimensional chaotic system provided in one embodiment of the present application;
[0032] Figure 5 A Lyapunov exponent spectrum of a two-dimensional chaotic system provided in an embodiment of the present application;
[0033] Figure 6 A schematic diagram of a 0-1 test result of a two-dimensional chaotic matrix provided in an embodiment of the present application;
[0034] Figure 7 A schematic diagram of a plaintext histogram and an encrypted histogram provided in an embodiment of the present application;
[0035] Figure 8 A schematic diagram of the correlation between adjacent pixels provided in one embodiment of the present application;
[0036] Fig. 9 A schematic diagram of key sensitivity analysis results provided in an embodiment of the present application;
[0037] Fig.10 A schematic diagram of the structure of an image encryption device provided in one embodiment of the present application;
[0038] Fig.11 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0039] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0040] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0041] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0042] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0043] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0044] In response to the problem of low security of existing image encryption, an embodiment of the present application provides an image encryption method. The image encryption method improves the chaotic characteristics of a two-dimensional chaotic system constructed based on cosine function and sine function, and uses the two-dimensional chaotic system with high chaotic characteristics to scramble and diffuse the target image, which can effectively improve the encryption effect and efficiency. At the same time, the second chaotic matrix and the third chaotic matrix are used for diffusion to improve the randomness of the ciphertext image, and the ciphertext image is embedded in the carrier image, so that the final encrypted image is visually the carrier image, further improving the security of image encryption.
[0045] Next, the image encryption method provided by this application is exemplified.
[0046] like Figure 1 As shown, the image encryption method provided by this application includes the following steps:
[0047] Step 11, obtaining the target image and the carrier image.
[0048] It should be noted that the target image is the image that needs to be encrypted, and the carrier image is used to hide the target image. The carrier image is an image with actual information, such as a landscape image, a close-up image of an object, etc., and the resolution of the carrier image and the target image is the same, both are RGB images. In order to improve the encryption security of the target image, when selecting the carrier image, the carrier image should be an image that does not contain relevant information of the target image.
[0049] Exemplarily, the target image and the carrier image may be acquired using photographic equipment such as a camera or a video camera.
[0050] Step 12: construct a two-dimensional chaotic system based on cosine function and sine function, and use the target image to obtain system parameters and initial values of the two-dimensional chaotic system.
[0051] In some embodiments of the present application, the steps of constructing a two-dimensional chaotic system based on cosine function and sine function, and obtaining system parameters and initial values of the two-dimensional chaotic system using the target image are specifically as follows:
[0052] The first step is to construct a two-dimensional chaotic system based on cosine and sine functions.
[0053] Specifically, the above two-dimensional chaotic system is:
[0054]
[0055] in, For the The first state variable of the two-dimensional chaotic system at the iteration, For the The second state variable of the two-dimensional chaotic system at the iteration is, For the The first state variable of the two-dimensional chaotic system at the iteration, For the The second state variable of the two-dimensional chaotic system at the iteration is, and are the system parameters to be solved. represents the sine function, represents the cosine function, , Indicates the number of iterations.
[0056] In the second step, the target image is used to obtain the system parameters and initial values of the two-dimensional chaotic system.
[0057] First, based on the target image, a hash key is obtained using a hash algorithm.
[0058] Specifically, the pixel values of all pixels of the target image are calculated using a hash algorithm to obtain a hash key having multiple integer digits.
[0059] Exemplarily, the above hash algorithm may be a Hash 512 algorithm, and the target function is used as the input of the Hash 512 algorithm to obtain a hash key with a length of 512.
[0060] Then, by the formula:
[0061] ;
[0062] Calculating System Parameters of a Two-Dimensional Chaotic System , , the initial value of the first state variable , the initial value of the second state variable .
[0063] in, represents the modulo operation, Represents a bitwise exclusive OR operation, represents the first hash subkey, represents the second hash subkey, represents the third hash subkey, represents the fourth hash subkey, represents the fifth hash subkey, represents the sixth hash subkey, represents the seventh hash subkey, Represents the eighth hash subkey:
[0064]
[0065] in, , Indicates the first Bit character, Indicates the first Bit character, Indicates the first bit character.
[0066] Exemplarily, the above steps can be run using computer software such as MATLAB to construct a two-dimensional chaotic system and obtain system parameters and initial values of the two-dimensional chaotic system.
[0067] It is worth mentioning that the nonlinearity, pseudo-randomness, chaotic distribution width and other chaotic characteristics of the two-dimensional chaotic system constructed based on cosine function and sine function are improved. At the same time, the hash algorithm is highly sensitive to input data and can effectively resist plaintext attacks. Therefore, the system parameters and initial values obtained by the hash algorithm are highly secure and cannot be tampered with.
[0068] The above two-dimensional chaotic system is illustrated below with reference to a specific example.
[0069] The calculation process of the above two-dimensional chaotic system is as follows: Figure 2 As shown in the figure is a sine function, is the cosine function, is an infinite folding map, defined as , is a Sine map, defined as , + represents addition, - represents subtraction, The first state variable at iteration (i.e. ) After the calculation of the sine function, The second state variable at iteration Add them, and then use Sine mapping to get the The first state variable at iteration (i.e. ), at the same time, The second state variable at iteration (i.e. ) After the cosine function is calculated, The first state variable at iteration Subtract, and then get the first The second state variable at iteration (i.e. ).
[0070] Take the system parameters of the above two-dimensional chaotic system , , initial value , .
[0071] The attractor phase diagram is used to reflect the nonlinearity and pseudo-randomness of the chaotic system. The attractor phase diagram of the two-dimensional chaotic system of the present application is as follows: Figure 3 As shown in the figure, the horizontal axis represents the value of the first state variable, and the vertical axis represents the value of the second state variable. Figure 3 It can be seen that the attractor phase diagram of the two-dimensional chaotic system of the present application is evenly distributed, and has high nonlinearity and pseudo-randomness.
[0072] The bifurcation diagram well reflects the dynamic behavior of a chaotic system. It shows that the system motion state changes with the change of system parameters. The bifurcation diagram of the two-dimensional chaotic system of this application is as follows: Figure 4 As shown, Figure 4 (a) is the first state variable With the parameters The change graph of Figure 4 (b) is the second state variable With the parameters From the change diagram, it can be seen that the two-dimensional chaotic system of the present application shows a chaotic state rather than a periodic state in the parameter ranges of 0 to 15 and 0 to 100, indicating that the chaotic distribution of the two-dimensional chaotic system of the present application is wide.
[0073] The Lyapunov index effectively characterizes the evolution of a chaotic system over time and the initial value sensitivity of the system. The Lyapunov index spectrum of the two-dimensional chaotic system of the present application is as follows: Figure 5 As shown, the solid line in the figure represents the first Lyapunov exponent 1, the dotted line represents the second Lyapunov exponent 2's change curve, Figure 5 (a) is the Lyapunov exponent (LE) with the parameter The change curve of Figure 5 (b) Lyapunov exponent (LE) with parameter The change curve. Figure 5 When the two LE indices in (a) are both greater than 0, the parameter The value range is between 0 and 20, and as can be seen from the figure, the length of the value range is greater than 15. Figure 5 When the two LE indices in (b) are greater than 0, the parameter The value range is between 0 and 100, and as can be seen from the figure, the length of the value range is greater than 80, which shows that the parameter value range of the two-dimensional chaotic matrix of the present application in the hyperchaotic state is large.
[0074] The 0-1 test method is another test method to measure whether a system is a chaotic system. It reflects the relationship between the scale of a random motion process and the change of time. The 0-1 test result of the two-dimensional chaotic system of this application is shown in the ps figure. Figure 6 As shown, Figure 6 The horizontal axis represents the value of p, and the vertical axis represents the value of s, where Figure 6 (a) is the 0-1 test result diagram of the first chaotic state variable. Figure 6(b) is a 0-1 test result diagram of the second chaotic state variable. "p" and "s" represent specific variables or parameters, which are used to show a certain dynamic or behavior of the chaotic system, and their physical meanings are determined according to the specific chaotic system. Specifically, "p" and "s" are used here to test and verify a certain mathematical tool or indicator of the properties of the chaotic system. It can be seen that both the first state variable and the second state variable are in the Brownian motion state, indicating that the two-dimensional chaotic system of the present application is in a chaotic state.
[0075] Step 13, using the target image, system parameters and initial values to iterate the two-dimensional chaotic system for multiple times to obtain a first chaotic matrix, a second chaotic matrix and a third chaotic matrix.
[0076] The elements in the first chaotic matrix are random 0 or 1, and the dimensions of the second chaotic matrix and the third chaotic matrix are the same as the dimension of the target image.
[0077] In some embodiments of the present application, the above-mentioned steps of iterating the two-dimensional chaotic system multiple times using the target image, system parameters and initial values to obtain the first chaotic matrix, the second chaotic matrix and the third chaotic matrix are specifically:
[0078] The first step is to set the number of iterations .
[0079] in, Indicates the number of pixel rows of the target image, Indicates the number of pixel columns of the target image, Indicates the preset iteration threshold.
[0080] The second step is to substitute the system parameters and initial values into the two-dimensional chaotic system. Iterations, get the initial sequence of the first state variable and the initial sequence of the second state variable .
[0081] in, represents the value of the first state variable at the first iteration, represents the value of the first state variable at the second iteration, Indicates The value of the first state variable at iteration represents the value of the second state variable at the first iteration, represents the value of the second state variable at the second iteration, Indicates The value of the second state variable at iteration .
[0082] The third step is to convert the first elements are removed to obtain the final sequence.
[0083] The fourth step is to obtain the first chaotic matrix, the second chaotic matrix and the third chaotic matrix based on all the final sequences.
[0084] Specifically, through the formula:
[0085] I = reshape(X,[2,2,3]) J = reshape(Y,[M,N,3]) K=reshape(Z,[M,N,3])
[0086] Calculate the first chaotic matrix , the second chaotic matrix and the third chaotic matrix .
[0087] in, , , , represents the reconstruction function, represents the first chaotic sequence, represents the second chaotic sequence, Represents the third chaotic sequence:
[0088]
[0089] in, Indicates rounding down. represents the modulo operation, Indicates taking the absolute value, represents the first state variable in the final sequence Iteration to The values of the 12 first state variables at iterations, The final sequence of the second state variable Iteration to Iteration The value of the second state variable, represents the first state variable in the final sequence Iteration to Iteration The value of the first state variable.
[0090] Exemplarily, the first chaotic matrix, the second chaotic matrix and the third chaotic matrix can be obtained by using computer software such as Matlab.
[0091] It is worth mentioning that the randomness of the first chaotic matrix, the second chaotic matrix, and the third chaotic matrix obtained by using the two-dimensional chaotic system with excellent chaotic characteristics is improved. At the same time, when iterating the two-dimensional chaotic system, there is a transient response, that is, the system does not reach a stable state in the first multiple iterations, resulting in inaccurate data. By only retaining the data after the stable state, the transient response can be eliminated and the accuracy of the data can be improved.
[0092] Step 14, extracting channel images of three color channels of the target image, and dividing each channel image into a plurality of image blocks, and converting each image block into a cell array.
[0093] The above cell array is used to describe the pixel values of all pixels in the corresponding image block. The three color channels of the target image can be separated by using computer software such as Python to obtain channel images of the three color channels. The three color channels are the red channel, green channel, and blue channel of the RGB color space.
[0094] Specifically, through the formula:
[0095] p 2 (:,:,1)=mat2cell( p 1 (:,:,1),[M / 2,M / 2],[N / 2,N / 2]) p 2 (:,:,2)=mat2cell( p 1 (:,:,2),[M / 2,M / 2],[N / 2,N / 2]) p 2 (:,:,3)=mat2cell( p 1 (:,:,3),[M / 2,M / 2],[N / 2,N / 2])
[0096] Get all cell arrays of the red channel channel image , all cell arrays of the channel images of the green channel and all cell arrays of the channel images of the blue channel .
[0097] in, Represents the data type conversion function, represents the channel image of the red channel, represents the channel image of the green channel, represents the channel image of the blue channel, Indicates the number of pixel rows of the target image, Indicates the number of pixel columns of the target image, [M / 2,M / 2],[N / 2,N / 2] Represents the division operation of the channel image, Represents the number of pixel rows in the image block, Represents the number of pixel columns in the image block.
[0098] It should be noted that through the above steps, each channel image is divided into four 2×2 cell arrays, each of which contains The pixel values of the pixels in the corresponding color channels, and the dimension of the first chaotic matrix in step 13 is the same as the dimension of the cell array. For example, if the dimension of the cell array is 2×2×3 with a total of 12 cell arrays, then the first chaotic matrix is also 2×2×3 with a total of 12 elements.
[0099] Exemplarily, multiple cell arrays can be obtained using computer software such as Matlab.
[0100] It is worth mentioning that obtaining multiple cell arrays of the target image realizes the segmentation of the target image in each color channel, and at the same time converts the information of the target image into the form of a cell array to facilitate the calculation of subsequent steps.
[0101] Step 15, using the first chaotic matrix to scramble all cell arrays to obtain a scrambled image of the target image.
[0102] In some embodiments of the present application, the step of using the first chaotic matrix to scramble all cell arrays to obtain a scrambled image of the target image is specifically:
[0103] The first step is through the formula:
[0104]
[0105] Get channel image No. Line Scrambled array of cell arrays of columns .
[0106] in, , , ,when When the channel image is the channel image of the red channel, when When the channel image is the channel image of the blue channel, when When the channel image is the channel image of the green channel, Represents channel image No. Line cell array of columns, Indicates that in the first chaotic matrix Line Ledi The element of dimension, represents the Arnold transform, represents the Hilbert transform, Indicates the key value. key=[Times,a,b,c,d] , , Indicates the number of scrambling times, , , and All are preset parameters. Represents the Hilbert curve order.
[0107] Exemplarily, if the element of the 1st row, 1st column, and 1st dimension in the first chaotic matrix is 0, then the Arnold transform is performed on the cell array of the 1st row and 1st column of the channel image of the red channel, and the element of the 1st row, 1st column, and 2nd dimension in the first chaotic matrix is 1, then the Hilbert transform is performed on the cell array of the 1st row and 1st column of the channel image of the blue channel.
[0108] In the second step, all scrambled arrays are integrated to obtain the scrambled image of the target image.
[0109] Specifically, all scrambled arrays corresponding to each channel image are integrated, and the corresponding scrambled arrays in the three channels are merged to obtain the pixel values of each pixel in the three color channels.
[0110] Exemplarily, all cell arrays can be scrambled using computer software such as Matlab to obtain a scrambled image.
[0111] It is worth mentioning that using the first chaotic system to scramble all cell arrays can increase the degree of chaos of the cell arrays, thereby protecting the information of the target image.
[0112] The above scrambling steps are exemplarily described below with reference to a specific example.
[0113] Step 16: Use the second chaotic matrix and the third chaotic matrix to diffuse the pixel value of each pixel in the scrambled image to obtain a ciphertext image of the target image.
[0114] The above ciphertext image is used to describe all disordered pixel values in the target image.
[0115] In some embodiments of the present application, the step of using the second chaotic matrix and the third chaotic matrix to diffuse the pixel value of each pixel in the scrambled image to obtain the ciphertext image of the target image is specifically:
[0116] The first step is when and When, through the formula:
[0117]
[0118] Get the scrambled image Line Columns of pixels in channel The diffuse pixel value .
[0119] in, ,when When, channel For the red channel, When, channel For the blue channel, When, channel For the green channel, , Indicates the number of pixel rows of the target image, , Indicates the number of pixel columns of the target image, Indicates the scrambled image Line The pixel values of the pixels in the column at random color channels, Indicates the first chaotic matrix Line Randomize the elements of the columns, represents the modulo operation, Represents circular diffusion.
[0120] when and When, through the formula:
[0121] ;
[0122] Get the scrambled image Line Columns of pixels in channel The diffuse pixel value .
[0123] in, Indicates the scrambled image Line The diffuse pixel values of the pixels in the column in the random color channel, Indicates the third chaotic matrix Line Ledi Dimensional elements.
[0124] when and When, through the formula:
[0125] ;
[0126] Get the scrambled image Line Columns of pixels in channel The diffuse pixel value .
[0127] in, Indicates the scrambled image Line The diffuse pixel values of the pixels in the column in random color channels.
[0128] In the second step, for each pixel in the scrambled image, all diffused pixel values of the pixel are merged to obtain the final pixel value of the pixel.
[0129] It should be noted that the final pixel value is a combination of the diffuse pixel groups of the pixel in the three color channels. For example, if the final pixel value is (20, 18, 56), the diffuse pixel value of the pixel in the red channel is 20, the diffuse pixel value of the green channel is 18, and the diffuse pixel value of the blue channel is 56.
[0130] The third step is to integrate the final pixel values of all pixels in the scrambled image to obtain the ciphertext image of the target image.
[0131] Specifically, the final pixel values of all pixels are integrated into the same image to obtain the ciphertext image of the target image.
[0132] Exemplarily, the above steps can be executed by computer software such as MATLAB to obtain the ciphertext image.
[0133] It is worth mentioning that since the above formula for obtaining the diffusion pixel value contains random factors, the diffusion pixel value of the pixel may be affected by any diffusion pixel value, which greatly improves the randomness of the diffusion pixel value, thereby improving the randomness of the final pixel value.
[0134] Step 17, performing discrete cosine transform on each color channel of the carrier image to obtain the color component corresponding to each color channel, and embedding the ciphertext image into all color components to obtain the final encrypted image of the target image.
[0135] In some embodiments of the present application, the above-mentioned step of embedding the ciphertext image into all color components to obtain the final encrypted image of the target image is specifically:
[0136] The first step is through the formula:
[0137]
[0138] Get the embedded component of the red channel , the embedded component of the green channel and the embedded component of the blue channel .
[0139] in, represents the color component of the red channel of the carrier image, Represents the color component of the green channel of the carrier image, represents the color component of the blue channel of the carrier image, represents the embedding coefficient, Represents the pixel values of all pixels in the red channel of the ciphertext image, Represents the pixel values of all pixels in the green channel of the ciphertext image, Represents the pixel values of all pixels in the blue channel of the ciphertext image.
[0140] In the second step, an inverse discrete cosine transform is performed on each embedded component to obtain the embedded channel image corresponding to each embedded component.
[0141] In the third step, all embedded channel images are merged to obtain the final encrypted image of the target image.
[0142] Exemplarily, the above steps can be run using computer software such as MATLAB to obtain the final encrypted image.
[0143] It should be noted that when decrypting the final encrypted image, the final encrypted image is reversely embedded, the ciphertext image of the target image is obtained from the carrier image, and then the ciphertext image is reversely diffused using the second chaotic matrix and the third chaotic matrix that are the same as those in the encryption process to obtain a scrambled image, and then the scrambled image is reversely scrambled using the first chaotic matrix that is the same as that in the encryption process to obtain the target image.
[0144] It is worth mentioning that by embedding the ciphertext image into the carrier image, the final encrypted image is visually the carrier image, but actually contains the information of the target image, which reduces the probability of the final encrypted image being noticed by the attacker and improves the security of the target image.
[0145] The image encryption method of the present application is exemplified below with reference to a specific example.
[0146] The histogram of a digital image can reflect the distribution of the grayscale values of its internal pixels. The digital image encryption process is the process of disrupting the statistical distribution of its internal grayscale values. Attackers can often crack the plaintext image information by analyzing the statistical distribution of the grayscale values in the ciphertext image. Therefore, in order to resist this attack, the grayscale value distribution of the ciphertext image should be as uniform as possible. The plaintext histogram and encrypted histogram corresponding to multiple target images are shown in Figure 1. Figure 7 As shown, Figure 7 The horizontal axis represents the gray value, the vertical axis represents the number of pixels with different gray values, and the histograms of different gray values represent the gray value distribution of different channels of the color image. Figure 7 ( a ) represents the plaintext histogram of the first target image, Figure 7 ( b ) represents the encrypted histogram of the first target image, Figure 7 ( c ) represents the plaintext histogram of the second target image, Figure 7 ( d ) represents the encrypted histogram of the second target image, Figure 7 (e ) represents the plaintext histogram of the third target image, Figure 7 ( f ) represents the encrypted histogram of the third target image. Figure 7 It can be seen that the encrypted histogram is evenly distributed, which disrupts the statistical distribution of grayscale values inside the plaintext image. The encryption effect is good and can resist statistical attacks well.
[0147] Information entropy can be used to measure the uncertainty of image information. In digital image encryption, the ideal value of information entropy of a ciphertext image is 8. The closer it is to the ideal value, the greater the uncertainty of its information and the better the encryption effect. This can be expressed by the formula:
[0148] ;
[0149] Calculating Information Entropy .
[0150] in, Display information The probability of occurrence, Display information The Segment information, Display information For a color image with a grayscale of 256, the length of the red (R, Red), green (G, Green), and blue (B, Blue) channels is 256, and the ideal value of information entropy is 8.
[0151] The information entropy analysis results of the image encryption method of this application and other image encryption methods are shown in Table 1:
[0152] Table 1
[0153]
[0154] Among them, Cat, Lena, House, and Car are all names of target images, and the corresponding ciphertext images are the final encrypted images obtained by the image encryption method of this application. It can be seen that the information entropy of the final encrypted image is closer to 8 than that of the ciphertext images obtained by other comparison algorithms, indicating that the method of this application has a better encryption effect.
[0155] Select the target image Car mentioned above, and take 5000 pixels from the horizontal direction of the R channel, the vertical direction of the G channel, and the diagonal direction of the B channel of the plain image (i.e. the target image) and the final encrypted image, and test the correlation of adjacent pixels in different directions of different channels. The test results are as follows: Figure 8 As shown, the horizontal axis in the figure is the position ( x,y), the vertical axis is the point pixel grayscale value of the pixel at position (x+1,y), , , Figure 8 (a) shows the correlation analysis result of adjacent pixels in the horizontal direction of the R channel of the plaintext image. Figure 8 (b) shows the result of the correlation analysis of adjacent pixels in the vertical direction of the G channel of the plaintext image. Figure 8 (c) shows the correlation analysis results of adjacent pixels in the diagonal direction of the B channel of the plaintext image. Figure 8 (d) shows the correlation analysis result of adjacent pixels in the horizontal direction of the R channel of the final encrypted image. Figure 8 (e) shows the correlation analysis result of adjacent pixels in the vertical direction of the G channel of the final encrypted image. Figure 8 (f) shows the result of the correlation analysis of adjacent pixels in the diagonal direction of channel B of the final encrypted image. As can be seen from the figure, the correlation distribution of adjacent pixels of the plaintext image in different directions of different channels tends to a straight line, which shows that the correlation between adjacent pixels of the plaintext image is very high, while the pixel distribution of adjacent pixels of the final encrypted image in different directions of different channels is random and evenly distributed in the rectangular area of the image, which shows that the encrypted image breaks the correlation between adjacent pixels of the original image.
[0156] The correlation coefficients between adjacent pixels of the four target images of Cat, Lena, House, and Car are calculated respectively, and the calculation results are shown in Table 2:
[0157] Table 2
[0158]
[0159] Among them, H represents the correlation between adjacent pixels in the horizontal direction, V represents the correlation between adjacent pixels in the vertical direction, and D represents the correlation between adjacent pixels in the diagonal direction.
[0160] The following is an exemplary description of the effect of the image encryption method of the present application in resisting attacks in combination with multiple experiments.
[0161] Key performance includes key space and key sensitivity. The larger the key space, the more possibilities it has for encrypting or decrypting keys in the system. The method of this application can use the hash algorithm to generate a hash key with a length of 512, which is sufficient to resist the attacker's exhaustive attack. The higher the key sensitivity, the stronger its ability to resist differential attacks. Taking the target image House in the above text as an example, the key sensitivity analysis results are as follows: Fig. 9 As shown, Fig. 9 (a) represents the original House image, Fig. 9 (b) indicates using key a+10 -12 The decrypted image of Fig. 9 (c) indicates the use of key b+10 -12 The decrypted image of Fig. 9 (d) means using key x0+10 -12 The decrypted image of Fig. 9 (e) indicates using the key y0+10 -12 The decrypted image of Fig. 9 (f) shows the decrypted House image using the correct key.
[0162] A differential attack is an attack method that attacks an encryption algorithm by comparing and analyzing the difference propagation between two ciphertext images obtained by comparing and analyzing two plaintext images with specific differences. In order to resist differential attacks, the encryption algorithm needs to be very sensitive to the plaintext image, that is, a slight change in the plaintext image will cause a huge change in the ciphertext image. The number of changing pixel rate (NPCR) and the unified average changed intensity (UACI) can be used to measure the difference between the encrypted ciphertext images of two slightly changed plaintext images. The NPCR and UACI values of the four target images in the above text, respectively, before and after the original images of the three channels of R, G, and B are slightly changed, are shown in Table 3;
[0163] Table 3
[0164]
[0165] As can be seen from the table, the NPCR value is close to 100%, indicating that the pixel change rate of the ciphertext image obtained by a small change in the plaintext image is very high, that is, the plaintext sensitivity is high. UACI is also close to the ideal value of 33.4635%, indicating that the plaintext sensitivity of the method of this application is very high and can resist differential attacks well.
[0166] In addition to having good security and being able to resist various common attacks, image encryption algorithms also need to have good operating efficiency to meet actual needs. In order to test the operating performance of the method of this application, images of different sizes were selected, and the time required for encryption and decryption was recorded, and compared with the encryption and decryption time required by other image encryption algorithms. The test results are shown in Table 4:
[0167] Table 4
[0168]
[0169] It can be seen from this that the method of the present application has a better operating efficiency.
[0170] In order to quantitatively analyze the hiding efficiency of the method of this application, the normalized peak signal-to-noise ratio (PSNR) between the carrier image and the final encrypted image is tested. PSNR is an objective standard for evaluating image quality. The higher the PSNR value, the smaller the distortion of the carrier image after embedding and the better the hiding effect. The PSNR values of the method of this application and other methods are shown in Table 5:
[0171] Table 5
[0172]
[0173] It can be seen that the PSNR value of the method of the present application is above 36 dB, which has a good hiding effect.
[0174] The image encryption device provided in this application is exemplarily described below.
[0175] like Fig.10 As shown, an embodiment of the present application provides an image encryption device, and the image encryption device 1300 includes:
[0176] The acquisition module 1001 acquires a target image and a carrier image; the target image is an image to be encrypted, and the carrier image is used to hide the target image;
[0177] A construction module 1002 is used to construct a two-dimensional chaotic system based on cosine function and sine function, and obtain system parameters and initial values of the two-dimensional chaotic system using the target image;
[0178] Iteration module 1003, using the target image, system parameters and initial values to iterate the two-dimensional chaotic system for multiple times, to obtain a first chaotic matrix, a second chaotic matrix and a third chaotic matrix; the elements in the first chaotic matrix are random 0 or 1, and the dimensions of the second chaotic matrix and the third chaotic matrix are the same as the dimensions of the target image;
[0179] The block division module 1004 extracts the channel images of the three color channels of the target image, and divides the channel images into a plurality of image blocks for each channel image, and converts each image block into a cell array; the cell array is used to describe the pixel values of all pixels in the corresponding image block;
[0180] A scrambling module 1005 scrambles all cell arrays using a first chaotic matrix to obtain a scrambled image of a target image;
[0181] Diffusion module 1006, using the second chaotic matrix and the third chaotic matrix to diffuse the pixel value of each pixel in the scrambled image to obtain a ciphertext image of the target image; the ciphertext image is used to describe all disordered pixel values in the target image;
[0182] The embedding module 1007 performs discrete cosine transform on each color channel of the carrier image to obtain the color component corresponding to each color channel, and embeds the ciphertext image into all the color components to obtain the final encrypted image of the target image.
[0183] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0184] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0185] like Fig.11 As shown, an embodiment of the present application provides a terminal device. The terminal device D10 of this embodiment includes: at least one processor D100 ( Fig.11 Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the steps of any of the above-mentioned method embodiments when executing the computer program D102.
[0186] Specifically, when the processor D100 executes the computer program D102, the chaotic characteristics of the two-dimensional chaotic system constructed based on the cosine function and the sine function are improved, and the target image is scrambled and diffused by using the two-dimensional chaotic system with high chaotic characteristics, which can effectively improve the encryption effect and efficiency. At the same time, the second chaotic matrix and the third chaotic matrix are used for diffusion to improve the randomness of the ciphertext image, and the ciphertext image is embedded in the carrier image, so that the final encrypted image is visually the carrier image, further improving the security of image encryption.
[0187] The processor D100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0188] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC, SmartMedia Card), a secure digital (SD, Secure Digital) card, a flash card (Flash Card), etc. equipped on the terminal device D10. Further, the memory D101 may also include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory D101 may also be used to temporarily store data that has been output or is to be output.
[0189] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0190] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0191] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the image encryption method device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0192] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0193] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0194] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image encryption method, It is characterized in that include: Acquire a target image and a carrier image; The target image is an image that needs to be encrypted, and the carrier image is used to hide the target image; Constructing a two-dimensional chaotic system based on cosine function and sine function, and using the target image to obtain system parameters and initial values of the two-dimensional chaotic system; The two-dimensional chaotic system is iterated multiple times using the target image, the system parameters and the initial values to obtain a first chaotic matrix, a second chaotic matrix and a third chaotic matrix; the elements in the first chaotic matrix are random 0 or 1, and the dimensions of the second chaotic matrix and the third chaotic matrix are the same as the dimension of the target image; Extracting channel images of three color channels of the target image, and dividing each channel image into a plurality of image blocks, and converting each image block into a cell array; the cell array is used to describe the pixel values of all pixels in the corresponding image block; Using the first chaotic matrix to scramble all cell arrays to obtain a scrambled image of the target image; Using the second chaotic matrix and the third chaotic matrix to diffuse the pixel value of each pixel in the scrambled image, a ciphertext image of the target image is obtained; the ciphertext image is used to describe all disordered pixel values in the target image; Performing discrete cosine transform on each color channel of the carrier image to obtain a color component corresponding to each color channel, and embedding the ciphertext image into all color components to obtain a final encrypted image of the target image; Wherein, the two-dimensional chaotic system is: ; in, For the The first state variable of the two-dimensional chaotic system at the iteration, For the The second state variable of the two-dimensional chaotic system at the iteration, For the The first state variable of the two-dimensional chaotic system at the iteration, For the The second state variable of the two-dimensional chaotic system at the iteration, and are the system parameters to be solved. represents the sine function, represents the cosine function, , Indicates the number of iterations.
2. The image encryption method according to claim 1, It is characterized in that The method of using the target image to obtain the system parameters and initial values of the two-dimensional chaotic system includes: Based on the target image, obtaining a hash key using a hash algorithm; By formula: ; Calculate the system parameters of the two-dimensional chaotic system , , the initial value of the first state variable , the initial value of the second state variable ; in, represents the modulo operation, Represents a bitwise exclusive OR operation, represents the first hash subkey, represents the second hash subkey, represents the third hash subkey, represents the fourth hash subkey, represents the fifth hash subkey, represents the sixth hash subkey, represents the seventh hash subkey, Represents the eighth hash subkey: ; in, , Indicates the first Bit character, Indicates the first Bit character, Indicates the first bit character.
3. The image encryption method according to claim 1, It is characterized in that The method of performing multiple iterations of the two-dimensional chaotic system using the target image, the system parameters and the initial value to obtain a first chaotic matrix, a second chaotic matrix and a third chaotic matrix comprises: Let the number of iterations ; in, represents the number of pixel rows of the target image, represents the number of pixel columns of the target image, Indicates the preset iteration threshold; Substitute the system parameters and the initial values into the two-dimensional chaotic system to perform Iterations, get the initial sequence of the first state variable and the initial sequence of the second state variable ; in, represents the value of the first state variable at the first iteration, represents the value of the first state variable at the second iteration, Indicates The value of the first state variable at iteration , represents the value of the second state variable at the first iteration, represents the value of the second state variable at the second iteration, Indicates The value of the second state variable at the iteration; The first elements are removed to obtain the final sequence; A first chaotic matrix, a second chaotic matrix, and a third chaotic matrix are obtained based on all the final sequences.
4. The image encryption method according to claim 3, It is characterized in that The step of obtaining a first chaotic matrix, a second chaotic matrix and a third chaotic matrix based on all final sequences comprises: By formula: ; Calculate the first chaos matrix The second chaotic matrix and the third chaotic matrix ; in, , , , represents the reconstruction function, represents the first chaotic sequence, represents the second chaotic sequence, Represents the third chaotic sequence: ; in, Indicates rounding down. represents the modulo operation, Indicates taking the absolute value, represents the first state variable in the final sequence Iteration to The values of the 12 first state variables at iterations, The final sequence of the second state variable Iteration to Iteration The value of the second state variable, represents the first state variable in the final sequence Iteration to Iteration The value of the first state variable.
5. The image encryption method according to claim 1, It is characterized in that The step of dividing the channel image into a plurality of image blocks and converting each image block into a cell array includes: By formula: ; Get all cell arrays of the red channel channel image , all cell arrays of the channel images of the green channel and all cell arrays of the channel images of the blue channel ; in, Represents the data type conversion function, represents the channel image of the red channel, represents the channel image of the green channel, represents the channel image of the blue channel, represents the number of pixel rows of the target image, represents the number of pixel columns of the target image, Represents the division operation of the channel image, Represents the number of pixel rows in the image block, Represents the number of pixel columns in the image block.
6. The image encryption method according to claim 1, It is characterized in that The step of scrambling all cell arrays using the first chaotic matrix to obtain a scrambled image of the target image includes: By formula: ; Get channel image No. Line Scrambled array of cell arrays of columns ; in, , , ,when When the channel image is the channel image of the red channel, when When the channel image is the channel image of the blue channel, when When the channel image is the channel image of the green channel, Represents the channel image No. Line cell array of columns, Indicates that in the first chaotic matrix Line Ledi The element of dimension, represents the Arnold transform, represents the Hilbert transform, Indicates the key value. , , Indicates the number of scrambling times, , , and All are preset parameters. represents the order of the Hilbert curve; All scrambled arrays are integrated to obtain a scrambled image of the target image.
7. The image encryption method according to claim 1, It is characterized in that The step of using the second chaotic matrix and the third chaotic matrix to diffuse the pixel value of each pixel in the scrambled image to obtain the ciphertext image of the target image includes: when and When, through the formula: ; Get the first Line Columns of pixels in channel The diffuse pixel value ; in, ,when When, channel For the red channel, When, channel For the blue channel, When, channel For the green channel, , represents the number of pixel rows of the target image, , represents the number of pixel columns of the target image, Indicates the scrambled image Line The pixel values of the pixels in the column at random color channels, Indicates the first chaotic matrix Line Randomize the elements of the columns, represents the modulo operation, represents cyclic diffusion; when and When, through the formula: ; Get the first Line Columns of pixels in channel The diffuse pixel value ; in, Indicates the scrambled image Line The diffuse pixel values of the pixels in the column in the random color channel, Indicates the first chaotic matrix Line Ledi Dimensional elements; when and When, through the formula: ; Get the first Line Columns of pixels in channel The diffuse pixel value ; in, Indicates the scrambled image Line The diffuse pixel values of the pixels in the column in random color channels; For each pixel in the scrambled image, all diffused pixel values of the pixel are merged to obtain a final pixel value of the pixel; The final pixel values of all pixels in the scrambled image are integrated to obtain a ciphertext image of the target image.
8. The image encryption method according to claim 1, It is characterized in that The step of embedding the ciphertext image into all color components to obtain a final encrypted image of the target image comprises: By formula: ; Get the embedded component of the red channel , the embedded component of the green channel and the embedded component of the blue channel ; in, represents the color component of the red channel of the carrier image, represents the color component of the green channel of the carrier image, represents the color component of the blue channel of the carrier image, represents the embedding coefficient, represents the pixel values of all pixels in the red channel of the ciphertext image, represents the pixel values of all pixels in the green channel of the ciphertext image, Represents the pixel values of all pixels in the blue channel of the ciphertext image; Performing an inverse discrete cosine transform on each of the embedded components to obtain an embedded channel image corresponding to each of the embedded components; All embedded channel images are merged to obtain the final encrypted image of the target image.
9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the image encryption method according to any one of claims 1 to 8 is implemented.
