Disclosure of Invention
In order to solve the problems of the prior art, the invention aims to overcome the defects of the prior art and provide an information hiding method and system based on elliptic curve cryptography. Compared with the traditional chaos mapping picture encryption mode, the method has the advantages of better encryption effect and higher safety.
In order to achieve the purpose of the invention, the invention adopts the following technical scheme:
an information hiding method based on elliptic curve cryptography comprises the following steps:
a. the key is generated using a cryptosystem based on elliptic curves over a finite field as follows:
selecting a definition in prime number field FpUpper elliptic curve:
E:y2≡x3+ax+b(mod p)
forming a basic elliptic curve of an MVECC encryption system;
b. selecting a base point alpha and a private key K of a communication party A and a communication party BAAnd KB;
Calculating PA=KA·α,PB=KB·α,PAAnd PBPublic keys of A and B, respectively, andcomputing a cryptographic secret (c)1,c2)=KB·PA=KA·PB;
c. Taking an initial secret key v; then get
Wherein
To round down;
ν′01=c1·ν01mod p
ν′02=c2·ν02mod p
the ciphertext is ((c)
1,c
2),ν′
01,ν′
02) Thereby to make
Namely the encrypted secret key v';
d. after generating a new secret key according to the steps, encrypting the picture by utilizing chaotic mapping (#),
wherein n represents iteration times, x (n) represents an element value of the chaotic sequence, y (n) represents an element value of the chaotic sequence, x (0) represents an initial value, y (0) represents an initial value, j represents a summed element value index of the chaotic sequence, a 'represents an encrypted parameter, b' represents an encrypted parameter, v is an initial key, and Γ (v) represents a gamma function; generating a group of chaotic sequences by using chaotic mapping (#), rearranging pixels of a digital image by using a bubble sorting algorithm, and scrambling pixel values of a plaintext image;
and then carrying out XOR operation by using the pixel value and the chaotic sequence, thereby realizing the encryption of the pixel value.
Preferably, in step a, the prime number p is 100003; the coefficient a is 1; the coefficient b is 6.
Preferably, in saidIn the step B, selecting a private key K of alpha ═ (2,4) and A and B of two communication partiesAAnd KB(ii) a Wherein, KA=9768,KB=1024;
Computing private keys P of A and B, respectivelyA=KA·α=(69813,58395),PB=KBα ═ 77633, 41271, and the encryption key (c) is recalculated1,c2)=KB·PA=KA·PB=(56454,22881)。
Preferably, in the step c, if the initial key v is 6.608614792; then the process of the first step is carried out,
ν′01=c1·x1 mod p=7123mod p
ν′02=c2·x2 mod p=45600mod p
the ciphertext is ((77633, 41271), 7123, 45600), such that
Is the encrypted key v.
Preferably, in said step d, a 'is 1.4 and b' is 4.
Preferably, in the step d, generating a set of chaotic sequences by using chaotic map (, includes:
d-1. making x (1) equal to the initial value x0Iterating the formula (x) MN-1 times, where M and N are the length and width of the original image V, respectively, thus producing a one-dimensional real-valued chaotic sequence x (i '), i' 1, 2.. said., MN;
d-2, reordering x (k) by using a bubble sorting method, thus obtaining x' (k), then recording the index change of x (k), and storing as z (k);
d-3, changing the original M multiplied by N picture V into a sequence V (k) of 1 multiplied by MN, rearranging the sequence V (k) and the sequence x (k) according to z (k) to obtain a sequence V' (k);
d-4. the sequence V ' (k) is changed into m × n pictures and is marked as V ', wherein V ' is the obtained encrypted picture.
Preferably, in the step a, the plaintext picture is subjected to data blocking and then encrypted; in the step d, after the encryption of the pixel values is completed, data merging is performed, and ciphertext transmission is performed.
The invention discloses an information hiding system based on elliptic curve cryptography, which is implemented to scramble pixel values of a plaintext picture and encrypt the pixel values.
Compared with the prior art, the invention has the following obvious and prominent substantive characteristics and remarkable advantages:
1. the method comprises the steps of firstly generating a group of chaotic sequences by utilizing chaotic mapping (#), realizing rearrangement of pixels of a digital image by utilizing a bubble sorting algorithm, realizing scrambling of pixel values, and secondly carrying out exclusive or operation by utilizing the pixel values and the chaotic sequences to realize encryption of the pixel values;
2. the image encryption algorithm has a more complex algorithm structure and a large secret key space, so that the encryption is safer;
3. the method is easy to realize, the data volume is lower, the encryption cost is low, and the image quality after decryption is high.
Detailed Description
The above-described scheme is further illustrated below with reference to specific embodiments, which are detailed below:
the first embodiment is as follows:
in this embodiment, referring to fig. 1, an information hiding method based on elliptic curve cryptography includes the following steps:
a. the key is generated using a cryptosystem based on elliptic curves over a finite field as follows:
selecting a definition in prime number field FpUpper elliptic curve:
E:y2≡x3+ax+b(mod p)
forming a basic elliptic curve of an MVECC encryption system;
b. selecting a base point alpha and a private key K of a communication party A and a communication party BAAnd KB;
Calculating PA=KA·α,PB=KB·α,PAAnd PBPublic keys of A and B, respectively, and then calculating an encryption key (c)1,c2)=KB·PA=KA·PB;
c. Taking an initial secret key v; then get
Wherein
To round down;
ν′01=c1·ν01 mod p
ν′02=c2·ν02 mod p
the ciphertext is ((c)
1,c
2),ν′
01,ν′
02) Thereby to make
Namely the encrypted secret key v';
d. after generating a new secret key according to the steps, encrypting the picture by utilizing chaotic mapping (#),
wherein n represents iteration times, x (n) represents an element value of the chaotic sequence, y (n) represents an element value of the chaotic sequence, x (0) represents an initial value, y (0) represents an initial value, j represents a summed element value index of the chaotic sequence, a 'represents an encrypted parameter, b' represents an encrypted parameter, v is an initial key, and Γ (v) represents a gamma function; generating a group of chaotic sequences by using chaotic mapping (#), rearranging pixels of a digital image by using a bubble sorting algorithm, and scrambling pixel values of a plaintext image;
and then carrying out XOR operation by using the pixel value and the chaotic sequence, thereby realizing the encryption of the pixel value.
In the embodiment, the information hiding method based on elliptic curve cryptography adopts an image encryption method, and the method firstly encrypts a secret key by using an elliptic curve cryptosystem and then scrambles an image by using a discrete chaotic signal so as to achieve the purpose of encryption. Compared with the traditional chaos mapping picture encryption mode, the method has the advantages of better encryption effect and higher safety.
Example two:
this embodiment is substantially the same as the first embodiment, and is characterized in that:
in this embodiment, referring to fig. 1-2, an information hiding method based on elliptic curve cryptography is characterized by comprising the following steps:
a. the key is generated using a cryptosystem based on elliptic curves over a finite field as follows:
selecting a definition in prime number field FpUpper elliptic curve:
E:y2≡x3+ax+b(mod p)
the prime number p is 100003; the coefficient a is 1; the coefficient b is 6; forming a basic elliptic curve of an MVECC encryption system;
b. selecting a base point alpha and a private key K of a communication party A and a communication party BAAnd KB;
Calculating PA=KA·α,PB=KB·α,PAAnd PBPublic keys of A and B, respectively, and then calculating an encryption key (c)1,c2)=KB·PA=KA·PB(ii) a In this embodiment, a private key K of both communication parties a and B is selected as α ═ (2,4)AAnd KB(ii) a Wherein, KA=9768,KB1024; computing private keys P of A and B, respectivelyA=KA·α=(69813,58395),PB=KBα ═ 77633, 41271, and the encryption key (c) is recalculated1,c2)=KB·PA=KA·PB=(56454,22881);
c. Taking an initial key v as 6.608614792; then get
Wherein
To round down;
ν′01=c1·x1 mod p=7123mod p
ν′02=c2·x2 mod p=45600mod p
the ciphertext is ((77633, 41271), 7123, 45600), such that
Namely the encrypted secret key v;
d. after generating a new secret key according to the steps, encrypting the picture by utilizing chaotic mapping (#),
wherein a 'is 1.4 and b' is 4; generating a group of chaotic sequences by using chaotic mapping (#), rearranging pixels of a digital image by using a bubble sorting algorithm, and scrambling pixel values of a plaintext image;
and then carrying out XOR operation by using the pixel value and the chaotic sequence, thereby realizing the encryption of the pixel value.
Generating a set of chaotic sequences using chaotic maps (, comprising:
d-1. making x (1) equal to the initial value x0Iterating the formula (x) MN-1 times, where M and N are the length and width of the original image V, respectively, thus producing a one-dimensional real-valued chaotic sequence x (i '), i' 1, 2.. said., MN;
d-2, reordering x (k) by using a bubble sorting method, thus obtaining x' (k), then recording the index change of x (k), and storing as z (k);
d-3, changing the original M multiplied by N picture V into a sequence V (k) of 1 multiplied by MN, rearranging the sequence V (k) and the sequence x (k) according to z (k) to obtain a sequence V' (k);
d-4. the sequence V ' (k) is changed into m × n pictures and is marked as V ', wherein V ' is the obtained encrypted picture. And then carrying out XOR operation on the chaotic sequence and the image pixel value to achieve the effect of encrypting the picture.
In the information hiding method based on elliptic curve cryptography according to the embodiment, in the step a, data blocking is performed on a plaintext picture, and then encryption is performed; in the step d, after the encryption of the pixel values is completed, data merging is performed, and ciphertext transmission is performed.
Referring to fig. 2, in the image encryption process, the chaotic pseudo random sequence generator based on the differential equation is used to generate a chaotic sequence, and data rearrangement is used to realize scrambling; in this embodiment, an S-box is constructed by using a chaos pseudo-random sequence generator based on a difference equation, and data diffusion is performed according to different pixel value iterations for different times. Referring to fig. 3, fig. 3 is a diagram of the effect after the picture is encrypted according to the embodiment. Fig. 3(a) shows the original image, fig. 3(b) shows the encrypted image, and fig. 3(c) shows the decrypted image. The image encryption algorithm related to the method has a more complex algorithm structure and a large secret key space, so that the encryption is safer; the method is easy to realize, the data volume is lower, the encryption cost is low, and the image quality after decryption is high. Fig. 4 is a correlation comparison chart of the picture before and after encryption in the present embodiment. Fig. 4(a) shows an original image, and fig. 4(b) shows an encrypted picture. The method comprises the steps of firstly generating a group of chaotic sequences by utilizing chaotic mapping (#), realizing rearrangement of digital image pixels by utilizing a bubble sorting algorithm, scrambling the pixel values, and secondly carrying out XOR operation on the pixel values and the chaotic sequences to realize encryption of the pixel values. Fig. 5 is a graph comparing the curves before and after encryption and after decryption in this embodiment. Fig. 5(a) shows the original image, fig. 5(b) shows the encrypted image, and fig. 5(c) shows the decrypted image. The method of the embodiment has high image quality after decryption.
Example three:
this embodiment is substantially the same as the first embodiment, and is characterized in that:
in this embodiment, referring to fig. 1-2, an information hiding system based on elliptic curve cryptography implements the information hiding method based on elliptic curve cryptography described in the above embodiments, and scrambles pixel values of a plaintext picture and encrypts the pixel values.
To sum up, in the above embodiment, the information hiding technique based on elliptic curve cryptography adopts an elliptic curve based on a finite field as a substrate, scrambles a secret key, and generates a chaotic sequence by using fractional order chaotic mapping. The chaos sequence is utilized to be random, the plain text picture is scrambled, then the chaos sequence and the pixel value are utilized to carry out XOR operation to encrypt the picture pixel, and therefore the effects of scrambling and diffusion are achieved. According to the embodiment, the elliptic curve public key cryptography and the secret key encryption based on fractional order chaotic mapping are combined, so that the algorithm complexity is improved, the secret key space is increased, and the algorithm has better anti-attack capability.
The embodiments of the present invention have been described with reference to the accompanying drawings, but the present invention is not limited to the embodiments, and various changes and modifications can be made according to the purpose of the invention, and any changes, modifications, substitutions, combinations or simplifications made according to the spirit and principle of the technical solution of the present invention shall be equivalent substitutions, as long as the purpose of the present invention is met, and the present invention shall fall within the protection scope of the present invention without departing from the technical principle and inventive concept of the present invention.