Text encryption method based on chaotic cryptographic algorithm principle
By generating text encryption sequences based on the mKdv equation based on chaos theory, and using Arnold mapping to construct S box and P box, combined with the Knockoff variable selection method and differential evolution algorithm, the key of traditional text encryption algorithm under multiple decision variables and multi-decision goals is solved. The problems of small space, low sensitivity, slow speed and poor security have achieved the encryption effect of large key space, high sensitivity, fast speed and good security.
Patent Information
- Application Number
- CN202411188126.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When dealing with multi-decision variables and multi-decision goals, traditional text encryption algorithms have problems such as small key space, low sensitivity, slow speed, poor security and weak attack resistance. Especially when the countermeasures are complex, it is difficult to effectively encrypt.
The cryptographic algorithm based on chaos theory is used to generate text encryption sequences through mKdv equations, and the S box and P box are constructed using Arnold mapping. Combined with the Knockoff variable selection method and the differential evolution algorithm, multiple iterative encryption operations are carried out to generate the encryption and decryption key.
It realizes text encryption effect of large key space, high sensitivity, fast speed and good security, significantly improving its attack resistance.
Smart Images

Figure CN119316114A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of text encryption, in particular to a text encryption method based on the principle of chaotic cryptographic algorithm. Background Art
[0002] Traditional text encryption algorithms are difficult to satisfy the calculation of multiple decision variables and multiple decision targets. That is to say, we need to consider various countermeasure constraints during operation. Countermeasure constraints mainly include two aspects: inequality constraints and equality constraints. Inequality constraints refer to that decision variables need to meet some restrictions, such as resource constraints, technical constraints, etc. This series of calculation processes is difficult for traditional text encryption algorithms to complete. Therefore, when encrypting text, the key space is small, the sensitivity is low, the speed is slow, the security is poor, and the pit attack capability is weak. In view of the above problems, the invention is improved. Summary of the invention
[0003] The invention proposes a text encryption method based on the principle of chaotic cryptographic algorithm, which solves the above problems existing in the use process of the prior art.
[0004] The technical solution of the invention is implemented as follows: a text encryption method based on the principle of chaotic cryptographic algorithm, including three modules, namely a sequence generation module, an S-box & P-box generation module and an encryption algorithm module, the sequence generation module:
[0005] The text encryption sequence is generated based on the mKdv equation. The mKdV equation is as follows:
[0006] u t +au 2 u x +u xxx =0. (1)
[0007] By means of the transformation u(x,t)=α(x-ct), equation (1) is transformed into the following form
[0008] -cα′+α″′+aα 2 α′=0. (2)
[0009] Considering that the solitary wave decays to zero, after integrating equation (2), let the integral coefficient be 0, then the solitary wave satisfies the following equation:
[0010]
[0011] When there is a disturbance term ε(x), equation (3) becomes
[0012]
[0013]
[0014] In the perturbation function (5) and ω i represent amplitude and frequency respectively;
[0015] Let β = α′, then system (4) can be rewritten as:
[0016]
[0017] At this time, for a given c>0, under the disturbance ε(x), the solitary waves in equation (3) are all chaotic. If a linear feedback controller is introduced into the system, the chaotic state of the system can be controlled;
[0018] Let the linear feedback controller be μ = eβ, then the disturbed system (6) after being controlled is in the following form:
[0019]
[0020] Melnikov analysis of system (7) reveals that: The critical value is obtained, and when e|>(e)0, the chaos can be controlled within a stable range;
[0021] S-box & P-box generation module:
[0022] Generate two chaotic sequences w1 and w2 with a length of 5000 using formula (2), discard the first 20% (i.e., discard the first 1000 items to improve randomness), and map w1 and w2 from the real number domain to the integer domain using formula (4) to obtain z1 and z2. Then use formula (5) to generate two sets of linear congruential generators LCG1 and LCG2. After obtaining z1, z2, LCG1 and LCG2, perform bitwise XOR on z1 and LCG1, z2 and LCG2, and then perform bitwise XOR on the results and take the modulus with the specified number (take the modulus with 256 when generating S box, and take the modulus with the packet length when generating P box) to obtain the initial S box and P box. Finally, the final S box and P box can be obtained through Arnold mapping. The algorithm steps of the encryption algorithm module are as follows:
[0023] S1: Open the source and target files in binary mode;
[0024] S2: Generate encryption and decryption keys using the text data encryption key stream algorithm; the fixed parameter values are as follows: N = 9, ω1 = 0.05, ω2 = 0.53, ω3 = 0.2, ω4 = 0.42, ω5 = 0.61, ω6 = 0.81, ω7 = 0.15, ω8 = 0.73, ω9 = 0.37. Calculate the following data:
[0025] K1=(x1×100+x2×10+x3)mod256
[0026] K2=(x1×100+x3×10+x2)mod256
[0027] K3=(x2×100+x1×10+x3)mod256
[0028] K4=(x2×100+x3×10+x1)mod256
[0029] K5=(x3×100+x1×10+x2)mod256
[0030] K6=(x3×100+x2×10+x1)mod256;
[0031] S3: Read the plaintext content, perform XOR operation on the position number i of the plaintext byte and the data corresponding to i in the key stream to obtain the ciphertext;
[0032] S4: Store the corresponding byte encrypted ciphertext into the target file;
[0033] S5: Repeat the above operation until all plaintext data is read;
[0034] S6: Close the source file and the target file.
[0035] The invention is a text encryption method for a chaotic cryptographic algorithm as described above, further comprising: fixing parameters a=6, c=3.8 in S2, changing parameter d, finding the chaotic control parameter e1 and any decimal e1′ less than |e1| by the maximum Liyapu exponent, and randomly selecting the decimal place x1 from e1′. .
[0036] The invention of the text encryption method based on the principle of chaos cryptographic algorithm as described above is further: fixed parameters c=3.8, d=1 in S2, variable parameter a, the chaos control parameter e2 and any decimal e2′ less than |e2| are found by the maximum Liyapu exponent, and the decimal place x2 is randomly selected from e2′.
[0037] The invention of the text encryption method based on the principle of chaos cryptographic algorithm as described above is further: fixed parameters a=6, d=1 in S2, variable parameter c, the chaos control parameter e3 and any decimal e3′ less than |e3| are found by the maximum Liyapu exponent, and the decimal place x3 is randomly selected from e3′.
[0038] The invention of the text encryption method based on the chaos cryptographic algorithm principle as described above further comprises: in S2, K1 to K6 are used as encryption keys.
[0039] The invention of the text encryption method based on the principle of chaotic cryptographic algorithm as described above is further: when generating S box, the modulo 256 is taken, and when generating P box, the modulo the block length is taken.
[0040] The invention is further directed to the text encryption method for the cryptographic algorithm principle based on chaos as described above:
[0041] The invention of the text encryption method based on the principle of chaos-based cryptographic algorithm as described above is further: wherein α′(x) is the derivative of α(x), c refers to the propagation speed of the wave, and a is the parameter of the nonlinear dispersion term.
[0042] The invention of the text encryption method based on the chaos cryptographic algorithm principle as described above further comprises: wherein, the general expression of ε(x) is:
[0043] The invention is a text encryption method for a cryptographic algorithm based on chaos as described above, further comprising: Yes i The function and is a constant.
[0044] In summary, the beneficial effects of the invention are:
[0045] 1. The present invention adopts Arnold mapping to construct S-box and P-box, and then produces text encryption sequence based on mKdv equation for sorting method scrambling, and completes the encryption operation through multiple rounds of iterations. Moreover, due to the combination of Knockoff variable selection method and differential evolution algorithm, the basic idea of the algorithm is to simulate the original variables by constructing a set of Knockoff variables, and find the optimal solution by comparing the correlation between the real variables and the Knockoff variables. Theoretical analysis and experimental results show that the method has the advantages of large key space, high sensitivity, fast speed, good security, strong anti-attack ability, etc., and can solve problems with multiple decision variables and multiple decision goals. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 This is a diagram of the text encryption and decryption scheme based on the mKdV equation;
[0048] Figure 2 This is the flow chart of text encryption and decryption based on the mKdV equation. DETAILED DESCRIPTION
[0049] The following will be combined with the attached embodiment of the invention Figure 1-2, clearly and completely describe the technical solutions in the embodiments of the invention. Obviously, the described embodiments are only part of the embodiments of the invention, not all of them. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.
[0050] Example
[0051] A text encryption method based on the principle of chaotic cryptographic algorithm includes three modules, namely, a sequence generation module, an S-box & P-box generation module and an encryption algorithm module. The sequence generation module:
[0052] The text encryption sequence is generated based on the mKdv equation. The mKdV equation is as follows:
[0053] u t +au 2 u x +u xxx =0. (1)
[0054] By means of the transformation u(x,t)=α(x-ct), equation (1) is transformed into the following form
[0055] -cα′+α″′+aα 2 α′=0. (2)
[0056] where α′(x) is the derivative of α(x), c is the wave propagation velocity, and a is the parameter of the nonlinear dispersion term.
[0057] Considering that the solitary wave decays to zero, after integrating equation (2), let the integral coefficient be 0, then the solitary wave satisfies the following equation:
[0058]
[0059] in
[0060] When there is a disturbance term ε(x), equation (3) becomes
[0061]
[0062] Among them, the general expression of ε(x) is
[0063]
[0064] In the perturbation function (5) and ω i represent amplitude and frequency respectively;
[0065] Let β = α′, then system (4) can be rewritten as:
[0066]
[0067] At this time, for a given c>0, under the disturbance ε(x), the solitary waves in equation (3) are all chaotic. If a linear feedback controller is introduced into the system, the chaotic state of the system can be controlled;
[0068] Let the linear feedback controller be μ = eβ, then the disturbed system (6) after being controlled is in the following form:
[0069]
[0070] Melnikov analysis of system (7) reveals that: The critical value is obtained, and when e|>(e)0, the chaos can be controlled within a stable range, where Yes i The function and is a constant;
[0071] S-box & P-box generation module:
[0072] Generate two chaotic sequences w1 and w2 with a length of 5000 using formula (2), discard the first 20% (i.e., discard the first 1000 items to improve randomness), and map w1 and w2 from the real number domain to the integer domain using formula (4) to obtain z1 and z2. Then use formula (5) to generate two sets of linear congruential generators LCG1 and LCG2. After obtaining z1, z2, LCG1 and LCG2, perform bitwise XOR on z1 and LCG1, z2 and LCG2, and then perform bitwise XOR on the results and take the modulus with the specified number (take the modulus with 256 when generating S box, and take the modulus with the packet length when generating P box) to obtain the initial S box and P box. Finally, the final S box and P box can be obtained through Arnold mapping. The algorithm steps of the encryption algorithm module are as follows:
[0073] S1: Open the source and target files in binary mode;
[0074] S2: Generate encryption and decryption keys using the text data encryption key stream algorithm; the fixed parameter values are as follows: N = 9, ω1 = 0.05, ω2 = 0.53, ω3 = 0.2, ω4 = 0.42, ω5 = 0.61, ω6 = 0.81, ω7 = 0.15, ω8 = 0.73, ω9 = 0.37.;
[0075] With fixed parameters a=6, c=3.8 and variable parameter d, the chaos control parameter e1 and any decimal e1′ less than |e1| are found by the maximum Liyapu index, and the decimal place x1 is randomly selected from e1′;
[0076] Fixed parameters c = 3.8, d = 1, variable parameter a, find the chaos control parameter e2 and any decimal e2′ less than |e2| by the maximum Liyapu index, and randomly select the decimal place x2 from e2′;
[0077] Fixed parameters a=6, d=1, variable parameter c, find the chaos control parameter e3 and any decimal e3′ less than |e3| by the maximum Liyapu index, and randomly select the decimal place x3 from e3′;
[0078] Calculate the following data:
[0079] K1=(x1×100+x2×10+x3)mod256
[0080] K2=(x1×100+x3×10+x2)mod256
[0081] K3=(x2×100+x1×10+x3)mod256
[0082] K4=(x2×100+x3×10+x1)mod256
[0083] K5=(x3×100+x1×10+x2)mod256
[0084] K6=(x3×100+x2×10+x1)mod256;
[0085] Use K1~K6 as encryption keys;
[0086] Generate text data key stream based on RC4 encryption:
[0087] Given a state vector S: length is 256, S[0], S[1]....S
[255] , a temporary vector T: length is 256, T[0], T[1]....T
[255] , a key K table, the length of which is determined by the length of the text;
[0088] Use 0 to 255 to fill the S table in sequence, and use encryption keys K1 to K6 to fill the T table, that is:
[0089] for i=0to255do
[0090] S[i]=i;
[0091] j = i mod 6;
[0092] T[i]=K j ;
[0093] Initially arrange the S table, the operation is as follows:
[0094] for i=0to255do
[0095] j = (j + S[i] + T[i]) mod 256;
[0096] swap(S[i],S[j]); swap S[i] and S[j]
[0097] Using the length of the text data, generate the text data encryption key stream:
[0098] i = rand(256) generates a random number between 0 and 256
[0099] j = rand(256) generates a random number between 0 and 256
[0100] t=0
[0101] forr=0to len do / / r is the length of the plain text, r bytes
[0102] i = (i + 1) mod 256;
[0103] j = (j + S[i]) mod 256;
[0104] swap(S[i],S[j]);
[0105] t = (S[i] + S[j]) mod 256;
[0106] K[r]=S[t].
[0107] S3: Read the plaintext content, perform XOR operation on the position number i of the plaintext byte and the data corresponding to i in the key stream to obtain the ciphertext;
[0108] S4: Store the corresponding byte encrypted ciphertext into the target file;
[0109] S5: Repeat the above operation until all plaintext data is read;
[0110] S6: Close the source file and the target file.
[0111] The usage process is as follows: write the algorithm into the computing device and ensure the normal operation of the device. It should be noted that the hardware equipment supporting the algorithm also meets the usage requirements. When using it, start the device, follow the corresponding steps, press the start switch, and the device will generate an encryption and decryption sequence based on the mKdv equation, and then open the source file and the target file. After that, m = read a byte of the file. After that, the system determines whether m is the end byte of the file. If the result is no, m is XORed with the RC4 scheme, and the operation is performed again to determine whether m is the end byte of the file, until the result is yes, then m is written to the target file, and finally the file encryption is completed.
[0112] It should be noted that the functions to be implemented by each hardware in the invention are supported by a large number of mature technologies and belong to the prior art. The essence of the invention lies in optimizing the combination of existing hardware and its connection methods for specific application scenarios to meet the adaptation needs in specific application scenarios and solve the problems raised in the background technology (not involving improvements to the software inside the hardware).
[0113] The above description is only a preferred embodiment of the invention and is not intended to limit the invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the invention should be included in the protection scope of the invention.
Claims
1. A text encryption method based on the principle of chaotic cryptographic algorithm, comprising three modules, namely a sequence generation module, an S-box & P-box generation module and an encryption algorithm module, characterized in that: Sequence generation module: Generates text encryption sequence based on the mKdv equation. The mKdV equation is as follows: in t +au 2 in x +in xxx =0. (1) By means of the transformation u(x,t)=α(x-ct), equation (1) is transformed into the following form -cα′+α″′+aα 2 α′=0. (2) Considering that the solitary wave decays to zero, after integrating equation (2), let the integral coefficient be 0, then the solitary wave satisfies the following equation: When there is a disturbance term ε(x), equation (3) becomes In the perturbation function (5) and ω i represent amplitude and frequency respectively; Let β = α′, then system (4) can be rewritten as: At this time, for a given c>0, under the disturbance ε(x), the solitary waves in equation (3) are all chaotic. If a linear feedback controller is introduced into the system, the chaotic state of the system can be controlled; Let the linear feedback controller be μ = eβ, then the disturbed system (6) after being controlled is in the following form: Melnikov analysis of system (7) reveals that: The critical value is obtained, and when e|>(e)0, the chaos can be controlled within a stable range; S-box & P-box generation module: Generate two chaotic sequences w1 and w2 with a length of 5000 using formula (2), discard the first 20% (i.e., discard the first 1000 items to improve randomness), and map w1 and w2 from the real number domain to the integer domain using formula (4) to obtain z1 and z2. Then use formula (5) to generate two sets of linear congruential generators LCG1 and LCG2. After obtaining z1, z2, LCG1 and LCG2, perform bitwise XOR on z1 and LCG1, z2 and LCG2, and then perform bitwise XOR on the results and take the modulus with the specified number (take the modulus with 256 when generating S box, and take the modulus with the packet length when generating P box) to obtain the initial S box and P box. Finally, the final S box and P box can be obtained through Arnold mapping. The algorithm steps of the encryption algorithm module are as follows: S1: Open the source and target files in binary mode; S2: Generate encryption and decryption keys using the text data encryption key stream algorithm; the fixed parameter values are as follows: N = 9, ω1 = 0.05, ω2 = 0.53, ω3 = 0.2, ω4 = 0.42, ω5 = 0.61, ω6 = 0.81, ω7 = 0.15, ω8 = 0.73, ω9 = 0.
37. Calculate the following data: K1=(x1×100+x2×10+x3)mod256 K2=(x1×100+x3×10+x2)mod256 K3=(x2×100+x1×10+x3)mod256 K4=(x2×100+x3×10+x1)mod256 K5=(x3×100+x1×10+x2)mod256 K6=(x3×100+x2×10+x1)mod256; S3: Read the plaintext content, perform XOR operation on the position number i of the plaintext byte and the data corresponding to i in the key stream to obtain the ciphertext; S4: Store the corresponding byte encrypted ciphertext into the target file; S5: Repeat the above operation until all plaintext data is read; S6: Close the source file and the target file.
2. A text encryption method based on the principle of chaos cryptographic algorithm according to claim 1, characterized in that: In S2, the parameters a=6, c=3.8 are fixed, and the parameter d is varied. The chaos control parameter e1 and any decimal e1′ less than |e1| are found by the maximum Liyapu index, and the decimal place x1 is randomly selected from e1′.
3. A text encryption method based on the principle of chaos cryptographic algorithm according to claim 1, characterized in that: In S2, the parameters c=3.8, d=1 are fixed, and the parameter a is changed. The chaos control parameter e2 and any decimal e2′ less than |e2| are found by the maximum Liyapu index, and the decimal place x2 is randomly selected from e2′.
4. The text encryption method based on the chaos cryptographic algorithm principle according to claim 1 is characterized in that: In S2, the parameters a=6, d=1 are fixed, and the parameter c is varied. The chaos control parameter e3 and any decimal e3′ less than |e3| are found by the maximum Liyapu index, and the decimal place x3 is randomly selected from e3′.
5. The text encryption method based on the chaos cryptographic algorithm principle according to claim 1 is characterized in that: In S2, K1 to K6 are used as encryption keys.
6. The text encryption method based on the chaos cryptographic algorithm principle according to claim 1 is characterized in that: When generating an S-box, the modulo 256 is used; when generating a P-box, the modulo the packet length is used.
7. The text encryption method based on the chaos cryptographic algorithm principle according to claim 1 is characterized in that:
8. The text encryption method based on the chaos cryptographic algorithm principle according to claim 1 is characterized in that: where α′(x) is the derivative of α(x), c is the wave propagation velocity, and a is the parameter of the nonlinear dispersion term.
9. The text encryption method based on the chaos cryptographic algorithm principle according to claim 1 is characterized in that: in, The general expression of ε(x) is.
10. The text encryption method based on the chaos cryptographic algorithm principle according to claim 1 is characterized in that: in Yes i The function and is a constant.