An image encryption method and system based on impulsive differential equation chaotic system
Through the image encryption method based on the impulse differential equation chaotic system, using dynamic chaotic sequences and DNA coding, the problem of low security of traditional image encryption algorithms is solved, and the security and technical level of image encryption are improved.
Patent Information
- Application Number
- CN202010855021.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-08-24
AI Technical Summary
The security of traditional image encryption algorithms is low, especially algorithms based on logistic mapping or fractional order chaotic systems, which are easy to crack. Moreover, the static nature of DNA encoding results in little correlation between the encoded value and the image information, which affects security.
The image encryption method based on the impulse differential equation chaotic system is used to solve the impulse chaos sequence by constructing the impulse differential equation chaotic system. Combined with the Henon algorithm and DNA encoding, the image pixel matrix is scrambled, divided into blocks, encoded, calculated and decoded, and finally Scramble and replace to generate an encrypted image.
It significantly improves the security of image encryption, overcomes the low security problem of traditional algorithms, and enhances the complexity and security of encryption through dynamic chaotic sequences and coding rules.
Smart Images

Figure CN112001834B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image information encryption and information communication security, and in particular to an image encryption method and system based on an impulse differential equation chaotic system. Background Art
[0002] With the development of Internet technology and the commercial use of 5G networks, more and more people are transmitting information on the Internet, especially image information. How to encrypt image information and protect the security of image information has received increasing attention. Although many image encryption algorithms have been launched, there are still many problems, such as: although some algorithms have fast encryption speed and high stability, they are easy to be cracked, or the security mechanism of symmetric keys. Traditional image encryption algorithms are mostly based on improved algorithms such as Logistic mapping or fractional-order chaotic systems. Image encryption algorithms combining chaotic systems with DNA have been one of the research hotspots that have received much attention in recent years. When traditional algorithms use DNA coding for encryption, they are generally static, and the coding value has little correlation with the image information itself. Moreover, different chaotic systems have different randomness and dynamic behaviors. Some chaotic systems have relatively special dynamic behaviors, and the security of encryption algorithms based on different chaotic systems is also different. Therefore, how to propose a more secure image encryption algorithm based on chaotic systems and DNA coding requires more research, so as to improve the technical level of image encryption.
[0003] Aiming at the chaotic functions used in previous image encryption algorithms, which are both continuous chaotic systems and discrete iterative mapping functions, the present invention proposes a new image encryption algorithm based on an impulse differential equation chaotic system. Summary of the invention
[0004] The purpose of the present invention is to provide an image encryption method and system based on an impulse differential equation chaotic system, which overcomes the problem of low security of traditional image encryption algorithms, greatly improves the security of the image encryption method, and improves the technical level of image encryption.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] An image encryption method based on an impulsive differential equation chaotic system, the method comprising a preprocessing stage before image encryption processing and an image encryption processing stage:
[0007] The preprocessing stage before the image encryption process includes:
[0008] S11: Construct a chaotic system of impulse differential equations and solve the impulse chaotic sequence;
[0009] S12: Iteratively generate a random sequence using Logistic mapping, and construct an M*N two-dimensional random matrix based on the random sequence;
[0010] The image encryption processing stage includes:
[0011] S21: Read pixel information of the image to be encrypted to construct an M*N image pixel matrix, and scramble the image pixel matrix using a Henon algorithm to obtain a permuted image pixel matrix;
[0012] S22: Divide the scrambled image pixel matrix and the two-dimensional random matrix into blocks by rows to obtain image pixel matrix blocks and two-dimensional random matrix blocks respectively;
[0013] S23: Selecting the first subsequence and the second subsequence of the pulse chaotic sequence to respectively determine the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block, performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block, to obtain the encoded image pixel matrix block and the encoded two-dimensional random matrix block;
[0014] S24: selecting the third subsequence of the pulse chaotic sequence to determine the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block, performing DNA operation, and obtaining the image pixel matrix block after diffusion replacement;
[0015] S25: selecting the fourth subsequence of the pulse chaos sequence to determine the decoding scheme of the image pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the image pixel matrix block after the diffusion replacement, and obtaining the decoded image pixel matrix block;
[0016] S26: Merge the decoded image pixel matrices in blocks to obtain a merged image pixel matrix C, and then perform a scrambling and replacement operation on the merged image pixel matrix C to obtain a final encrypted image.
[0017] Optionally, constructing a chaotic system of impulse differential equations and solving an impulse chaotic sequence specifically includes:
[0018] The constructed impulsive differential equation chaotic system comprises:
[0019]
[0020] Among them, x(t), y1(t), y2(t), z1(t), z2(t) are the state variables of the chaotic system, r, k, α, β, γ, δ, b1, d1, d2, d3, d4, ε, m1 are the control parameters of the chaotic system, μ1 is the pulse variable, and T is the pulse period.
[0021] Solving the impulsive chaotic sequence based on the impulsive differential equation chaotic system specifically includes:
[0022] 1) Input the impulse differential equation and all its state variables and control parameters, and divide the pulse period T into f pulse intervals with f+1 pulse moments, where f+1 pulse moments are recorded as τ0, τ1, τ2, ..., τ f ; At the initial pulse time τ0, all state variables are assigned initial values;
[0023] x(0)=sum(sum(bitand(I,3))) / (3*SUM);
[0024] y1(0)=sum(sum(bitand(I,12) / 4)) / (3*SUM);
[0025] y2(0)=sum(sum(bitand(I,48) / 16)) / (3*SUM);
[0026] z1(0)=sum(sum(bitand(I,192) / 64)) / (3*SUM);
[0027] z2(0)=sum(sum(bitand(I,768) / 256)) / (3*SUM);
[0028] s11=(sum(sum(I))) / (2*sum(sum(I))+(1 / sum(sum(I))));
[0029] μ1=μ1(0)*10+s11;
[0030] Wherein, sum() represents a summation function; bitand() represents returning the result of a bitwise AND operation of two numerical values; SUM represents the pixel value of the image to be encrypted; s11 is an auxiliary parameter; I is the image pixel matrix;
[0031] 2) Calling the Runge-Kutta algorithm to solve the numerical solution of the pulse differential function in the pulse interval (τ0, τ1); when the solution time reaches the next pulse moment, the pulse differential function value at the pulse moment is assigned as the pulse variable value, and all state variables are assigned;
[0032] 3) Calculate the numerical solution of the pulse differential function of all pulse intervals according to step 2);
[0033] 4) Until the pulse time τ is detected f Until then, the numerical solution of the function in all pulse intervals is output.
[0034] x(n)=(x(1),x(2),...,x(f))
[0035] y1(n)=(y1(1),y1(2),...,y1(f))
[0036] y2(n)=(y2(1),y2(2),...,y2(f))
[0037] z1(n)=(z1(1),z1(2),...,z1(f))
[0038] z2(n)=(z2(1),z2(2),...,z2(f))
[0039] Among them, x(n) is the first subsequence of the pulse differential chaotic series, y1(n) is the second subsequence of the pulse differential chaotic series, y2(n) is the third subsequence of the pulse differential chaotic series, z1(n) is the fourth subsequence of the pulse differential chaotic series, and z2(n) is the fifth subsequence of the pulse differential chaotic series.
[0040] Optionally, the step of reading pixel information of the image to be encrypted to construct an M*N image pixel matrix, and scrambling the image pixel matrix using a Henon algorithm to obtain a permuted image pixel matrix specifically includes:
[0041] The Henon mapping expression used in the scrambling operation is:
[0042]
[0043] Among them, a and b are control parameters, a=1.4, b=0.3, x m ,y m is the state variable of the Henon map;
[0044] The above Henon mapping is used to iteratively generate random sequences, denoted as sx and sy;
[0045] Arrange sx and sy from small to large, and use the corresponding position matrix L xy Record the position of the sorted sequence;
[0046] According to the position matrix L xy The index sequence is used to rearrange the pixel positions of the image pixel matrix to obtain the scrambled image pixel matrix.
[0047] Optionally, the selecting of the first subsequence and the second subsequence of the pulse chaotic sequence to respectively determine the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block, performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block, and obtaining the encoded image pixel matrix block and the encoded two-dimensional random matrix block specifically includes:
[0048] According to the DNA coding rule table, 8 coding schemes are obtained, which are recorded as coding scheme 1, coding scheme 2, ..., coding scheme 8;
[0049] Normalizing the sequence values of the first subsequence and the second subsequence of the pulse chaotic sequence to 0-7, to obtain a normalized first subsequence and a normalized second subsequence; and the values 0-7 correspond to coding schemes 1-8 in sequence;
[0050] Normalizing the pixel values of each of the image pixel matrix blocks and the matrix values of each of the two-dimensional random matrix blocks to 0-3, to obtain normalized image pixel matrix blocks and normalized two-dimensional random matrix blocks;
[0051] Each sequence value of the normalized first subsequence corresponds to each normalized image pixel matrix block one by one; each sequence value of the normalized second subsequence corresponds to each normalized two-dimensional random matrix block one by one;
[0052] Determine the corresponding normalized image pixel matrix block coding scheme using each sequence value of the normalized first subsequence, and then perform DNA coding according to the pixel value size in the normalized image pixel matrix block to obtain the coded image pixel matrix block;
[0053] The encoding scheme of the corresponding normalized two-dimensional random matrix block is determined by using each sequence value of the normalized second subsequence, and then DNA encoding is performed according to the size of the matrix value in the normalized two-dimensional random matrix block to obtain the encoded two-dimensional random matrix block.
[0054] Optionally, the selecting of the third subsequence of the pulse chaotic sequence to determine the operation rules between the encoded image pixel matrix blocks and the encoded two-dimensional random matrix blocks, performing DNA operation to obtain the image pixel matrix blocks after diffusion replacement, specifically includes:
[0055] 1) normalizing the sequence value of the third subsequence of the pulse chaotic sequence to 0-2 to obtain a normalized third subsequence;
[0056] 2) Determine the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block according to the sequence value of the normalized third subsequence, perform a DNA operation, and obtain the image pixel matrix block B g ;
[0057] 3) Determine the image pixel matrix block B by using the normalized sequence value of the third subsequence g+1 and the image pixel matrix is divided into blocks B g The operation rules between are used to perform another DNA operation to obtain the image pixel matrix block after the diffusion replacement; wherein g is the sequence number of the pixel matrix block.
[0058] Optionally, the determining, according to the sequence value of the normalized third subsequence, an operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block specifically includes:
[0059] When the sequence value of the normalized third subsequence is 0, the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "add" operation in the encryption operation rule table;
[0060] When the sequence value of the normalized third subsequence is 1, between the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "subtraction" operation in the encryption operation rule table;
[0061] When the sequence value of the normalized third subsequence is 2, between the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "XOR" operation in the encryption operation rule table.
[0062] Optionally, the selecting the fourth subsequence of the pulse chaos sequence to determine the decoding scheme of the image pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the image pixel matrix block after the diffusion replacement, and obtaining the decoded image pixel matrix block specifically includes:
[0063] According to the DNA decoding rule table, 8 decoding schemes are obtained, which are recorded as decoding scheme 1, decoding scheme 2, ..., decoding scheme 8;
[0064] Normalize the sequence values of the fourth subsequence of the pulse chaotic sequence to 0-7 to obtain a normalized fourth subsequence; and the numerical values 0-7 correspond to decoding schemes 1-8;
[0065] Each sequence value in the normalized fourth subsequence corresponds one-to-one with each block of the image pixel matrix after diffusion substitution;
[0066] Use the value of the normalized fourth subsequence to determine the decoding scheme corresponding to the block of the image pixel matrix after diffusion substitution for DNA decoding.
[0067] Optionally, merging each decoded block of the image pixel matrix to obtain a merged image pixel matrix C, and then performing a scrambling substitution operation on the merged image pixel matrix C to obtain the final encrypted image, specifically including:
[0068] 1) Use the logistic chaotic system
[0069] x q+1 = μx q (1 - x q )
[0070] where μ ∈ (0, 4), x0 ∈ (0, 1), q ∈ integer;
[0071] Perform one chaotic iteration respectively to obtain two state values x1 and x2;
[0072] 2) Perform a row-by-row scan on the elements of the merged image pixel matrix C, specifically including the following steps:
[0073] A1. Arbitrarily select a row of elements of the merged image pixel matrix C for scanning, and let x i0 = x1;
[0074] (a) If j < i, then let j = i, and take the remainder of x1 to obtain k1, k2; where, i is the row number of the pixel in the merged image pixel matrix C, and j is the column number of the pixel in the merged image pixel matrix C;
[0075] (b) If j == i, then perform an exclusive OR operation on C(i, :) and k1;
[0076] (c) If j > i, then perform an exclusive OR operation on C(i, :) and k1; perform an exclusive OR operation on C(j, :) and k2; and then swap C(i, :) and C(j, :);
[0077] where, x i0x0 represents the value when scanning the elements of the merged image pixel matrix C row by row; C(i, :) represents the elements of the i-th row of the merged image pixel matrix C; C(j, :) represents the elements of the j-th row of the merged image pixel matrix C.
[0078] A2. Update x i0 , let the updated x i0 be equal to the x before update i0 plus s′, where s′ = sum(C(i, :)) / 1000, scan the elements of the next row of the matrix, and repeat the operations in (a) to (c) above until all the elements of all rows of the matrix are traversed, obtaining the image pixel matrix C′ after row-by-row scanning.
[0079] 3) Scan the elements of the image pixel matrix C′ column by column:
[0080] B1. Arbitrarily select a column of elements of the image pixel matrix C′ for scanning, and let x j0 = x2;
[0081] (d) If j < i, then let j = i, and take the remainder of x2 to obtain k1′ and k2′.
[0082] (e) If j == i, then perform an exclusive OR operation on C′(:, j) and k1′.
[0083] (f) If j > i, then perform an exclusive OR operation on C′(:, j) and k1′; perform an exclusive OR operation on C′(:, i) and k2′; then swap C′(:, j) and C′(:, i).
[0084] Among them, x j0 represents x0 when scanning the elements of the merged image pixel matrix C′ column by column; C′(:, j) represents the j-th column elements of the image pixel matrix C′; C′(:, i) represents the i-th column elements of the image pixel matrix C′.
[0085] B2. Update x j0 , let the updated x j0 be equal to the x before update j0 plus s′, where s′ = sum(C(i, :)) / 1000, scan the elements of the next column of the matrix, and repeat the operations in (d) to (f) above until all the elements of all columns of the matrix are traversed.
[0086] 4) Obtain the encrypted image after scrambling and substitution, that is, obtain the final ciphertext image.
[0087] The present invention also provides an image encryption system based on a chaotic system of pulse differential equations. The system includes a preprocessing module before image encryption processing and an image encryption processing module:
[0088] The pre-processing module before the image encryption process includes:
[0089] Impulse chaos sequence acquisition unit: used to construct the impulse differential equation chaotic system and solve the impulse chaos sequence;
[0090] A two-dimensional random matrix construction unit: used to iteratively generate a random sequence using Logistic mapping, and construct an M*N two-dimensional random matrix based on the random sequence;
[0091] The image encryption processing module comprises:
[0092] Scrambling and blocking unit: used for reading pixel information of the image to be encrypted to construct an M*N image pixel matrix, scrambling the image pixel matrix using the Henon algorithm to obtain a permuted image pixel matrix; dividing the scrambled image pixel matrix and the two-dimensional random matrix into blocks by rows to obtain image pixel matrix blocks and two-dimensional random matrix blocks respectively;
[0093] DNA encoding unit: used for selecting the first subsequence and the second subsequence of the pulse chaotic sequence to respectively determine the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block, and performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block to obtain the encoded image pixel matrix block and the encoded two-dimensional random matrix block;
[0094] DNA operation unit: used for selecting the third subsequence of the pulse chaotic sequence to determine the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block, performing DNA operation, and obtaining the pixel matrix block after diffusion replacement;
[0095] DNA decoding unit: used for selecting the fourth subsequence of the pulse chaotic sequence to determine the decoding scheme of the pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the pixel matrix block after the diffusion replacement, and obtaining the decoded pixel matrix block;
[0096] Scrambling replacement unit: used for merging the decoded pixel matrix blocks to obtain a merged image pixel matrix C, and then performing a scrambling replacement operation on the merged image pixel matrix C to obtain a final encrypted image.
[0097] Optionally, the pulse chaotic sequence acquisition unit is used to construct a chaotic system of pulse differential equations and solve the pulse chaotic sequence, specifically including:
[0098] The constructed impulsive differential equation chaotic system comprises:
[0099]
[0100] Among them, x(t), y1(t), y2(t), z1(t), z2(t) are the state variables of the chaotic system, r, k, α, β, γ, δ, b1, d1, d2, d3, d4, ε, m1 are the control parameters of the chaotic system, μ1 is the pulse variable, and T is the pulse period.
[0101] Solving the impulsive chaotic sequence based on the impulsive differential equation chaotic system specifically includes:
[0102] 1) Input the impulse differential equation and all its state variables and control parameters, and divide the pulse period T into f pulse intervals with f+1 pulse moments, where f+1 pulse moments are recorded as τ0, τ1, τ2, ..., τ f ; At the initial pulse time τ0, all state variables are assigned initial values;
[0103] x(0)=sum(sum(bitand(I,3))) / (3*SUM);
[0104] y1(0)=sum(sum(bitand(I,12) / 4)) / (3*SUM);
[0105] y2(0)=sum(sum(bitand(I,48) / 16)) / (3*SUM);
[0106] z1(0)=sum(sum(bitand(I,192) / 64)) / (3*SUM);
[0107] z2(0)=sum(sum(bitand(I,768) / 256)) / (3*SUM);
[0108] s11=(sum(sum(I))) / (2*sum(sum(I))+(1 / sum(sum(I))));
[0109] μ1=μ1(0)*10+s11;
[0110] Wherein, sum() represents a summation function; bitand() represents returning the result of a bitwise AND operation of two numerical values; SUM represents the pixel value of the image to be encrypted; s11 is an auxiliary parameter; I is the image pixel matrix;
[0111] 2) Calling the Runge-Kutta algorithm to solve the numerical solution of the pulse differential function in the pulse interval (τ0, τ1); when the solution time reaches the next pulse moment, the pulse differential function value at the pulse moment is assigned as the pulse variable value, and all state variables are assigned;
[0112] 3) Calculate the numerical solution of the pulse differential function of all pulse intervals according to step 2);
[0113] 4) Until the pulse time τ is detected f Until then, the numerical solution of the function in all pulse intervals is output.
[0114] x(n)=(x(1),x(2),...,x(f))
[0115] y1(n)=(y1(1),y1(2),...,y1(f))
[0116] y2(n)=(y2(1),y2(2),...,y2(f))
[0117] z1(n)=(z1(1),z1(2),...,z1(f))
[0118] z2(n)=(z2(1),z2(2),...,z2(f))
[0119] Among them, x(n) is the first subsequence of the pulse differential chaotic series, y1(n) is the second subsequence of the pulse differential chaotic series, y2(n) is the third subsequence of the pulse differential chaotic series, z1(n) is the fourth subsequence of the pulse differential chaotic series, and z2(n) is the fifth subsequence of the pulse differential chaotic series.
[0120] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0121] The invention provides an image encryption method and system based on an impulse differential equation chaotic system. Firstly, an impulse differential equation chaotic system is constructed and solved to obtain an impulse chaotic sequence, then an M*N two-dimensional random matrix is constructed, and an M*N image pixel matrix is obtained based on pixel information of an image to be encrypted, the image pixel matrix is scrambled, and then the scrambled image pixel matrix and the two-dimensional random matrix are divided into blocks, and then two subsequences in the impulse chaotic sequence are selected to respectively determine the encoding rules of the image pixel matrix blocks and the two-dimensional random matrix blocks for DNA encoding, and then a subsequence in the impulse chaotic sequence is used to determine the operation rules between the encoded image pixel matrix blocks and the encoded two-dimensional random matrix blocks for DNA operation; then a subsequence in the impulse chaotic sequence is used to determine the decoding rules of each matrix block after the DNA operation for DNA decoding; finally, the decoded matrix blocks are merged, and then the matrix values are scrambled and replaced, so as to obtain the final encrypted image.
[0122] Since the impulse differential equation chaotic system does not belong to the continuous chaotic system or discrete iterative mapping, but has the characteristics of the continuous system and the discrete system, and has properties beyond the scope of the continuous system and the discrete system, under special value conditions, it has complex dynamic behaviors, including quasi-periodic oscillations, period-doubling branches, half-period branches, period windows, chaos, etc., so the impulse differential equation chaotic system can be used for image encryption. The security of encryption can be greatly improved. Therefore, the present invention uses the impulse differential equation to obtain the impulse chaotic sequence, and dynamically determines the DNA encoding rules, DNA operation rules, and DNA decoding rules based on the impulse chaotic sequence. Compared with the static characteristics of the traditional image encryption algorithm, the image encryption algorithm based on the impulse differential equation of the present invention is more secure.
[0123] In addition, the present application utilizes a variety of chaotic systems in the process of image encryption, and the combined application of a variety of chaotic systems also greatly improves the security of image encryption. BRIEF DESCRIPTION OF THE DRAWINGS
[0124] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0125] Figure 1 is a flowchart of the image encryption method in Embodiment 1 of the present invention;
[0126] Figure 2 This is a flow chart for solving the pulse chaotic sequence in Example 1 of the present invention;
[0127] Figure 3 is a bifurcation diagram of the three-dimensional impulse differential equation with respect to parameter T in Example 1 of the present invention;
[0128] Figure 4 is a bifurcation diagram of the three-dimensional impulse differential equation with respect to parameter μ1 in Example 1 of the present invention;
[0129] Figure 5 is the image after Henon scrambling in Example 1 of the present invention;
[0130] Figure 6 is the plaintext image in Embodiment 1 of the present invention;
[0131] Figure 7 is the ciphertext image in Embodiment 1 of the present invention;
[0132] Figure 8 This is a structural diagram of the image encryption system in Example 2 of the present invention. DETAILED DESCRIPTION
[0133] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0134] The purpose of the present invention is to provide an image encryption method and system based on an impulse differential equation chaotic system, which overcomes the problem of low security of traditional image encryption algorithms, greatly improves the security of the image encryption method, and improves the technical level of image encryption.
[0135] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0136] Example 1
[0137] like Figure 1 As shown, this embodiment provides an image encryption method based on an impulse differential equation chaotic system, which includes a preprocessing stage before image encryption processing and an image encryption processing stage:
[0138] The preprocessing stage before image encryption includes:
[0139] S11: Construct a chaotic system of impulse differential equations and solve the impulse chaotic sequence;
[0140] Among them, the constructed impulsive differential equation chaotic system may include a five-dimensional impulsive differential equation:
[0141]
[0142] Among them, x(t), y1(t), y2(t), z1(t), z2(t) are the state variables of the chaotic system, r, k, α, β, γ, δ, b1, d1, d2, d3, d4, ε, m1 are the control parameters of the chaotic system, μ1 is the pulse variable, and T is the pulse period.
[0143] like Figure 2 As shown, solving the impulsive chaotic sequence based on the impulsive differential equation chaotic system specifically includes:
[0144] 1) Input the impulse differential equation and all its state variables and control parameters, and divide the pulse period T into f pulse intervals with f+1 pulse moments, where f+1 pulse moments are recorded as τ0, τ1, τ2, ..., τ f ; At the initial pulse time τ0, all state variables are assigned initial values;
[0145] x(0)=sum(sum(bitand(I,3))) / (3*SUM);
[0146] y1(0)=sum(sum(bitand(I,12) / 4)) / (3*SUM);
[0147] y2(0)=sum(sum(bitand(I,48) / 16)) / (3*SUM);
[0148] z1(0)=sum(sum(bitand(I,192) / 64)) / (3*SUM);
[0149] z2(0)=sum(sum(bitand(I,768) / 256)) / (3*SUM);
[0150] s11=(sum(sum(I))) / (2*sum(sum(I))+(1 / sum(sum(I))));
[0151] μ1=μ1(0)*10+s11;
[0152] Wherein, sum() represents a summation function; bitand() represents returning the result of a bitwise AND operation of two numerical values; SUM represents the pixel value of the image to be encrypted; s11 is an auxiliary parameter; I is the image pixel matrix;
[0153] 2) Calling the Runge-Kutta algorithm to solve the numerical solution of the pulse differential function in the pulse interval (τ0, τ1); when the solution time reaches the next pulse moment, the pulse differential function value at the pulse moment is assigned as the pulse variable value, and all state variables are assigned;
[0154] 3) Calculate the numerical solution of the pulse differential function of all pulse intervals according to step 2);
[0155] 4) Until the pulse time τ is detected f Until then, the numerical solution of the function in all pulse intervals is output.
[0156] x(n)=(x(1),x(2),...,x(f))
[0157] y1(n)=(y1(1),y1(2),...,y1(f))
[0158] y2(n)=(y2(1),y2(2),...,y2(f))
[0159] z1(n)=(z1(1),z1(2),...,z1(f))
[0160] z2(n)=(z2(1),z2(2),...,z2(f))
[0161] Among them, x(n) is the first subsequence of the pulse differential chaotic series, y1(n) is the second subsequence of the pulse differential chaotic series, y2(n) is the third subsequence of the pulse differential chaotic series, z1(n) is the fourth subsequence of the pulse differential chaotic series, and z2(n) is the fifth subsequence of the pulse differential chaotic series.
[0162] In addition, the constructed impulsive differential equation chaotic system can also be a three-dimensional impulsive differential equation:
[0163]
[0164] Among them, x(t), y(t), z(t) are the state variables of the chaotic system, r, K, k, α, β, m2, d, m3 are the control parameters of the chaotic system, μ1 is the pulse variable, and T is the pulse period.
[0165] Among them, the impulse differential equation group is used as the generating function of the encryption key stream. The impulse differential equation will produce complex chaotic phenomena in a specific value range, such as period-doubling branches, half-period branches, period waterfalls, chaos and other special dynamic phenomena. By drawing the bifurcation diagram, the value range of the chaotic sequence can be analyzed. By drawing visual graphics such as Lyapunov index diagrams, phase diagrams, time series diagrams, bifurcation diagrams, Poincare sections, etc., the initial parameter conditions for the generation of chaotic sequences used for image encryption are determined through numerical simulation.
[0166] When the parameters of the three-dimensional impulsive differential equation take the following values, the bifurcation diagram of the chaotic system with respect to T is as follows: Figure 3 As shown:
[0167] r=2.4; K=15; α=0.6; β=0.5; m2=0.95; d=0.6; m3=1.05; k=2.4; μ1=2.5; T∈[1,1.5];
[0168] When the parameters of the three-dimensional impulsive differential equation take the following values, the bifurcation diagram of the chaotic system about μ1 is as follows: Figure 4 As shown:
[0169] r=5; K=21; α=0.6; β=0.6; m2=1.25; d=0.45; m3=1.2; k=5; μ1∈[0.1,10];
[0170] Through multiple analyses, the present invention determines the following partial parameter values as partial parameter values for generating chaotic sequences:
[0171] r=4; K=15; α=0.12; β=0.9; m2=0.01; d=1.06; m3=1.05; k=5; μ1=2.524;
[0172] Read the pixel value information of the image to be encrypted, and get the pixel value SUM=512*512.
[0173] x(0)=sum(sum(bitand(I,3))) / (3*SUM);
[0174] y(0)=sum(sum(bitand(I,12) / 4)) / (3*SUM);
[0175] z(0)=sum(sum(bitand(I,48) / 16)) / (3*SUM);
[0176] μ1(0)=sum(sum(bitand(I,192) / 64)) / (3*SUM);
[0177] s11=(sum(sum(I))) / (2*sum(sum(I))+(1 / sum(sum(I))));
[0178] μ1=μ1(0)*10+s11;
[0179] All parameter values and initial values of state variables of the three-dimensional differential equation used to generate the impulsive chaotic sequence are obtained. Then, the Runge-Kutta method is used to solve the three-dimensional impulsive differential equation to obtain the impulsive chaotic sequence.
[0180] It should be noted that the five-dimensional impulsive differential equation chaotic system and the three-dimensional impulsive differential equation chaotic system explicitly given in this embodiment are only for a clearer explanation of the solution of this embodiment, and do not have a limiting effect on the technical solution of the present invention. The chaotic properties of the solutions of the impulsive differential equations are analyzed through theories such as Floquet multiplier theory and impulse comparison theorem. If the solution space is chaotic, it means that the chaotic orbit of the system is complex and difficult to predict, and is suitable as a random sequence generator for encryption schemes. Therefore, all impulsive differential equation chaotic systems that can be used as chaotic sequence generators are within the protection scope of the present invention.
[0181] In addition, since the impulsive differential equation chaotic system does not belong to the continuous chaotic system or discrete iterative mapping, but has the characteristics of the continuous system and the discrete system, and has properties beyond the scope of the continuous system and the discrete system, under special value conditions, it has complex dynamic behaviors, including quasi-periodic oscillations, period-doubling branches, half-period branches, period windows, chaos, etc., so the use of the impulsive differential equation chaotic system for image encryption can greatly improve the security of encryption.
[0182] S12: Iteratively generate a random sequence using Logistic mapping, and construct an M*N two-dimensional random matrix based on the random sequence;
[0183] The first random sequence h = (h(1), h(2), ..., h(l)) is generated by iterative Logistic mapping, and then h′ = mod(ceil(h×h×10 3 ),256) operations are performed to obtain a second random sequence h′=(h′(1),h′(2),...,h′(l)); based on the second random sequence h′, a two-dimensional random matrix T is constructed, T=reshape(h′,N,M)′; wherein l=M*N, mod() represents a remainder function; ceil() represents rounding up; reshape(h′,N,M)′ represents converting the second random sequence h′ into an M*N matrix;
[0184] The image encryption processing stage includes:
[0185] S21: Read the pixel information of the image to be encrypted to construct an M*N image pixel matrix, and use the Henon algorithm to scramble the image pixel matrix to obtain a permuted image pixel matrix, such as Figure 5 As shown; specifically including:
[0186] The Henon mapping expression used in the scrambling operation is:
[0187]
[0188] Among them, a and b are control parameters, a=1.4, b=0.3, x m ,y m is the state variable of the Henon map;
[0189] The above Henon mapping is used to iteratively generate random sequences, denoted as sx and sy;
[0190] Arrange sx and sy from small to large, and use the corresponding position matrix L xy Record the position of the sorted sequence;
[0191] According to the position matrix L xyThe index sequence is used to rearrange the pixel positions of the image pixel matrix to obtain the scrambled image pixel matrix.
[0192] S22: Divide the scrambled image pixel matrix and the two-dimensional random matrix into blocks by rows to obtain image pixel matrix blocks and two-dimensional random matrix blocks respectively.
[0193] The block operation is as follows:
[0194] The scrambled image pixel matrix and the two-dimensional random matrix are divided into blocks by row, and the sub-blocks after the block operation are:
[0195] Block g =BI(L1×(e i -1)+1:L1×e i ,L1×(v j -1)+1:L1×v j ), where Block g Indicates the g-th block;
[0196] Among them, BI represents the matrix to be divided into blocks, L1 is the length of each block, g is the sequence number of each small block, e i represents the i-th row block of the matrix to be partitioned, v j represents the j-th column block of the matrix to be partitioned;
[0197] After the above-mentioned block operation, the scrambled image pixel matrix is divided into blocks to obtain each image pixel matrix block. Similarly, the two-dimensional random matrix is also converted into multiple two-dimensional random matrix blocks after the block operation.
[0198] S23: Select the first subsequence S of the pulse chaos sequence W1 and the second subsequence S W2 Determining the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block respectively, performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block, and obtaining the encoded image pixel matrix block and the encoded two-dimensional random matrix block; specifically comprising:
[0199] Table 1 DNA coding rules
[0200]
[0201] As shown in Table 1, the DNA coding rule table includes 8 coding schemes. In each scheme, the values 0, 1, 2, and 3 correspond to different coding rules.
[0202] According to the DNA coding rule table, 8 coding schemes are obtained, which are recorded as coding scheme 1, coding scheme 2, ..., coding scheme 8;
[0203] The first subsequence S of the pulse chaotic sequence W1 and the second subsequence S W2 The sequence value of is normalized to 0-7, and the normalized first subsequence S′ is obtained W1 and the normalized second subsequence S′ W2 ; and the values 0-7 correspond to the encoding schemes 1-8 respectively;
[0204] The normalization operation is as follows:
[0205] S′ W1 =mod(floor(S W1 ×10 4 ),8)+1;
[0206] S′ W2 =mod(floor(S W2 ×10 4 ),8)+1;
[0207] Among them, floor() means rounding down;
[0208] Each of the image pixel matrices is divided into blocks I g The pixel values and the two-dimensional random matrix F of each block g The matrix value is normalized to 0-3, and the normalized image pixel matrix block I′ is obtained g And the normalized two-dimensional random matrix block F′ g ; Where g is the block number.
[0209] The normalization operation is as follows:
[0210] I′ g =bitand(I g ,3×4 4-c ) / 4 4-c ;
[0211] F′ g =bitand(F g ,3×4 4-c ) / 4 4-c , where c = 1, 2, 3, 4;
[0212] The normalized first subsequence S′ W1 The sequence values of each normalized image pixel matrix block I′ g One-to-one correspondence; the normalized second subsequence S′ W2 Each sequence value and each normalized two-dimensional random matrix block F′ g One to one correspondence;
[0213] Using the normalized first subsequence S′ W1 Each sequence value of determines the corresponding normalized image pixel matrix block I′ g Coding scheme, and then divide the normalized image pixel matrix into blocks I′ g DNA encoding is performed on the pixel values in to obtain the encoded image pixel matrix blocks;
[0214] Using the normalized second subsequence S′ W2 Each sequence value determines the corresponding normalized two-dimensional random matrix block F′ g The encoding scheme is then divided into blocks F′ according to the normalized two-dimensional random matrix g The matrix value size in is DNA encoded to obtain the encoded two-dimensional random matrix blocks.
[0215] S24: Select the third subsequence S of the pulse chaos sequence W3 Determining the operation rules between the encoded image pixel matrix blocks and the encoded two-dimensional random matrix blocks, performing DNA operation, and obtaining the image pixel matrix blocks after diffusion replacement; specifically comprising:
[0216] 1) The third subsequence S of the pulse chaotic sequence W3 The sequence value of is normalized to 0-2, and the normalized third subsequence S′ is obtained W3 ;
[0217] S′ W3 =mod(floor(S W3 ×10 4 ),3);
[0218] 2) According to the normalized third subsequence S′ W3 The sequence value of determines the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block, performs a DNA operation, and obtains the image pixel matrix block B g ;
[0219] 3) Reusing the normalized third subsequence S′ W3 The sequence value determines the image pixel matrix block B g+1 and the image pixel matrix is divided into blocks B g The operation rules between them are used to perform another DNA operation to obtain the image pixel matrix blocks after the diffusion replacement;
[0220] In addition, as shown in Tables 2 to 4, three encryption operation rule tables are provided in this embodiment;
[0221] Table 2 "Add" operation rules
[0222] Num=0 A T G C A A T G C T T C A G G G A C T C C G T A
[0223] Table 3 "Subtraction" operation rules
[0224] Num=1 A T G C A A G T C T T A C G G G C A T C C T G A
[0225] Table 4 "XOR" operation rules
[0226]
[0227]
[0228] Then, according to the normalized third subsequence S′ W3 The sequence value of determines the operation rules between the encoded image pixel matrix block and the encoded two-dimensional random matrix block, specifically including:
[0229] When the normalized third subsequence S′ W3 When the sequence value of is 0, the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "add" operation in the encryption operation rule table;
[0230] When the normalized third subsequence S′ W3 When the sequence value of is 1, the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "subtraction" operation in the encryption operation rule table;
[0231] When the normalized third subsequence S′ W3 When the sequence value of is 2, the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "XOR" operation in the encryption operation rule table.
[0232] S25: Select the fourth subsequence S of the pulse chaos sequence W4 Determining a decoding scheme for the image pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the image pixel matrix block after the diffusion replacement, and obtaining the decoded image pixel matrix block; specifically comprising:
[0233] Table 5 DNA decoding rules
[0234]
[0235]
[0236] As shown in Table 5, this embodiment provides a DNA decoding rule table, which includes 8 decoding schemes. In each scheme, the values 0, 1, 2, and 3 correspond to different decoding rules.
[0237] According to the DNA decoding rule table, 8 decoding schemes are obtained, which are recorded as decoding scheme 1, decoding scheme 2, ..., decoding scheme 8;
[0238] The fourth subsequence S of the pulse chaos sequence W4 The sequence value of is normalized to 0-7, and the normalized fourth subsequence S′ is obtained W4 ; and values 0-7 correspond to decoding schemes 1-8;
[0239] S′ W4 =mod(floor(S W4 ×10 4 ),8)+1;
[0240] The normalized fourth subsequence S′ W4 Each sequence value in corresponds to each of the image pixel matrix blocks after diffusion replacement;
[0241] Using the normalized fourth subsequence S′ W4 The value of determines the decoding scheme of the image pixel matrix block after the diffusion replacement corresponding to it for DNA decoding.
[0242] Finally, it should be noted that W1, W2, W3 and W4 are different numbers within 1 to W; in addition, when a five-dimensional pulse chaos system is applied, the fifth subsequence of the pulse chaos sequence can also be obtained. At this time, the fifth subsequence of the pulse chaos sequence can be used to replace any of the first to fourth subsequences of the pulse chaos sequence. When a three-dimensional pulse chaos system is applied, the obtained pulse chaos sequence only includes three subsequences, so in order to meet the requirements of the four subsequences of the pulse chaos sequence applied in the above steps S23-S25, any one of the three subsequences of the obtained pulse chaos sequence can be reused by the three-dimensional pulse chaos system.
[0243] S26: Merge the decoded image pixel matrices into blocks to obtain a merged image pixel matrix C, and then perform a scrambling and replacement operation on the merged image pixel matrix C to obtain a final encrypted image. Specifically, the process includes:
[0244] 1) Using the logistic chaotic system
[0245] x q+1 = μx q (1 - x q )
[0246] where μ ∈ (0, 4), x0 ∈ (0, 1), and q ∈ integers;
[0247] Perform a single chaotic iteration respectively to obtain two state values x1 and x2;
[0248] 2) Scan the elements of the merged image pixel matrix C row by row, specifically including the following steps:
[0249] A1. Arbitrarily select a row of elements from the merged image pixel matrix C for scanning, and let x i0 = x1;
[0250] (a) If j < i, then let j = i, and take the remainder of x1 to obtain k1 and k2; where i is the row number of the pixel in the merged image pixel matrix C, and j is the column number of the merged image pixel matrix C;
[0251] (b) If j == i, then perform an exclusive OR operation on C(i, :) and k1;
[0252] (c) If j > i, then perform an exclusive OR operation on C(i, :) and k1; perform an exclusive OR operation on C(j, :) and k2; then swap C(i, :) and C(j, :);
[0253] where x i0 represents x0 when scanning the elements of the merged image pixel matrix C row by row; C(i, :) represents the i-th row elements of the merged image pixel matrix C; C(j, :) represents the j-th row elements of the merged image pixel matrix C;
[0254] A2. Update x i0 , and let the updated x i0 be equal to the previous x i0 plus s′, s′ = sum(C(i, :)) / 1000, scan the next row of matrix elements, and repeat the operations in (a) to (c) above until all rows of matrix elements are traversed to obtain the image pixel matrix C′ after row-by-row scanning;
[0255] 3) Scan the elements of the image pixel matrix C′ column by column:
[0256] B1. Arbitrarily select a column of elements from the image pixel matrix C′ for scanning, and let x j0 = x2;
[0257] (d) If j < i, then let j = i, and take the remainder of x2 to obtain k′1 and k′2;
[0258] (e) If j == i, then perform an exclusive OR operation on C′(:, j) and k1′;
[0259] (f) If j > i, then perform an exclusive OR operation on C′(:, j) and k1′; perform an exclusive OR operation on C′(:, i) and k2′; then swap C′(:, j) and C′(:, i);
[0260] Among them, x j0 represents x0 when scanning the elements of the merged image pixel matrix C′ column by column; C′(:, j) represents the j-th column elements of the image pixel matrix C′; C′(:, i) represents the i-th column elements of the image pixel matrix C′;
[0261] B2. Update x j0 , let the updated x j0 be equal to the previous x j0 plus s′, s′ = sum(C(i, :)) / 1000, scan the elements of the next column matrix, and repeat the operations in (d) to (f) above until all column elements of the matrix are traversed;
[0262] 4) Obtain the encrypted image after scrambling substitution, that is, obtain the final ciphertext image.
[0263] As Figure 6 shown is the plaintext image, that is, the image to be encrypted. Using the above image encryption method, the ciphertext image as Figure 7 shown is obtained.
[0264] Considering that this image encryption method is completely symmetric and reversible, the decryption process is the inverse process of the image encryption method.
[0265] In this embodiment, a pulse differential equation is used to obtain a pulse chaotic sequence, and based on this pulse chaotic sequence, DNA coding rules, DNA operation rules, and DNA decoding rules are dynamically determined. Compared with the static characteristics of traditional image encryption algorithms, the image encryption algorithm based on pulse differential equation in this embodiment has higher security, overcomes the problem of low security of traditional image encryption algorithms, and improves the technical level of image encryption.
[0266] Embodiment 2
[0267] As Figure 8 shown, this embodiment gives an image encryption system based on a pulse differential equation chaotic system, and this system includes a preprocessing module before image encryption processing and an image encryption processing module:
[0268] Among them, the pre-processing module before image encryption processing includes:
[0269] Impulse chaos sequence acquisition unit: used to construct the impulse differential equation chaotic system and solve the impulse chaos sequence;
[0270] A two-dimensional random matrix construction unit: used to iteratively generate a random sequence using Logistic mapping, and construct an M*N two-dimensional random matrix based on the random sequence;
[0271] The image encryption processing module includes:
[0272] Scrambling and blocking unit: used for reading pixel information of the image to be encrypted to construct an M*N image pixel matrix, scrambling the image pixel matrix using the Henon algorithm to obtain a permuted image pixel matrix; dividing the scrambled image pixel matrix and the two-dimensional random matrix into blocks by rows to obtain image pixel matrix blocks and two-dimensional random matrix blocks respectively;
[0273] DNA encoding unit: used for selecting the first subsequence and the second subsequence of the pulse chaotic sequence to respectively determine the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block, and performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block to obtain the encoded image pixel matrix block and the encoded two-dimensional random matrix block;
[0274] DNA operation unit: used for selecting the third subsequence of the pulse chaotic sequence to determine the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block, performing DNA operation, and obtaining the pixel matrix block after diffusion replacement;
[0275] DNA decoding unit: used for selecting the fourth subsequence of the pulse chaotic sequence to determine the decoding scheme of the pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the pixel matrix block after the diffusion replacement, and obtaining the decoded pixel matrix block;
[0276] Scrambling replacement unit: used for merging the decoded pixel matrix blocks to obtain a merged image pixel matrix C, and then performing a scrambling replacement operation on the merged image pixel matrix C to obtain a final encrypted image.
[0277] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0278] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. An image encryption method based on impulsive differential equation chaotic system, It is characterized in that The method comprises a preprocessing stage before image encryption processing and an image encryption processing stage: The preprocessing stage before the image encryption process includes: S11: Construct a chaotic system of impulse differential equations and solve the impulse chaotic sequence; The constructing of the impulsive differential equation chaotic system and solving the impulsive chaotic sequence specifically includes: The constructed impulsive differential equation chaotic system comprises: Among them, x(t), y 1 (t), y 2 (t), z 1 (t), z 2 (t) is the state variable of the chaotic system, r, k, α, β, γ, δ, b 1 , d 1 , d 2 , d 3 , d 4 ,ε,m 1 is the control parameter of the chaotic system, μ 1 is the pulse variable, T is the pulse period; Solving the impulsive chaotic sequence based on the impulsive differential equation chaotic system specifically includes: 1) Input the pulse differential equation and all its state variables and control parameters, and divide the pulse period T into f pulse intervals with f+1 pulse times, where f+1 pulse time is denoted as τ 0 , τ 1 , τ 2 , ..., τ f ; At the initial pulse time τ 0 , assign initial values to all state variables; x(0)=sum(sum(bitand(I,3))) / (3*SUM); y 1 (0)=sum(sum(bitand(I,12) / 4)) / (3*SUM); y 2 (0)=sum(sum(bitand(I,48) / 16)) / (3*SUM); z 1 (0)=sum(sum(bitand(I,192) / 64)) / (3*SUM); z 2 (0)=sum(sum(bitand(I,768) / 256)) / (3*SUM); s11=(sum(sum(I))) / (2*sum(sum(I))+(1 / sum(sum(I)))); m 1 =μ 1 (0)*10+s11; Wherein, sum() represents a summation function; bitand() represents returning the result of a bitwise AND operation of two numerical values; SUM represents the pixel value of the image to be encrypted; s11 is an auxiliary parameter; I is the image pixel matrix; 2) Call the Runge-Kutta algorithm to solve (τ 0 , τ 1 ) a numerical solution of the pulse differential function within the pulse interval; when the solution time reaches the next pulse moment, the pulse differential function value at the pulse moment is assigned as the pulse variable value, and all state variables are assigned; 3) Calculate the numerical solution of the pulse differential function of all pulse intervals according to step 2); 4) Until the pulse time τ is detected f Until then, the numerical solution of the function in all pulse intervals is output. x(n)=(x(1),x(2),...,x(f)) and 1 (n)=(y 1 (1),and 1 (2),...,and 1 (F)) and 2 (n)=(y 2 (1),and 2 (2),...,and 2 (F)) With 1 (n)=(z 1 (1),with 1 (2),...,of 1 (f)) With 2 (n)=(z 2 (1),with 2 (2),...,of 2 (f)) Among them, x(n) is the first subsequence of the impulse differential chaos series, y 1 (n) is the second subsequence of the impulse differential chaos series, y 2 (n) is the third subsequence of the impulse differential chaos series, z 1 (n) is the fourth subsequence of the impulse differential chaos series, z 2 (n) is the fifth subsequence of the pulse differential chaotic series; S12: Iteratively generate a random sequence using Logistic mapping, and construct an M*N two-dimensional random matrix based on the random sequence; The image encryption processing stage includes: S21: Read pixel information of the image to be encrypted to construct an M*N image pixel matrix, and scramble the image pixel matrix using a Henon algorithm to obtain a scrambled image pixel matrix; S22: Divide the scrambled image pixel matrix and the two-dimensional random matrix into blocks by rows to obtain image pixel matrix blocks and two-dimensional random matrix blocks respectively. S23: Selecting the first subsequence and the second subsequence of the pulse chaotic sequence to respectively determine the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block, performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block, to obtain the encoded image pixel matrix block and the encoded two-dimensional random matrix block; S24: selecting the third subsequence of the pulse chaotic sequence to determine the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block, performing DNA operation, and obtaining the image pixel matrix block after diffusion replacement; S25: selecting the fourth subsequence of the pulse chaos sequence to determine the decoding scheme of the image pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the image pixel matrix block after the diffusion replacement, and obtaining the decoded image pixel matrix block; S26: Merge the decoded image pixel matrices in blocks to obtain a merged image pixel matrix C, and then perform a scrambling and replacement operation on the merged image pixel matrix C to obtain a final encrypted image.
2. The method according to claim 1, It is characterized in that The step of reading pixel information of the image to be encrypted to construct an M*N image pixel matrix and scrambling the image pixel matrix using a Henon algorithm to obtain a scrambled image pixel matrix specifically includes: The Henon mapping expression used in the scrambling operation is: Among them, a and b are control parameters, a=1.4, b=0.3, x m ,y m is the state variable of the Henon map; The above Henon mapping is used to iteratively generate random sequences, denoted as sx and sy; Arrange sx and sy from small to large, and use the corresponding position matrix L xy Record the position of the sorted sequence; According to the position matrix L xy The index sequence is used to rearrange the pixel positions of the image pixel matrix to obtain the scrambled image pixel matrix.
3. The method according to claim 1, It is characterized in that The step of selecting the first subsequence and the second subsequence of the pulse chaotic sequence to respectively determine the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block, performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block, and obtaining the encoded image pixel matrix block and the encoded two-dimensional random matrix block specifically includes: According to the DNA coding rule table, 8 coding schemes are obtained, which are recorded as coding scheme 1, coding scheme 2, ..., coding scheme 8; Normalizing the sequence values of the first subsequence and the second subsequence of the pulse chaotic sequence to 0-7, to obtain a normalized first subsequence and a normalized second subsequence; and the values 0-7 correspond to coding schemes 1-8 in sequence; Normalizing the pixel values of each of the image pixel matrix blocks and the matrix values of each of the two-dimensional random matrix blocks to 0-3, to obtain normalized image pixel matrix blocks and normalized two-dimensional random matrix blocks; Each sequence value of the normalized first subsequence corresponds to each normalized image pixel matrix block one by one; each sequence value of the normalized second subsequence corresponds to each normalized two-dimensional random matrix block one by one; Determine the corresponding normalized image pixel matrix block coding scheme using each sequence value of the normalized first subsequence, and then perform DNA coding according to the pixel value size in the normalized image pixel matrix block to obtain the coded image pixel matrix block; The encoding scheme of the corresponding normalized two-dimensional random matrix block is determined by using each sequence value of the normalized second subsequence, and then DNA encoding is performed according to the size of the matrix value in the normalized two-dimensional random matrix block to obtain the encoded two-dimensional random matrix block.
4. The method according to claim 1, It is characterized in that The selecting the third subsequence of the pulse chaotic sequence to determine the operation rules between the encoded image pixel matrix blocks and the encoded two-dimensional random matrix blocks, performing DNA operation to obtain the image pixel matrix blocks after diffusion replacement, specifically includes: 1) normalizing the sequence value of the third subsequence of the pulse chaotic sequence to 0-2 to obtain a normalized third subsequence; 2) Determine the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block according to the sequence value of the normalized third subsequence, perform a DNA operation, and obtain the image pixel matrix block B g ; 3) Determine the image pixel matrix block B by using the normalized sequence value of the third subsequence g+1 and the image pixel matrix is divided into blocks B g The operation rules between are used to perform another DNA operation to obtain the image pixel matrix block after the diffusion replacement; wherein g is the sequence number of the pixel matrix block.
5. The method according to claim 4, It is characterized in that The step of determining the operation rules between the encoded image pixel matrix blocks and the encoded two-dimensional random matrix blocks according to the sequence value of the normalized third subsequence specifically includes: B g+1 When the sequence value of the normalized third subsequence is 0, the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "add" operation in the encryption operation rule table; When the sequence value of the normalized third subsequence is 1, between the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform the "subtraction" operation in the encryption operation rule table; When the sequence value of the normalized third subsequence is 2, between the encoded image pixel matrix block and the corresponding encoded two-dimensional random matrix block, the image pixel matrix block B g+1 and the image pixel matrix block B g Perform "XOR" operation in the encryption operation rule table.
6. The method according to claim 1, It is characterized in that The selecting the fourth subsequence of the pulse chaos sequence to determine the decoding scheme of the image pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the image pixel matrix block after the diffusion replacement, and obtaining the decoded image pixel matrix block specifically includes: According to the DNA decoding rule table, 8 decoding schemes are obtained, which are recorded as decoding scheme 1, decoding scheme 2, ..., decoding scheme 8; Normalizing the sequence value of the fourth subsequence of the pulse chaotic sequence to 0-7 to obtain a normalized fourth subsequence; and the values 0-7 correspond to decoding schemes 1-8; Each sequence value in the normalized fourth subsequence corresponds one-to-one to each of the image pixel matrix blocks after diffusion replacement; The value of the normalized fourth subsequence is used to determine the decoding scheme of the corresponding image pixel matrix block after diffusion replacement to perform DNA decoding.
7. The method according to claim 1, It is characterized in that The step of merging the decoded image pixel matrices into blocks to obtain a merged image pixel matrix C, and then performing a scrambling and replacement operation on the merged image pixel matrix C to obtain a final encrypted image specifically includes: 1) Using logistic chaotic system x q+1 =μx q (1-x q ) where μ∈(0,4), x 0 ∈(0,1), q∈ integer; Perform a chaotic iteration respectively to obtain two state values x 1 and x 2 ; 2) Scanning the elements of the merged image pixel matrix C row by row, specifically comprising the following steps: A1. Randomly select a row of elements of the merged image pixel matrix C for scanning, and let x i0 =x 1 ; (a) If j < i, then set j = i, and take the remainder of x 1 to obtain k 1 , k 2 ; where i is the row number of the pixel in the merged image pixel matrix C, and j is the column number of the pixel in the merged image pixel matrix C; (b) If j==i, then for C(i,:) and k 1 Perform XOR operation; (c) If j>i, then for C(i,:) and k 1 Perform XOR operation on C(j,:) and k 2 Perform XOR operation; then swap C(i,:) and C(j,:); Among them, x i0 represents the x when scanning the elements of the merged image pixel matrix C row by row 0 ; C(i,:) represents the i-th row element of the merged image pixel matrix C; C(j,:) represents the j-th row element of the merged image pixel matrix C; A2. Update x i0 , let the updated x i0 Equal to x before update i0 Add s′, s′=sum(C(i,:)) / 1000, scan the next row of matrix elements, repeat the above operations (a) to (c) until all rows of the matrix are traversed to obtain the image pixel matrix C′ after row-by-row scanning; 3) Scan the elements of the image pixel matrix C′ column by column: B1. Randomly select a column of elements in the image pixel matrix C′ for scanning, let x j0 =x 2 ; (d) If j < i, then set j = i, and take the remainder of x 2 to obtain k 1 ′, k 2 ′; (e) If j==i, then for C′(:, j) and k 1 ' Perform XOR operation; (f) If j>i, then for C′(:, j) and k 1 ′ performs XOR operation; C′(:, i) and k 2 ' performs XOR operation; then swap C'(:, j) and C'(:, i); Among them, x j0 represents the x when scanning the elements of the merged image pixel matrix C′ column by column 0 ; C′(:, j) represents the j-th column element of the image pixel matrix C′; C′(:, i) represents the i-th column element of the image pixel matrix C′; B2. Update x j0 , let the updated x j0 Equal to x before update j0 Add s′, s′=sum(C(i,:)) / 1000, scan the next column of matrix elements, and repeat the above operations (d) to (f) until all the columns of the matrix are traversed; 4) Obtain the encrypted image after scrambling and replacement, that is, obtain the final ciphertext image.
8. An image encryption system based on impulsive differential equation chaotic system, It is characterized in that The system includes a pre-processing module before image encryption processing and an image encryption processing module: The pre-processing module before the image encryption process includes: Impulse chaos sequence acquisition unit: used to construct the impulse differential equation chaotic system and solve the impulse chaos sequence; Among them, constructing an impulse differential equation chaotic system and solving the impulse chaotic sequence specifically includes: The constructed impulsive differential equation chaotic system comprises: Among them, x(t), y 1 (t), y 2 (t), z 1 (t), z 2 (t) is the state variable of the chaotic system, r, k, α, β, γ, δ, b 1 , d 1 , d 2 , d 3 , d 4 ,ε,m 1 is the control parameter of the chaotic system, μ 1 is the pulse variable, T is the pulse period; Solving the impulsive chaotic sequence based on the impulsive differential equation chaotic system specifically includes: 1) Input the pulse differential equation and all its state variables and control parameters, and divide the pulse period T into f pulse intervals with f+1 pulse times, where f+1 pulse time is denoted as τ 0 , τ 1 , τ 2 , ..., τ f ; At the initial pulse time τ 0 , assign initial values to all state variables; x(0)=sum(sum(bitand(I,3))) / (3*SUM); y 1 (0)=sum(sum(bitand(I,12) / 4)) / (3*SUM); y 2 (0)=sum(sum(bitand(I,48) / 16)) / (3*SUM); z 1 (0)=sum(sum(bitand(I,192) / 64)) / (3*SUM); z 2 (0)=sum(sum(bitand(I,768) / 256)) / (3*SUM); s11=(sum(sum(I))) / (2*sum(sum(I))+(1 / sum(sum(I)))); m 1 =μ 1 (0)*10+s11; Wherein, sum() represents a summation function; bitand() represents returning the result of a bitwise AND operation of two numerical values; SUM represents the pixel value of the image to be encrypted; s11 is an auxiliary parameter; I is the image pixel matrix; 2) Call the Runge-Kutta algorithm to solve (τ 0 , τ 1 ) a numerical solution of the pulse differential function within the pulse interval; when the solution time reaches the next pulse moment, the pulse differential function value at the pulse moment is assigned as the pulse variable value, and all state variables are assigned; 3) Calculate the numerical solution of the pulse differential function of all pulse intervals according to step 2); 4) Until the pulse time τ is detected f Until then, the numerical solution of the function in all pulse intervals is output. x(n)=(x(1),x(2),...,x(f)) and 1 (n)=(y 1 (1),and 1 (2),...,and 1 (F)) and 2 (n)=(y 2 (1),and 2 (2),...,and 2 (F)) With 1 (n)=(z 1 (1),with 1 (2),...,of 1 (f)) With 2 (n)=(z 2 (1),with 2 (2),...,of 2 (f)) Where x(n) is the first subsequence of the impulse differential chaotic series, y 1 (n) is the second subsequence of the impulse differential chaos series, y 2 (n) is the third subsequence of the impulse differential chaos series, z 1 (n) is the fourth subsequence of the impulse differential chaos series, z 2 (n) is the fifth subsequence of the pulse differential chaotic series; A two-dimensional random matrix construction unit: used to iteratively generate a random sequence using Logistic mapping, and construct an M*N two-dimensional random matrix based on the random sequence; The image encryption processing module comprises: Scrambling and blocking unit: used for reading pixel information of the image to be encrypted to construct an M*N image pixel matrix, scrambling the image pixel matrix using the Henon algorithm to obtain a scrambled image pixel matrix; dividing the scrambled image pixel matrix and the two-dimensional random matrix into blocks by rows to obtain image pixel matrix blocks and two-dimensional random matrix blocks respectively; DNA encoding unit: used for selecting the first subsequence and the second subsequence of the pulse chaotic sequence to respectively determine the encoding schemes of the image pixel matrix block and the two-dimensional random matrix block, and performing DNA encoding on the pixel values in the image pixel matrix block and the matrix values in the two-dimensional random matrix block to obtain the encoded image pixel matrix block and the encoded two-dimensional random matrix block; DNA operation unit: used for selecting the third subsequence of the pulse chaotic sequence to determine the operation rule between the encoded image pixel matrix block and the encoded two-dimensional random matrix block, performing DNA operation, and obtaining the pixel matrix block after diffusion replacement; DNA decoding unit: used for selecting the fourth subsequence of the pulse chaotic sequence to determine the decoding scheme of the pixel matrix block after the diffusion replacement, performing DNA decoding on the pixel values in the pixel matrix block after the diffusion replacement, and obtaining the decoded pixel matrix block; Scrambling replacement unit: used for merging the decoded pixel matrix blocks to obtain a merged image pixel matrix C, and then performing a scrambling replacement operation on the merged image pixel matrix C to obtain a final encrypted image.
