Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, one objective of the present invention is to provide a color image encryption method, which effectively avoids the complexity of a single-channel processing manner, can hide meaningful contents of an image, and can be applied to the field of multimedia information security.
Another object of the present invention is to provide a color image encryption apparatus.
In order to achieve the above object, an embodiment of an aspect of the present invention provides a color image encryption method, including the following steps: step S1: encoding the color image into a first quaternion matrix; step S2: dividing the quaternion matrix into sub-blocks which are not overlapped with each other, and modulating and carrying out quaternion Gyrator transformation on each sub-block to obtain a second quaternion matrix; step S3: extracting a real part component and first to third imaginary part components of the second quaternion matrix, and constructing a first complex matrix and a second complex matrix according to the real part component and the first to third imaginary part components; step S4: performing multi-resolution decomposition on the first complex matrix and the second complex matrix to obtain an approximate component and a detail component, and recombining according to the approximate component and the detail component to obtain a third complex matrix and a fourth complex matrix; step S5: and carrying out Gyrator transformation with an angle of beta on the third complex matrix and the fourth complex matrix to respectively obtain a first ciphertext image and a second ciphertext image.
The color image encryption method of the embodiment of the invention expresses the color image as a quaternion matrix to carry out integral coding and processing, avoids the complexity of a single-channel processing mode, can hide the meaningful content of the image, and can be applied to the field of multimedia information safety.
In addition, the color image encryption method according to the above embodiment of the present invention may further have the following additional technical features:
further, in one embodiment of the present invention, the first quaternion matrix is:
fq(x,y)=ifR(x,y)+jfG(x,y)+kfB(x,y),
wherein, (x, y) represents spatial domain coordinates; i. j and k satisfy: i.e. i2=j2=k2=-1,ij=k,ji=-k,jk=i,kj=-i,ki=j,ik=-j;fR(x,y)、fG(x, y) and fB(x, y) correspond to the red, green, and blue color components of the color image, respectively.
Further, in an embodiment of the present invention, the formula for dividing the quaternion matrix into sub-blocks that do not overlap with each other is as follows:
wherein, mu1Is any unit pure four element number, mu ═ i gamma1+jγ2+kγ3And mu2=-1,γ1、γ2And gamma3Are all real numbers, Z is a random matrix and Z is ∈ [0,1 ]]。
Further, in one embodiment of the present invention, the quaternion Gyrator transform formula is:
where (u, v) are frequency domain coordinates and μ is an arbitrary unit pure quaternion.
Further, in an embodiment of the present invention, the calculation formula of the first complex matrix and the second complex matrix is:
where S real component, X, Y and Z are the first imaginary component, the second imaginary component and the third imaginary component, respectively.
In order to achieve the above object, another embodiment of the present invention provides a color image encryption apparatus, including: an encoding module for encoding the color image into a first quaternion matrix; the dividing module is used for dividing the quaternion matrix into non-overlapping sub-blocks, and modulating and quaternion Gyrator transforming each sub-block to obtain a second quaternion matrix; an extracting module, configured to extract a real component and first to third imaginary components of the second quaternion matrix, and construct a first complex matrix and a second complex matrix according to the real component and the first to third imaginary components; the decomposition module is used for carrying out multi-resolution decomposition on the first complex matrix and the second complex matrix to obtain an approximate component and a detail component, and recombining the approximate component and the detail component to obtain a third complex matrix and a fourth complex matrix; and the transformation module is used for carrying out Gyrator transformation with an angle of beta on the third complex matrix and the fourth complex matrix to respectively obtain a first ciphertext image and a second ciphertext image.
The color image encryption device of the embodiment of the invention expresses the color image as a quaternion matrix to carry out integral coding and processing, avoids the complexity of a single-channel processing mode, can hide the meaningful content of the image, and can be applied to the field of multimedia information safety.
In addition, the color image encryption apparatus according to the above-described embodiment of the present invention may further have the following additional technical features:
further, in one embodiment of the present invention, the first quaternion matrix is:
fq(x,y)=ifR(x,y)+jfG(x,y)+kfB(x,y),
wherein, (x, y) represents spatial domain coordinates; i. j and k satisfy: i.e. i2=j2=k2=-1,ij=k,ji=-k,jk=i,kj=-i,ki=j,ik=-j;fR(x,y)、fG(x, y) and fB(x, y) correspond to the red, green, and blue color components of the color image, respectively.
Further, in an embodiment of the present invention, the formula for dividing the quaternion matrix into sub-blocks that do not overlap with each other is as follows:
wherein, mu1Is any unit pure four element number, mu ═ i gamma1+jγ2+kγ3And mu2=-1,γ1、γ2And gamma3Are all real numbers, Z is a random matrix and Z is ∈ [0,1 ]]。
Further, in one embodiment of the present invention, the quaternion Gyrator transform formula is:
where (u, v) are frequency domain coordinates and μ is an arbitrary unit pure quaternion.
Further, in an embodiment of the present invention, the calculation formula of the first complex matrix and the second complex matrix is:
where S real component, X, Y and Z are the first imaginary component, the second imaginary component and the third imaginary component, respectively.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
A color image encryption method and apparatus proposed according to an embodiment of the present invention will be described below with reference to the accompanying drawings, and first, a color image encryption method proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 1 is a flowchart of a color image encryption method according to an embodiment of the present invention.
As shown in fig. 1, the color image encryption method includes the steps of:
step S1: the color image is encoded as a first quaternion matrix.
It should be noted that, the embodiment of the present invention provides a color image encryption method based on quaternion Gyrator transformation and multi-resolution decomposition, and an encryption flow is shown in fig. 1. The specific process is described as follows:
specifically, as shown in fig. 2, the embodiment of the present invention first represents a color image f (x, y) of size N × M as a pure four-element number matrix fq(x, y), namely:
fq(x,y)=ifR(x,y)+jfG(x,y)+kfB(x,y),
wherein: (x, y) represents spatial domain coordinates; i. j and k satisfy: i.e. i2=j2=k2=-1,ij=k,ji=-k,jk=i,kj=-i,ki=j,ik=-j;fR(x,y)、fG(x, y) and fB(x, y) correspond to the red, green, and blue color components of the color image, respectively.
Step S2: and dividing the quaternion matrix into non-overlapping sub-blocks, and modulating and carrying out quaternion Gyrator transformation on each sub-block to obtain a second quaternion matrix.
Specifically, as shown in FIG. 2, a pure four-element number matrix f is formedq(x, y) are divided into 2 x 2 non-overlapping sub-blocks, namely:
constructing a phase function
Wherein: mu.s
1Is any unit pure four-element number, i.e. mu ═ i gamma
1+jγ
2+kγ
3And mu
2=-1,{γ
1,γ
2,γ
3Is a real number; z is a random matrix and Z is an element of [0,1 ]]。
Each sub-block is modulated and subjected to quaternion Gyrator transformation with an angle alpha, namely:
G11=Gα{f11·P}
wherein, the formula for calculating the quaternion Gyrator transformation is as follows,
here, (u, v) are frequency domain coordinates, and μ is an arbitrary unit pure four element number. It is to be noted that the pair matrix fqOther types of quaternion transformations may also be performed.
Combining the transformation results obtained by each sub-block into a quaternion matrix G, namely:
step S3: and extracting a real part component and first to third imaginary part components of the second quaternion matrix, and constructing to obtain a first complex matrix and a second complex matrix according to the real part component and the first to third imaginary part components.
Specifically, as shown in fig. 2, the real component S and three imaginary component matrices X, Y, Z of the quaternion matrix G are extracted, and two complex matrices C are constructed1、C2:
Step S4: and performing multi-resolution decomposition on the first complex matrix and the second complex matrix to obtain an approximate component and a detail component, and recombining according to the approximate component and the detail component to obtain a third complex matrix and a fourth complex matrix.
Specifically, as shown in FIG. 2, for matrix C1、C2Performing discrete waveletTransforming to realize multi-resolution decomposition, and recombining the approximate components and detail components obtained by transformation into a new complex matrix A1、A2。
Step S5: and performing Gyrator transformation with an angle of beta on the third complex matrix and the fourth complex matrix to respectively obtain a first ciphertext image and a second ciphertext image.
Specifically, as shown in FIG. 2, the complex matrices A1 and A2 are subjected to Gyrator transformation at an angle β to obtain ciphertext images E1 and E2,
E1=Gβ{A1},
E2=Gβ{A2},
wherein, the calculation formula of the Gyrator conversion is as follows,
here, μ is an arbitrary unit pure four-element number. It is to be noted that the pair matrix fqOther types of quaternion transformations may also be performed. By performing the inverse operation on the encryption process, the original plaintext image can be recovered.
Further, to verify the effectiveness and feasibility of the method of the present invention, color images Lena (see fig. 3) were selected and tested, the image size was 512 × 512, α is 0.5377, β is 0.9134, and the unit of pure four-element number μ
1=0.2673i+0.5345j+0.8018k,
According to the above encryption method, the obtained ciphertext image is shown in fig. 4(a) and (b), the information of the ciphertext image is disordered, no information of the original plaintext image can be seen, the correct key is used for decryption, the peak signal-to-noise ratio is 300.6094, the structural similarity is 1.0, and the decrypted image is consistent with the original image.
In summary, based on quaternion Gyrator transformation and multi-resolution decomposition, the embodiment of the present invention provides a color image encryption method, which specifically includes: (1) representing the color image as a pure four-element number matrix; (2) dividing the quaternion matrix into non-overlapping sub-blocks, and performing modulation and quaternion Gyrator transformation; (3) representing the frequency spectrum of the sub-block as two complex matrices; (4) performing multi-resolution decomposition on the two complex matrixes respectively; (5) and carrying out Gyrator transformation on the decomposed matrix to obtain a ciphertext.
According to the color image encryption method provided by the embodiment of the invention, the color image is represented as a quaternion matrix to be subjected to integral coding and processing, the complexity of a single-channel processing mode is avoided, the meaningful content of the image can be hidden, and the method can be applied to the field of multimedia information security.
Next, a color image encryption apparatus proposed according to an embodiment of the present invention is described with reference to the drawings.
Fig. 6 is a schematic structural diagram of a color image encryption apparatus according to an embodiment of the present invention.
As shown in fig. 6, the color image encryption apparatus 10 includes: an encoding module 100, a partitioning module 200, an extraction module 300, a decomposition module 400, and a transformation module 500.
The encoding module 100 is configured to encode the color image into a first quaternion matrix. The dividing module 200 is configured to divide the quaternion matrix into non-overlapping sub-blocks, and perform modulation and quaternion Gyrator conversion on each sub-block to obtain a second quaternion matrix. The extracting module 300 is configured to extract a real component and first to third imaginary components of the second quaternion matrix, and construct a first complex matrix and a second complex matrix according to the real component and the first to third imaginary components. The decomposition module 400 is configured to perform multi-resolution decomposition on the first complex matrix and the second complex matrix to obtain an approximate component and a detail component, and recombine the approximate component and the detail component to obtain a third complex matrix and a fourth complex matrix. The transformation module 500 is configured to perform Gyrator transformation with an angle β on both the third complex matrix and the fourth complex matrix to obtain a first ciphertext image and a second ciphertext image, respectively. The device 10 of the embodiment of the invention effectively avoids the complexity of a single-channel processing mode, can hide meaningful contents of images, and can be applied to the field of multimedia information safety.
Further, in one embodiment of the present invention, the first quaternion matrix is:
fq(x,y)=ifR(x,y)+jfG(x,y)+kfB(x,y),
wherein, (x, y) represents spatial domain coordinates; i. j and k satisfy: i.e. i2=j2=k2=-1,ij=k,ji=-k,jk=i,kj=-i,ki=j,ik=-j;fR(x,y)、fG(x, y) and fB(x, y) correspond to the red, green, and blue color components of the color image, respectively.
Further, in an embodiment of the present invention, the formula for dividing the quaternion matrix into sub-blocks that do not overlap with each other is:
wherein, mu1Is any unit pure four element number, mu ═ i gamma1+jγ2+kγ3And mu2=-1,γ1、γ2And gamma3Are all real numbers, Z is a random matrix and Z is ∈ [0,1 ]]。
Further, in one embodiment of the present invention, the quaternion Gyrator transform formula is:
where (u, v) are frequency domain coordinates and μ is an arbitrary unit pure quaternion.
Further, in an embodiment of the present invention, the calculation formula of the first complex matrix and the second complex matrix is:
where S real component, X, Y and Z are the first imaginary component, the second imaginary component and the third imaginary component, respectively.
It should be noted that the foregoing explanation of the embodiment of the color image encryption method is also applicable to the color image encryption apparatus of this embodiment, and details are not repeated here.
According to the color image encryption device provided by the embodiment of the invention, the color image is represented as a quaternion matrix to be subjected to integral coding and processing, the complexity of a single-channel processing mode is avoided, the meaningful content of the image can be hidden, and the color image encryption device can be applied to the field of multimedia information safety.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.