A method for parallelizing and resisting dynamic degradation of a key stream generator
By parallelizing the keystream generator and using methods to resist dynamic degradation, the hardware speed limitations and dynamic degradation issues of the keystream generator are solved, thereby improving the generation speed and reducing system security risks. This approach is suitable for heterogeneous computing platforms.
Patent Information
- Application Number
- CN202211026812.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-25
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-08-25
AI Technical Summary
Keystream generators suffer from speed limitations and dynamic degradation issues in hardware implementation, making them unsuitable for high-speed encryption and decryption applications. Furthermore, dynamic degradation may weaken system security.
We employ parallelization of keystream generators and methods to resist dynamic degradation. Multiple keystream generators work in parallel and are automatically reinitialized after a certain number of iterations. We use a chaotic mapping algorithm to generate keystreams, thereby improving the generation speed and reducing the risk of dynamic degradation.
It achieves an improvement in key stream generation speed, enabling more than a 4x speedup on heterogeneous computing platforms, while effectively reducing the possibility of dynamic degradation and improving system security.
Smart Images

Figure CN115459906B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cryptography, and in particular to a method for parallelization and anti-dynamic degradation of a key stream generator. BACKGROUND
[0002] A stream cipher belongs to a symmetric cryptosystem, and uses the same or equivalent key to realize encryption and decryption. It has a large number of applications in the field of secure communication due to its advantages such as easy hardware implementation, simple encryption and decryption, and small error propagation probability. A stream cipher uses a group of keys as input to initialize a key stream generator, generates a group of key streams, and then uses the key streams to operate on plaintext or ciphertext according to certain rules to realize the encryption of plaintext or the decryption of ciphertext.
[0003] A key stream generator is a core component of a stream cipher. It uses input keys to complete initialization, iterates according to certain rules, and generates key streams. Since each iteration is related to the key or the previous iteration result, the iteration can only be completed sequentially to generate the key stream. This seriously limits the speed of the key stream generator in generating the key stream, and cannot meet the needs of high-speed encryption and decryption application scenarios.
[0004] In addition, no matter how good the statistical properties of the key stream generator are in theory, when it is implemented on hardware with limited precision, the problem of dynamic degradation will occur. This may weaken the statistical properties of the key stream and thus reduce the security of the system. SUMMARY
[0005] To overcome the speed and dynamic degradation problems of the key stream generator, the present application provides a method for parallelization and anti-dynamic degradation of a key stream generator, which effectively improves the speed of generating key streams and alleviates the problem of dynamic degradation.
[0006] To achieve the above-mentioned purpose, the present application adopts a method for parallelization and anti-dynamic degradation of a key stream generator,
[0007] S1, receiving an initial key;
[0008] S2, using a preset key stream generator initialization method to initialize the key stream generator simultaneously or in steps based on the initial key on all key stream generators. After initialization, the key stream generator uses a preset parallel working method to generate key streams in parallel;
[0009] S3, using a preset combination method to combine the key streams generated by the key stream generator to generate the final key stream used for encryption and decryption.
[0010] S4, the key stream generator is reinitialized by using a preset key stream generator reinitialization method after iterating to a specified iteration upper limit.
[0011] Further, the initial key has at least one key, one key is used to complete the initialization of one key stream generator, and one key is composed of at least one parameter.
[0012] Further, the key stream generator generates an iteration result by using a mapping iteration method, and the specific process is as follows:
[0013] The mapping is denoted as F, the key is denoted as k0, the key is substituted into the mapping to complete the initialization of the key stream generator: F(k0)=z1, where z1 is referred to as an iteration result;
[0014] z1 is used to replace one or more parameters in k0 to obtain k1, and k1 is substituted into the mapping, that is, F(k1)=z2, according to F(k i-1 )=z i , iteration can be performed to generate a group of iteration results (key streams) z1,…,z n .
[0015] Further, the total number of key stream generators is denoted as M, and then
[0016] The initialization of the key stream generator in S2 includes:
[0017] The M key stream generators are initialized based on the initial key, and the number of keys in the initial key is M;
[0018] The initialization of the key stream generator in S2 includes:
[0019] First, the K key stream generators are initialized by using the initial key, the number of keys in the initial key is K, and 1≤K≤M, and then the iteration results of the K key stream generators are used to construct M-K keys according to the structure of k0, to complete the initialization of the remaining key stream generators.
[0020] Further, the preset parallel operation method includes:
[0021] In the case that the key stream generators are initialized simultaneously in S2: all the key stream generators are iterated in parallel, the iteration results generated are combined by using a preset combination method, and the final key stream used for encryption and decryption is generated;
[0022] In the case of step-by-step initialization of the key stream generator in S2: K (1≤K≤M) key stream generators are used to generate keys, where M is the total number of key stream generators, the remaining M-K key stream generators are initialized, the M-K key stream generators are iterated in parallel, and the iteration results are combined using a preset combination method to generate the final key stream for encryption and decryption.
[0023] Further, the preset combination method includes sequential arrangement, alternating arrangement and scrambling arrangement.
[0024] Further, in S4, the preset key stream generator reinitialization method includes:
[0025] Selecting a corresponding selection iteration result from the iteration result of the key stream generator itself to construct a new key, substituting the new key into the mapping, and reinitializing the mapping;
[0026] And / or
[0027] Selecting a corresponding iteration result from the iteration result of other key stream generators to construct a new key, substituting the new key into the mapping, and reinitializing the mapping.
[0028] The key stream generator parallelization and anti-dynamic degradation method of the application has the following beneficial effects:
[0029] The key stream generator parallelization and anti-dynamic degradation method of the application directly initializes all key stream generators with user input keys or initializes one or more key stream generators first, and then uses the generated key stream to initialize other key stream generators, so that multiple key stream generators can work in parallel and generate key streams simultaneously, effectively improving the key stream generation speed.
[0030] The above method is suitable for different software and hardware platforms and is easy to implement. For example, it can achieve more than 4 times speed improvement on the micro-embedded system Jetson Xavier NX (6-core NVIDIA Carmel ARM v8.2 64-bit CPU). Using a more powerful CPU can achieve higher throughput, and heterogeneous computing can be used, such as using GPU to further improve performance. In addition, all key stream generators are automatically reinitialized using the generated key stream after a certain number of iterations, greatly reducing the possibility of key stream generator falling into a loop and dynamic degradation.
[0031] Specific embodiments of the present invention are disclosed in detail with reference to the following description and accompanying drawings, indicating how the principles of the present invention can be adopted. It should be understood that the embodiments of the present invention are not limited in scope as a result, and that the embodiments of the present invention include many changes, modifications and equivalents within the spirit and scope of the appended claims. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating a method for parallelizing and resisting dynamic degradation in a keystream generator.
[0033] Figure 2 This is a schematic diagram of the stream cipher decryption process in an embodiment of the present invention;
[0034] Figure 3 A working block diagram of a method for parallelizing and resisting dynamic degradation of a key stream generator;
[0035] Figure 4 The diagram shows a working block diagram of a key stream generator parallelization and anti-dynamic degradation method based on a chaotic mapping algorithm.
[0036] Figure 5 This is a flowchart illustrating the working process of the method for updating chaotic mappings in this invention. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. However, it should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of the invention.
[0038] It should be noted that when an element is referred to as "set on" or "provided with" another element, it can be directly on the other element or there may be an intermediate element. When an element is referred to as "connected to" or "connected to" another element, it can be directly connected to the other element or there may be an intermediate element at the same time. "Fixed connection" means fixed connection. There are many ways of fixed connection, which are not within the scope of protection of this document. The terms "vertical", "horizontal", "left", "right" and similar expressions used in this document are only for illustrative purposes and do not represent the only implementation method.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in the specification herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0040] Please refer to the instruction manual appendix. Figures 1-5The following describes the implementation of the present invention. In the process of stream cipher operation, a keystream generator parallelization and anti-dynamic degradation method is applied. Generally, stream ciphers initialize a pseudo-random number generator with a set of keys, and then generate bit strings for user data encryption in batches. Specifically...
[0041] A stream cipher system consists of a six-tuple (M1, C1, K1, Z, E, D) and a function g, where M1 is the plaintext space, C1 is the ciphertext space, K1 is the set of all possible keys, and Z is the set of all possible keystream characters, which satisfy:
[0042] Function g is a keystream generator that takes a key k∈K1 as input, initializes it, and then outputs a keystream z = z1, z2, ... z n (z i ∈Z).
[0043] For any z∈Z, there exists an encryption function e z ∈E and the corresponding decryption function d z ∈D. And for each e z :M1→C 1,d z :C1→M1, for any plaintext m∈M1, we have d z (e z (m1))=m1.
[0044] like Figure 2 As shown, the encryption and decryption process of stream ciphers generally involves user A inputting key k1 to initialize a keystream generator. The keystream generator then generates keystream z in batches and encrypts plaintext m1 to generate ciphertext c1, which is transmitted to user B through the channel. User B uses the same key k1 to initialize the keystream generator to generate keystream z, and uses keystream z to decrypt ciphertext c1 to obtain plaintext m1.
[0045] The general working process of the core key stream generator of stream cipher is as follows: Figure 2 As shown, a keystream generator is initialized with a set of inputs. After initialization and some processing, the first iteration result z1 is generated. Then, based on z1, the second iteration result is generated. Existing keystream generators may have slightly different working processes, but they all basically continue to iterate and generate keystreams based on the previously generated iteration results. The correlation between iteration results means that keystream generators can only work sequentially, generating iteration results one by one to form a keystream. Parallel operation is difficult and cannot meet the requirements of high-speed encryption and decryption applications.
[0046] To improve the speed of password stream generation, in Figures 1-3 An embodiment of a keystream generator parallelization and anti-dynamic degradation method is shown, which includes the following implementation steps:
[0047] A method for parallelizing a key stream generator and resisting dynamic degradation, comprising:
[0048] S1. Receive the initial key input by the user; in this step, the number of the above-mentioned initial keys is at least one;
[0049] S2. Based on the initial key, use a preset key sequence generation method on all cipher stream generators to generate the key sequences corresponding to the respective cipher stream generators step by step or simultaneously;
[0050] In this step, based on the initial key, using a preset key sequence generation method on all cipher stream generators to generate the key sequences corresponding to the respective cipher stream generators step by step includes:
[0051] When the number of the initial keys input by the user is K, using K cipher stream generators as the first cipher stream generators, and using a preset key sequence generation method to generate the first key sequences corresponding to each of the first cipher stream generators, 1 ≤ K < M, where M is the total number of cipher stream generators;
[0052] Based on the remaining M - K cipher stream generators as the second cipher stream generators, and using the data in the first key sequences in pairs as the control parameters and initial conditions, the second cipher stream generators use a preset key sequence generation method to generate the second key sequences corresponding to each of the second cipher stream generators.
[0053] Based on the initial key, using a preset key sequence generation method on all cipher stream generators to generate the key sequences corresponding to the respective cipher stream generators simultaneously includes:
[0054] When the number of the initial keys input by the user is M, using each initial key as the input of each cipher stream generator respectively, and using a preset key sequence generation method to generate the key sequences corresponding to each cipher stream generator, where M is the total number of cipher stream generators.
[0055] In this step S2, when the key stream generator iterates a certain number of times, it may generate an iteration result that is the same as or extremely similar to the previous iteration result, which may cause the iteration to fall into a loop, repeatedly generate a set of the same or similar key streams, weaken the statistical characteristics of the key stream, and reduce the system security.
[0056] Therefore, in the present invention, when the chaos mapping algorithm in the cipher stream generator reaches the preset maximum number of iterations, use the first anti-dynamic degradation method or the second anti-dynamic degradation method to initialize the control parameters and initial conditions of the chaos mapping algorithm to update the chaos mapping algorithm;
[0057] The first anti-dynamic degradation method includes:
[0058] After the cryptographic stream generator reaches its maximum number of iterations, it iterates twice more, using the two iteration results as control parameters and initial conditions to reinitialize itself, or it directly reinitializes itself based on two parameters in the key sequence generated by the cryptographic stream generator itself as control parameters and initial conditions.
[0059] The second anti-dynamic degradation method includes: using the cryptographic stream generators that have not reached the maximum number of iterations among the M cryptographic stream generators to continue the chaotic mapping iteration, and using the iteration results of the cryptographic stream generators that have not reached the maximum number of iterations as new control parameters and initial conditions for the cryptographic stream generators that have reached the maximum number of iterations, thereby realizing the reinitialization of the cryptographic stream generators that have reached the maximum number of iterations.
[0060] S3. The key sequences of each cryptographic stream generator are combined using a preset combination method to obtain the key stream used for encryption and decryption.
[0061] In this step, there are two ways to obtain the cipher stream used for encryption and decryption.
[0062] The first method for obtaining the cipher stream used for encryption and decryption: This method corresponds to a method that generates the key sequence of the corresponding cipher stream generator step by step on all cipher stream generators using a preset key sequence generation method based on the initial key. In step S3 of this method, all the second key sequences are combined using a preset combination method to obtain the cipher stream used for encryption and decryption. Correspondingly,
[0063] The first method for obtaining the cipher stream for encryption and decryption is as follows: This method corresponds to the method of synchronously generating the key sequence of the corresponding cipher stream generator on all cipher stream generators using a preset key sequence generation method based on the initial key. In step S3 after this method, the M key sequences generated by the M cipher stream generators are combined using a preset combination method to obtain the cipher stream for encryption and decryption.
[0064] As a further optimization of the above scheme, the preset combination methods include sequential arrangement, alternating arrangement, and random arrangement.
[0065] like Figure 4 and Figure 5 The parallelization and dynamic degradation resistance method for the key stream generator mentioned above will be further discussed:
[0066] The preset key sequence generation method employs a chaotic mapping algorithm, which includes the following steps:
[0067] Based on one parameter of the initial key, denoted as the control parameter p∈(0,0.α), and the other parameter, denoted as the initial condition x0∈[0,β], a chaotic mapping is performed based on p and x0 to generate iterative results.
[0068] The chaotic mapping algorithm is as follows:
[0069]
[0070] During the iterative process of the chaotic mapping algorithm, in the iteration results At that time, As the p-value.
[0071] The following is a preferred embodiment of a keystream generator parallelization and anti-dynamic degradation method based on chaotic mapping. In this preferred embodiment, the number of initial keys is selected as 1, and the two parameters for generating the initial key are p∈(0,0.5) and x0∈[0,1], where p is a control parameter and x is an initial condition. Substituting the two parameters into F(x0,p) generates the iterative result x1, and substituting x1 into F(x1,p) generates the iterative result x2, and so on, repeatedly iterating to generate a set of iterative results {x1,…,x...}. n The generated iteration results can be used for encryption and decryption.
[0072] As can be seen from the above process, the generation of each iteration result is related to the previous iteration process and must be executed sequentially, making parallel processing impossible. Based on this invention, the following scheme can be adopted to achieve parallelization and improve the speed of generating iteration results:
[0073] refer to Figure 4 Set parameters p∈(0,0.5), x0∈[0,1], use them as keys to initialize a chaotic mapping, and generate a set of iterative results.
[0074] The iterative results above are paired up as new control parameters and initial conditions to initialize a set of chaotic mappings. Note that since p∈(0,0.5), when the iterative results... At that time, it can be As the p-value.
[0075] After initialization, multiple chaotic maps can work in parallel and generate iterative results simultaneously, effectively improving the speed of iterative result generation.
[0076] Once the chaotic mapping generates enough keys, all the generated iteration results are combined according to certain rules. As shown below, all iteration results can be organized in a sequential manner. This sequence can be used for encryption and decryption.
[0077] For the above process, the method for updating the chaotic mapping is as follows: Figure 5 a and Figure 5 As shown in b:
[0078] Figure 5In step a, for the chaotic mapping on the left side of the map, after reaching the upper limit of iteration, iterate twice more, and use the two iteration results as control parameters and initial conditions to reinitialize itself.
[0079] Figure 5 In b, for the chaotic mapping that generates iterative results in parallel, after reaching the iteration limit, the chaotic mapping on the left side of the diagram continues to iterate, generating a new set of iterative results, and the chaotic mapping on the right side is reinitialized.
[0080] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.
Claims
1. A method for key stream generator parallelization and dynamic degradation resistance, characterized in that, S1, receiving an initial key; S2, initializing the key stream generators simultaneously or step by step based on the initial key using a preset key stream generator initialization method, after initialization, the key stream generators generate key streams in parallel using a preset parallel working method; Let the total number of key stream generators be M, The S2 includes: Initializing M key stream generators based on the initial key, the number of keys in the initial key is M; At this time, the preset parallel working method includes: All key stream generators are iterated in parallel, the generated iteration results are combined using a preset combination method to generate the final key stream for encryption and decryption; The S2 includes: First, initialize K key stream generators using the initial key, the number of keys in the initial key is K, and then use the iteration results of the K key stream generators to construct M-K keys according to the structure of k0 to complete the initialization of the remaining key stream generators; At this time, the preset parallel working method includes: K key stream generators are used to generate keys, M is the total number of key stream generators, the remaining M-K key stream generators are initialized, M-K key stream generators are iterated in parallel, the generated iteration results are combined using a preset combination method to generate the final key stream for encryption and decryption; S3, combining the key streams generated by the key stream generators using a preset combination method to generate the final key stream for encryption and decryption; S4, after the key stream generator iterates to the specified iteration upper limit, reinitializing the key stream generator using a preset key stream generator reinitialization method.
2. The method of claim 1, wherein: The initial key has at least one key, one key is used to complete the initialization of one key stream generator, and one key is composed of at least one parameter.
3. The method of claim 1, wherein: The key stream generator generates iteration results using a mapping iteration method, and the specific process is as follows: The mapping is denoted as F, the key is denoted as k0, and the initialization of the key stream generator is completed by substituting the key into the mapping: F(k0)=z1, where z1 is called an iteration result; Using z1 to replace one or more parameters in k0 to obtain k1, and substituting k1 into the mapping has: F(k1)=z2; According to F(k i-1 ) = z i performing iterations, generating a set of iteration results, i.e. keystreams z1,..., z n .
4. The method of claim 3, wherein: The preset combination method includes sequential arrangement, alternating arrangement, and permutation arrangement.
5. The method of claim 1, wherein, In the S4, the preset key stream generator reinitialization method includes: Selecting a corresponding iteration result from the iteration results of the key stream generator itself to construct a new key, and substituting the new key into the mapping to reinitialize the mapping; wherein the corresponding iteration result is two iteration results obtained by iterating twice after the key stream generator itself reaches the maximum iteration number; And / or Selecting a corresponding iteration result from the iteration results of other key stream generators to construct a new key, and substituting the new key into the mapping to reinitialize the mapping; wherein the corresponding iteration result is an iteration result obtained by continuing iteration of a key stream generator that has not reached the maximum iteration number among the M key stream generators.
Citation Information
Patent Citations
Cascaded stream cipher
US20020054679A1
Symmetric-key encryption method and cryptographic system employing the method
US20120128153A1