IMAGE ENCRYPTION METHOD BASED ON IMPROVED CLASS BOOSTING SCHEME
20230092700 · 2023-03-23
Assignee
Inventors
- Qiang ZHANG (Dalian, CN)
- Pengfei WANG (Dalian, CN)
- Bin WANG (Dalian, CN)
- Haixiao LI (Dalian, CN)
- Rongrong CHEN (Dalian, CN)
- Xiaopeng WEI (Dalian, CN)
Cpc classification
G09C1/00
PHYSICS
H04L9/0618
ELECTRICITY
G09C5/00
PHYSICS
International classification
H04L9/00
ELECTRICITY
Abstract
The present invention discloses an image encryption method based on an improved class boosting scheme, which comprises the following steps: acquiring parameters of a hyperchaotic system according to plaintext image information: generating weights required by class perceptron networks through the plain text image information: bringing the parameters into the hyperchaotic system to obtain chaotic sequences, and shuffling the chaotic sequences by a shuffling algorithm: pre-processing the chaotic sequences after shuffling to obtain a sequence required by encryption: and bringing a plaintext image and the sequence into an improved class boosting scheme to obtain a ciphertext image, wherein the improved class boosting scheme is realized based on the class perception networks. The method solves the problems that update and prediction functions in an original boosting network are too simple and easy to predict or the like, so as to obtain the ciphertext image with higher information entropy.
Claims
1. An image encryption method based on an improved class boosting scheme, comprising; acquiring parameters of a hyperchaotic system according to plaintext image information; generating weights required by class perceptron networks through the plaintext image information; bringing the parameters into the hyperchaotic system to obtain chaotic sequences, and shuffling the chaotic sequences by a shuffling algorithm; pre-processing the chaotic sequences after shuffling to obtain a sequence required by encryption; and bringing a plaintext image and the sequence into an improved class boosting scheme to obtain a ciphertext image, wherein the improved class boosting scheme is realized based on the class perceptron networks.
2. The image encryption method based on the improved class boosting scheme according to claim 1, wherein acquiring the parameters of the hyperehaotic system according to the plaintext image information specifically comprises: generating a hash value K of the plaintext image by a SHA512 function, converting the hash value K into a binary number, and then generating 128 groups of decimal numbers H=h.sub.1, h.sub.2, h.sub.3, . . . , h.sub.128 by 4 bits in each group, and then obtaining a hyperchaotic initial value by the decimal number group H, which is specifically:
3. The image encryption method based on the improved class boosting scheme according to claim 1, wherein generating the weights required by the class perceptron networks through the plaintext image information specifically comprises: generating initial weights of two class perceptron networks by the decimal number group H=h.sub.1, h.sub.2, h.sub.3, . . . , h.sub.128, wherein weights of the class perceptron network PLN-1 are respectively:
φ.sub.11=mod(sum(h.sub.1h.sub.2. . . h.sub.32)×10.sup.10,9)
φ.sub.12=mod(sum(h.sub.33h.sub.34. . . h.sub.64)×10.sup.10,9)
φ.sub.21=mod(sum(h.sub.65h.sub.66. . . h.sub.96)×10.sup.10,9)
φ.sub.22=mod(sum(h.sub.97h.sub.98. . . h.sub.128)×10.sup.10,9) ;and weights φ′.sub.11, φ′.sub.12,φ′.sub.21,φ′.sub.22 of the perceptron network PLN-2 are respectively:
φ′.sub.11=floor(mean(h.sub.1h.sub.2 . . . h.sub.32))
φ′.sub.12=floor(mean(h.sub.33h.sub.34 . . . h.sub.64))
φ′.sub.21=floor (mean(h.sub.65h.sub.66 . . . h.sub.96))
φ′.sub.22=floor(mean(h.sub.97h.sub.98 . . . h.sub.128))
4. The image encryption method based on the improved class boosting scheme according to claim 1, wherein bringing the parameters into the hyperchaotic system to obtain the chaotic sequences, and shuffling the chaotic sequences by the shuffling algorithm specifically comprise: bringing the parameters into the hyperehaotic system to generate four sequences a.sub.1, a.sub.2, a.sub.3 and a.sub.4 with the length of M×N+300, discarding the first 300 elements of each sequence, and processing the remaining sequences as follows, so as to obtain sequences within a scope of normal plaintext pixel values, namely (i=1, 2, 3, . . . , n), wherein
b.sub.1(i)=mod(abs(floor(a.sub.1(i)×10.sup.10)) ,256)
b.sub.2(i)=mod(abs(floor(a.sub.2(i)×10.sup.10)) ,256)
b.sub.3(i)=mod(abs(floor(a.sub.3(i)×10.sup.10)) ,256)
b.sub.4(i)=mod(abs(floor(a.sub.4(i)×10.sup.10)) ,256) generating a random value array (i=1, 2, 3, . . . , n) used for a Knuth-Durstenfeld shuffling algorithm, wherein NUM is the total sequence length; and
aa.sub.1(i)=mod(abs(floor(a.sub.1(i)×10.sup.10)) ,NUM−i+1)+1
aa.sub.2(i)=mod(abs(floor(a.sub.2(i)×10.sup.10)) ,NUM−i+1)+1
aa.sub.3(i)=mod(abs(floor(a.sub.3(i)×10.sup.10)) ,NUM−i+1)+1
aa.sub.4(i)=mod(abs(floor(a.sub.4(i)×10.sup.10)) ,NUM−i+1)+1 ; and shuffling (he generated sequences by the shuffling algorithm with the generated random value array.
5. The image encryption method based on the improved class boosting scheme according to claim 1, wherein pre-processing the chaotic sequences after shuffling to obtain the sequence required by encryption specifically comprises: after shuffling the obtained sequences b.sub.1, b.sub.2, b.sub.3 and b.sub.4 with the shuffling algorithm, taking the first numbers in b.sub.1, b.sub.2, b.sub.3 and b.sub.4 arrays as a group to serve as the first four numbers in the sequence {a.sub.i}; taking the second numbers in the b.sub.1, b.sub.2, b.sub.3 and b.sub.4 arrays as a group and inserting the numbers into the sequence {a.sub.i}, repeating the above steps until there are M×N/2, numbers in the sequence {a.sub.i}, generating the required sequence {a.sub.i}, where i=1, 2, 3, . . . , M×N/2, and directly using the sequence for image encryption, wherein M is the number of rows of the plaintext image; and N is the number of columns of the plaintext image.
6. The image encryption method basal on the improved class boosting scheme according to claim 1, wherein the improved class boosting scheme comprises a forward transformation module, an overturning transformation module and an inverse transformation module; and operations in the three modules are all basal on a GF(2.sup.8) domain.
7. The image encryption method based on the improved class boosting scheme according to claim 6, wherein in the forward transformation module, the plaintext image is first converted into a one-dimensional sequence {x.sub.i}, where i=1, 2, 3, . . . , M×N; and then the sequence {x.sub.i} is divided into two subsequences {e.sub.j} and {o.sub.j}, where e.sub.j=x.sub.2j-1; o.sub.j=x.sub.2j; and j=1, 2, 3, . . . , L; a sequence {p.sub.j} is obtained from the subsequence {e.sub.j} and the sequence {a.sub.i} as follows: p.sub.j=e.sub.j+a.sub.i, where j=1,2,3, . . . , L; after the sequence {p.sub.j} is updated by the class perception network PLN-1, the sequence is combined with the subsequence {o.sub.j} to obtain a sequence {d.sub.j} as follows: d.sub.1=d.sub.j-1+o.sub.j+PLN-1(p.sub.j,p.sub.j+1), where j=1,2,3, . . . , L; d.sub.0=0; and p.sub.L+1=0; after the sequence {d.sub.j} is updated by the class perceptron network PLN-2, the sequence is combined with the sequence {p.sub.j} to obtain a sequence {s.sub.j} as follows: s.sub.j=p.sub.j+p.sub.j-1+PLN-2(d.sub.j-1,d.sub.j), where j=1,2,3, . . . , L; and d.sub.0=0; and P.sub.0=0; and the obtained sequences {s.sub.j} and {d.sub.j} are combined into a new sequence {r.sub.i}, where i=1,2,3, . . . , M×N; R.sub.2j-1=S.sub.j; R.sub.2J=D.sub.j; and j=1, 2, 3, . . . , L.
8. The image encryption method based on the improved boosting scheme according to claim 7, wherein in the forward transformation module, the sequence {r.sub.j}, where i=1, 2, 3, . . . , M×N, is flipped left and right in the overturning module to obtain a new sequence {r′.sub.i}, where i=1, 2, 3, . . . , M×N.
9. The image encryption method based on the improved boosting scheme according to claim 8, wherein in the forward transformation module, the sequence {r′.sub.i} is divided into two different sequences {s′.sub.j} and {d′.sub.j} according to an odd-even index in the inverse transformation module, where s′.sub.j=r′.sub.2j-1; d′.sub.j=r′.sub.2j; and j=1,2,3, . . . , L; after the sequence {d′.sub.j} is updated by the class perceptron network PLN-2, the seqence is combined with the sequence {s′.sub.j} to obtain a sequence {S′.sub.j} as follows: S′.sub.j=s′j−S′.sub.j-1−PLN-2(d′.sub.j-1,d′.sub.j), where j=1,2,3, . . . L; d′.sub.0=0; and S′.sub.0=0; after {S′.sub.j} is updated by the class perceptron network PLN-1, the sequence is combined with the sequence {d′.sub.j} to obtain a sequence {o′.sub.j} as follows: o′.sub.j=d′.sub.j−d′.sub.j-1−PLN-1(S′.sub.j, S′.sub.j+1), where j=1,2,3, . . . L; d′.sub.0=0; and S′.sub.L+1=0; a sequence {e′.sub.j} obtained from the sequence {S′.sub.j} and the sequence {a.sub.i} is: e′.sub.j=S′.sub.j−a.sub.i, where j=1,2,3, . . . L; {e′.sub.j} and {o′.sub.j} are combined into a new sequence {y.sub.i}, where i=1, 2, 3, . . . , M×N; Y.sub.2j-1=e′.sub.j; Y.sub.2j=o′.sub.j; and j=1,2,3, . . . L; and finally, the obtained sequence is converted into a matrix with the size of M×N, that is, an encrypted image is obtained.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0046]
[0047]
[0048]
[0049]
[0050]
DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] The present invention comprises the following steps: firstly, generating a HASH value of a plait/text image by a HAS512 function, generating parameters required by a hyperchaotic system and weights required by class perceptron networks by the HASH value; secondly, shuffling generated chaotic sequences by a shuffling algorithm; and finally, bringing an obtained random sequence and the plaintext image into an improved class boosting scheme to obtain a final ciphertext image. In the process of decryption, the plaintext image can be recovered without any loss only by bringing the ciphertext image and a key into the improved class boosting scheme.
[0052] A chaotic system used in the present invention is a hyperchaotic system.
[0053] where in
i=1,2,3,4 is a derivative of time t; and m, n, p, q and r are parameters of the chaotic system. When m=35, n=3, p=12, q=7 and r=0.58, the system is called a hyperchaotic system.
[0054] A Knuth-Durstenfeld shuffling algorithm used in the present invention comprises the following specific steps:
[0055] Step 1: Storing an array with the length of n in an array arr[].
[0056] Step 2: Generating a random number [1,n], taking the generated random number as an array subscript and outputting as x.
[0057] Step 3: Swapping the output x with the last element in the array arr[].
[0058] Step 4: Generating a random number [1,n-1], taking the generated random number as an array subscript, and outputting as x′.
[0059] Step 5: Swapping the output x′ with the penultimate element in the array arr[].
[0060] The above steps are repeated until all n numbers are processed.
[0061] As shown in
[0062] Step 1: inputting signals x.sub.1 and x.sub.2 for linear transformation to obtain x′.sub.1 and x′.sub.2 of a hidden layer:
x′.sub.1=x.sub.1×ω.sub.11+x.sub.2×ω.sub.21
x′.sub.2=x.sub.1×ω.sub.12+x.sub.2×ω.sub.22
[0063] Step 2: replacing a weight from the hidden layer to an output layer by a function f(x), wherein an or result of the output layer is as follows.
[0064] y′.sub.1=f(x′.sub.1)
[0065] y′.sub.2=f(x′.sub.2)
[0066] Where: f (x)=mod (x, 16).
[0067] Step 3: calculating an output signal y through S-box.
[0068] y=S-box(y′.sub.1,y′.sub.2).
[0069] Step 4; automatically updating height functions.
ω.sub.11=ω.sub.11+mod(x.sub.1,2)
ω.sub.12=ω.sub.12+mod(x.sub.2,2)
ω.sub.21=ω.sub.21+mod(x.sub.1,2)
ω.sub.22=ω.sub.22+mod(x.sub.2,2)
[0070] Initial weights of class perceptron networks are generated by the HASH value.
Embodiment 1
[0071] An embodiment of the present invention is implemented based on the technical solution of the present invention. Detailed implementations and specific operation processes are given, but the protection scope of the present invention is not limited to the following embodiment. In the present embodiment, lena256×256 image is used; and a HASH value is generated by a HASH function. After processing, original parameters of a hyperchaotic system are x.sub.1=0.37; x.sub.2=0.5313; x.sub.3=0.1875; and x.sub.4=0.2500. Parameters of class perceptron networks are respectively as follows. In PLN-1, W.sub.11=7; W.sub.12=7; W.sub.21=7; and W.sub.22=6. In PLN-2, w.sub.11=2; w.sub.12=7; w.sub.21=5; and w.sub.22=2.
[0072] Step 1: bringing the original parameters into the hyperchaotic system to generate four sequences a.sub.1, a.sub.2, a.sub.3, and a.sub.4 with the length of M×N+300, discarding the first 300 elements of each sequence, and processing the remaining sequences as follows.
b.sub.1(i)=mod(abs(floor(a.sub.1(i)×10.sup.10)) ,256)
b.sub.2(i)=mod(abs(floor(a.sub.2(i)×10.sup.10)) ,256)
b.sub.3(i)=mod(abs(floor(a.sub.3(i)×10.sup.10)) ,256)
b.sub.4(i)=mod(abs(floor(a.sub.4(i)×10.sup.10)) ,256)
[0073] Step 2: using the four sequences a.sub.1, a.sub.2, a.sub.3 and a.sub.4 to generate random arrays aa.sub.1, aa.sub.2, aa.sub.3 and aa.sub.4 used for a shuffling algorithm, and shuffling b.sub.1, b.sub.2, b.sub.3 and b.sub.4 by the shuffling algorithm. The algorithm to generate aa.sub.1, aa.sub.2, aa.sub.3 and aa.sub.4 are as follows.
aa.sub.1(i)=mod(abs(floor(a.sub.1(i)×10.sup.10)) ,NUM−i+1)+1
aa.sub.2(i)=mod(abs(floor(a.sub.2(i)×10.sup.10)) ,NUM−i+1)+1
aa.sub.3(i)=mod(abs(floor(a.sub.3(i)×10.sup.10)) ,NUM−i+1)+1
aa.sub.4(i)=mod(abs(floor(a.sub.4(i)×10.sup.10)) ,NUM−i+1)+1
[0074] Step 3: preprocessing the obtained sequences b.sub.1, b.sub.2, b.sub.3 and b.sub.4 with the shuffling algorithm in step 2, taking the first numbers in b.sub.1, b.sub.2, b.sub.3 and b.sub.4 arrays as a group to serve as the first four numbers in the sequence {a.sub.i}; taking the second numbers in the b.sub.1, b.sub.2, b.sub.3 and b.sub.4 arrays as a group and inserting the numbers into the sequence {a.sub.i}, repeating the above steps until there arc M×N/2 numbers in the sequence {a.sub.i}, generating the required sequence {a.sub.i}, where i=1, 2, 3, . . . , M×N/2, and directly using the sequence for image encryption.
[0075] Step 4. Bringing the obtained sequence {a.sub.i} together with the plaintext image into the improved class boosting scheme to generate a final ciphertext image.
[0076] The present invention proposes an image encryption method based on an improved class boosting scheme, which greatly enhances unpredictability of the scheme by adding the class perceptron networks into the improved class boosting scheme, and can obtain a better encryption result. The present invention carries out simulation on a computer based on an Intel(R)Core(TM)i5-9400CPU@2.90 GHz2.90 GHz 64-bit operation system, and an x64 processor; and the programming language used is MATLAB2019b. After the above encryption method is applied to image processing,
[0077] In this paper, specific embodiments are used to explain the principle and implementations of the present invention; and the explanations of the above embodiments are only used to help understand the method and core ideas of the present invention. Meanwhile, according to the idea of the present invention, there will be some changes in the specific implementations and application scope for those ordinarily skilled in the art. To sum up, the contents of the specification should not be understood as limitations to the present invention.