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, an object of the present invention is to provide an image encryption method based on cascade transformation, which can encrypt and transmit multiple color images simultaneously, has high transmission efficiency and security, and can be applied to the field of visible color image encryption.
Another object of the present invention is to provide an image encryption apparatus based on the cascade transformation.
In order to achieve the above object, an embodiment of an aspect of the present invention provides an image encryption method based on a cascaded transformation, including the following steps: step S1: generating a phase mask according to the chaotic sequence; step S2: randomly generating a real integer matrix, and encoding the real integer matrix with the first color image to generate a full quaternion matrix; step S3: modulating the full quaternion matrix according to the phase mask, and carrying out quaternion Gyrator transformation to obtain a first amplitude and a first phase; step S4: coding the first amplitude and the second color image to generate a quaternion matrix, and performing amplitude truncation to obtain a second amplitude and a second phase; step S5: multiplying the first phase by the second phase, modulating the quaternion matrix according to the phase mask, and carrying out quaternion Gyrator conversion to obtain a third amplitude and a third phase; step S6: repeating the step S4 and the step S5 until an nth amplitude value and an nth phase of a last color image are obtained, wherein N is a positive integer.
The image encryption method based on the cascade transformation of the embodiment of the invention uses the quaternion matrix to represent the color image, thereby realizing the arrangement processing of different color components, the cascade quaternion Gyrator transformation avoids the iteration process, has higher efficiency, multiplies the phase after the previous image is transformed by the phase before the next image is transformed, has higher safety, and adopts the quaternion matrix to represent and encode the color image into a whole, thereby simultaneously encrypting and transmitting a plurality of color images, having higher transmission efficiency and safety, and being applicable to the field of visible color image encryption.
In addition, the image encryption method based on the cascade transformation 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 phase mask is defined as:
wherein, mu1Is an arbitrary unit pure four-element number.
Further, in an embodiment of the present invention, the full quaternion matrix is:
G1=h1+if1,R+jf1,G+kf1,B,
wherein h is1Is a matrix of real integers, f1,R、f1,GAnd f1,BRepresenting the red, green and blue color components of the first color image.
Further, in one embodiment of the present invention, the calculation formula of the amplitude and the phase is:
h2=PT[Q1],
p1=AT[Q1],
wherein the content of the first and second substances,
quaternion Gyrator transform, Q, representing a rotation angle of alpha
1Denotes the result of a conversion representing a quaternion Gyrator, h
2Is a ciphertext, p
1As a secret key, PT [. cndot]、AT[·]Respectively representing taking the amplitude and phase.
Further, in one embodiment of the present invention, the formula for calculating the quaternion Gyrator transform is:
where, (u, v) represents frequency domain coordinates.
In order to achieve the above object, another embodiment of the present invention provides an image encryption apparatus based on cascaded transformation, including: the first generation module is used for generating a phase mask according to the chaotic sequence; the second generation module is used for randomly generating a real integer matrix, and encoding the real integer matrix with the first color image to generate a full quaternion matrix; the first modulation conversion module is used for modulating and carrying out quaternion Gyrator conversion on the full quaternion matrix according to the phase mask to obtain a first amplitude and a first phase; the coding module is used for coding the first amplitude and the second color image to generate a quaternion matrix and carrying out amplitude truncation to obtain a second amplitude and a second phase; the second modulation conversion module multiplies the first phase by the second phase, and modulates and converts the quaternion matrix according to the phase mask to obtain a third amplitude and a third phase; and the processing module is used for repeatedly executing the coding module and the second modulation conversion module until the Nth amplitude value and the Nth phase of the last color image are obtained, wherein N is a positive integer.
The image encryption device based on the cascade transformation of the embodiment of the invention uses the quaternion matrix to represent the color image, thereby realizing the arrangement processing of different color components, the cascade quaternion Gyrator transformation avoids the iteration process, has higher efficiency, multiplies the phase after the previous image is transformed by the phase before the next image is transformed, has higher safety, and adopts the quaternion matrix to represent and encode the color image into a whole, thereby simultaneously encrypting and transmitting a plurality of color images, having higher transmission efficiency and safety, and being applicable to the field of visible color image encryption.
In addition, the image encryption device based on the cascade transformation 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 phase mask is defined as:
wherein, mu1Is an arbitrary unit pure four-element number.
Further, in an embodiment of the present invention, the full quaternion matrix is:
G1=h1+if1,R+jf1,G+kf1,B,
wherein h is1Is a matrix of real integers, f1,R、f1,GAnd f1,BRepresenting the red, green and blue color components of the first color image.
Further, in one embodiment of the present invention, the calculation formula of the amplitude and the phase is:
h2=PT[Q1],
p1=AT[Q1],
wherein the content of the first and second substances,
quaternion Gyrator transform, Q, representing a rotation angle of alpha
1Denotes the result of a conversion representing a quaternion Gyrator, h
2Is a ciphertext, p
1As a secret key, PT [. cndot]、AT[·]Respectively representing taking the amplitude and phase.
Further, in one embodiment of the present invention, the formula for calculating the quaternion Gyrator transform is:
where, (u, v) represents frequency domain coordinates.
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.
The image encryption method and apparatus based on the cascaded transformation proposed by the embodiment of the present invention will be described below with reference to the accompanying drawings, and first, the image encryption method based on the cascaded transformation proposed by the embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 1 is a flowchart of an image encryption method based on a cascaded transformation according to an embodiment of the present invention.
As shown in fig. 1, the image encryption method based on the cascade transformation includes the following steps:
step S1: a phase mask is generated from the chaotic sequence.
It should be noted that, the embodiment of the present invention provides a multi-color image encryption method based on a chaotic sequence and a quaternion Gyrator transform, and an encryption flow of the multi-color image encryption method is shown in fig. 2. Suppose that the color images to be encrypted are each f1(x,y)、f2(x,y)、……、fn(x, y) with dimensions of N M, (x, y) representing spatial domain coordinates. The specific process is described as follows:
in particular, embodiments of the present invention may generate a phase mask using a chaotic sequence, defined as,
sn+1=(3.57+sn/4)·sn·(1-sn)
given an initial value s0Generating the sequence S ═ S n1,2, …, NM }. Adjusting S to be a matrix Z with the size of NxM, constructing a chaotic phase mask P,
wherein mu1Is an arbitrary unit pure four-element number.
Step S2: and randomly generating a real integer matrix, and encoding the real integer matrix with the first color image to generate a full quaternion matrix.
Specifically, a real integer matrix h is randomly generated1The value of which is [0,255](ii) a And encoded with the first color image as a full quaternion matrix, i.e.:
G1=h1+if1,R+jf1,G+kf1,B,
wherein: f. of1,R、f1,GAnd f1,BRepresenting the red, green and blue color components of the first color image.
Step S3: and modulating the full quaternion matrix according to the phase mask, and carrying out quaternion Gyrator transformation to obtain a first amplitude and a first phase.
Specifically, the embodiment of the present invention performs modulation and Quaternion Gyro Transformation (QGT) on the full quaternion matrix, and obtains the amplitude and the phase.
h2=PT[Q1],
p1=AT[Q1]。
Wherein, the formula for calculating the quaternion Gyrator transformation is as follows,
here, the symbols PT [. cndot. ], AT [. cndot. ] respectively represent the amplitude and phase, μ is an arbitrary unit pure four element number, and (u, v) represents the frequency domain coordinates.
Step S4: and coding the first amplitude and the second color image to generate a quaternion matrix, and performing amplitude truncation to obtain a second amplitude and a second phase.
Specifically, the obtained amplitude and the second color image are encoded into a quaternion matrix, that is, the amplitude and the second color image are encoded into the quaternion matrix:
G2=h2+if2,R+jf2,G+kf2,B,
wherein: f. of2,R、f2,GAnd f2,BRepresenting the red, green and blue color components of the second color image. For G2Amplitude truncation coding is carried out to obtain m1=AT[G2]。
Step S5: and multiplying the first phase by the second phase, modulating the quaternion matrix according to the phase mask, and carrying out quaternion Gyrator conversion to obtain a third amplitude and a third phase.
Specifically, the embodiment of the present invention multiplies the phase in step S4 by the phase in step S3, that is,
p1n=p1m1
for quaternion matrix G in step S42Carrying out modulation and quaternion Gyrator conversion to obtain an amplitude and a phase;
h3=PT[Q2],
p2=AT[Q2]。
step S6: and repeatedly executing the step S4 and the step S5 until the Nth amplitude value and the Nth phase of the last color image are obtained, wherein N is a positive integer.
Specifically, the embodiment of the present invention repeats steps S4 and S5 until the last color image is processed to obtain the amplitude and the phase.
hn+1=AT[Qn],
pn=PT[Qn],
Wherein: gnRepresenting a quaternion matrix, h, formed by the (n-1) th quaternion Gyrator transformed amplitude and the nth color imagen+1Is a ciphertext, p1n、……、pnIs a key. The original plaintext image can be recovered by using the correct key for the ciphertext image and performing the inverse operation on the encryption process.
Further, to verify the validity and feasibility of the method of an embodiment of the inventionAlternatively, three color images (fig. 3) were selected for the experiment, the image size being 128 x 128, a being 0.1958, unit pure four,
according to the encryption method, the obtained ciphertext image is shown in fig. 4, the information of the ciphertext image can be seen to be disordered, any useful information of the original three plaintext images can not be seen, the decryption result by using the correct key is shown in fig. 5, and the peak signal-to-noise ratios are 297.8004dB, 300.8237dB and 303.7650dB respectively, so that the decrypted image is consistent with the original image.
In summary, the invention provides a multi-image encryption method based on the chaos sequence and the quaternion Gyrator transformation. The specific process comprises the following steps: (1) generating a phase mask using the chaotic sequence; (2) randomly generating a real integer matrix, and encoding the real integer matrix and the first color image into a full quaternion matrix; (3) modulating the full quaternion matrix, converting a quaternion Gyrator, and obtaining an amplitude and a phase; (4) encoding the obtained amplitude and the second color image into a quaternion matrix, and performing amplitude truncation; (5) multiplying the phase in the step (4) by the phase in the step (3), modulating the quaternion matrix in the step (4), converting the quaternion Gyrator, and obtaining the amplitude and the phase; (6) and (5) repeating the step (4) and the step (5) until the last color image is processed to obtain the amplitude and the phase.
According to the image encryption method based on the cascade transformation, the quaternion matrix is used for representing the color image, the arrangement processing of different color components is realized, the cascade quaternion Gyrator transformation avoids an iteration process, the efficiency is higher, the phase after the previous image is transformed is multiplied by the phase before the next image is transformed, the safety is higher, the quaternion matrix is used for representing and encoding the color image into a whole, and therefore the color image can be simultaneously encrypted and transmitted, the transmission efficiency and the safety are higher, and the image encryption method based on the cascade transformation can be applied to the field of visible color image encryption.
Next, an image encryption apparatus based on a cascaded transformation proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 6 is a schematic structural diagram of an image encryption apparatus based on a cascaded transformation according to an embodiment of the present invention.
As shown in fig. 6, the image encryption apparatus 10 based on the cascade transformation includes: a first generation module 100, a second generation module 200, a first modulation and transformation module 300, an encoding module 400, a second modulation and transformation module 500 and a processing module 600.
The first generating module 100 is configured to generate a phase mask according to the chaotic sequence. The second generating module 200 is configured to randomly generate a real integer matrix, and encode the real integer matrix with the first color image to generate a full quaternion matrix. The first modulation conversion module 300 is configured to modulate the full quaternion matrix according to the phase mask and perform quaternion Gyrator conversion to obtain a first amplitude and a first phase. The encoding module 400 is configured to encode the first amplitude value and the second color image, generate a quaternion matrix, and perform amplitude truncation to obtain a second amplitude value and a second phase. The second modulation and transformation module 500 multiplies the first phase by the second phase, modulates the quaternion matrix according to the phase mask, and transforms the quaternion Gyrator to obtain a third amplitude and a third phase. The processing module 600 is configured to repeatedly execute the encoding module and the second modulation and transformation module until an nth amplitude and an nth phase of the last color image are obtained, where N is a positive integer. The device 10 of the embodiment of the invention adopts the quaternion matrix to represent and encode the color images into a whole, can simultaneously encrypt and transmit a plurality of color images, has higher transmission efficiency and safety, and can be applied to the field of visible color image encryption.
Further, in one embodiment of the present invention, the phase mask is defined as:
wherein, mu1Is an arbitrary unit pure four-element number.
Further, in one embodiment of the present invention, the full quaternion matrix is:
G1=h1+if1,R+jf1,G+kf1,B,
wherein h is1Is a matrix of real integers, f1,R、f1,GAnd f1,BRepresenting the red, green and blue color components of the first color image.
Further, in one embodiment of the present invention, the calculation formula of the amplitude and the phase is:
h2=PT[Q1],
p1=AT[Q1],
wherein the content of the first and second substances,
quaternion Gyrator transform, Q, representing a rotation angle of alpha
1Denotes the result of a conversion representing a quaternion Gyrator, h
2Is a ciphertext, p
1As a secret key, PT [. cndot]、AT[·]Respectively representing taking the amplitude and phase.
Further, in one embodiment of the present invention, the formula for calculating the quaternion Gyrator transform is:
where, (u, v) represents frequency domain coordinates.
It should be noted that the foregoing explanation on the embodiment of the image encryption method based on the cascaded transformation is also applicable to the image encryption apparatus based on the cascaded transformation in this embodiment, and details are not repeated here.
According to the image encryption device based on the cascade transformation, the quaternion matrix is used for representing the color image, the arrangement processing of different color components is realized, the cascade quaternion Gyrator transformation avoids an iteration process, the efficiency is higher, the phase after the previous image is transformed is multiplied by the phase before the next image is transformed, the safety is higher, the quaternion matrix is used for representing and encoding the color image into a whole, and therefore the color image can be simultaneously encrypted and transmitted, the transmission efficiency and the safety are higher, and the image encryption device based on the cascade transformation can be applied to the field of visible color image encryption.
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 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.