Side-channel protection implementation method, system, and equipment for the LOL-MINI stream cipher algorithm
By implementing full-process Boolean masking and randomization on the LOL-MINI stream cipher algorithm, constructing a masked S-box, and inserting random delays and out-of-order execution, the security deficiencies of the LOL-MINI stream cipher algorithm in side-channel analysis are resolved, achieving efficient anti-attack capabilities and low-resource-cost security improvements.
Patent Information
- Application Number
- CN202611438563.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-11-10
AI Technical Summary
The existing LOL-MINI stream cipher algorithm lacks effective protection against side-channel analysis, especially related energy analysis and machine learning side-channel attacks, resulting in insufficient physical security and making it difficult to reliably apply in real-world environments.
A multi-dimensional collaborative protection architecture is adopted. Sensitive intermediate values are protected by Boolean masking, a masked S-box is constructed, random delays and out-of-order execution operations are inserted to break the energy-time alignment rule, and the order of S-box substitution operations is dynamically adjusted to achieve full-process masking protection.
It effectively resists traditional related energy analysis and machine learning side-channel attacks, improving its anti-attack capability. At the same time, it has low hardware resource consumption, is suitable for resource-constrained scenarios, and has the combined advantages of high security and low overhead.
Smart Images

Figure CN123074692A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, specifically to a side-channel protection implementation method, system, and device for the LOL-MINI stream cipher algorithm. Background Technology
[0002] Stream ciphers, as a core branch of symmetric cryptography, are a key technology for ensuring data confidentiality and integrity in fields such as mobile communication, IoT, and satellite communication. With the development of 5G / 6G communication technologies, data transmission rates are evolving towards the hundreds of Gbps and even Tbps levels. Simultaneously, the cryptographic security threats posed by quantum computing technology are becoming increasingly prominent. Next-generation stream cipher algorithms are required to possess both ultra-high-speed computing capabilities and high post-quantum security levels, with a 256-bit security margin becoming a core design metric. Against this backdrop, the LOL general block stream cipher design framework, proposed in 2023, achieves a unification of ultra-high-speed software computation and post-quantum security through a modular architecture design using nonlinear drivers and finite state machines. Its single-mode instance, the LOL-MINI algorithm, supports a 256-bit master key and a 128-bit initialization vector, exhibiting lightweight and efficient characteristics, making it suitable for resource-constrained scenarios such as embedded terminals. It has become an important candidate solution for stream cipher applications in 5G / 6G communication scenarios.
[0003] The security of cryptographic algorithms depends not only on their theoretical design but also on their physical security. Side-channel analysis, which exploits physical leaks such as energy consumption, electromagnetic radiation, and timing during device operation, has become a major threat to embedded cryptography. Among these methods, Correlation Power Analysis (CPA) is an effective way to assess the side-channel security of cryptographic implementations due to its non-intrusiveness and high attack efficiency. Higher-order CPA can bypass first-order basic protection measures. Machine learning-based side-channel analysis using multi-layer perceptrons (MLPs) and convolutional neural networks (CNNs) can break free from the dependence on accurate leakage models and automatically extract key-related features from high-noise, protected energy waveforms, resulting in attack capabilities far exceeding traditional statistical analysis methods.
[0004] Although the LOL-MINI algorithm possesses excellent theoretical performance, its side-channel security characteristics have not been fully explored, which has become a key issue restricting its reliable application in practical environments. Therefore, there is an urgent need for a secure implementation method for the LOL-MINI algorithm that can resist both correlation energy analysis and machine learning side-channel analysis and can be quickly deployed. Summary of the Invention
[0005] To address this, the present invention provides a side-channel protection implementation method, system, and device for the LOL-MINI stream cipher algorithm, aiming to solve the technical problems of the lack of side-channel protection schemes for the LOL-MINI stream cipher algorithm in the prior art, the difficulty in resisting related energy analysis and machine learning side-channel attacks, and insufficient physical security.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: According to a first aspect of the present invention, the present invention provides a side-channel protection implementation method for the LOL-MINI stream cipher algorithm, the method comprising: Load the initial data of the LOL-MINI stream cipher algorithm, and perform register initialization operations based on the initial data; Boolean masking is performed on all register data, and a masked S-box adapted for masking operations is constructed to replace the original fixed S-box; the register data includes the key and the initialization vector. Before initialization begins, a random sorting sequence is generated to shuffle the original fixed order of S-box substitution operations; before each S-box substitution operation is performed, a number of non-independent random delay operations are generated to break the time alignment rule of energy generation during algorithm runtime. Random delays are inserted based on the number of non-independent random delay operations, followed by the initiation of S-box substitution operations based on the masked S-box, and dynamic adjustments are made according to the random sorting sequence. The execution order of the 16-byte S-box substitution operation inside the function is determined by performing a random substitution operation. After the S-box substitution operation is completed, a linear transformation operation is performed. Throughout the entire process of the S-box substitution operation and the linear transformation, the generated sensitive intermediate values are continuously protected by real-time masking to obtain the output value that is masked. Based on the output value, a register update operation is performed, and the sensitive intermediate values generated during the register update process are masked and reprotected to obtain the updated internal security state of the algorithm. The key stream is generated iteratively based on the internal security state of the algorithm, and sensitive intermediate values generated are continuously masked in real time during the key stream generation process. Before using the key stream to perform encryption and decryption operations on the data to be encrypted and decrypted, redundant mask data is stripped to obtain the final key. The sensitive intermediate values include register data, function, At least one of the functions and register update data.
[0007] Furthermore, the step of performing Boolean masking on all register data and constructing a masked S-box adapted for masking operations includes: The generation includes at least a first random mask. Second random mask Multiple 8-bit random masks; Calculate the mask based on the 8-bit random mask. The mathematical expression is: ; The mask is used for finite state machine registers, linear feedback shift registers, and nonlinear feedback shift registers. Perform initial masking; Perform masked mapping on the S-box substitution operation to construct a masked S-box, the mathematical expression of which is:
[0008] in, This represents the input data for the S-box; This represents the S-box substitution operation; This represents the output data of the S-box.
[0009] Furthermore, the mask is used for all finite state machine registers, linear feedback shift registers, and nonlinear feedback shift registers. The initial masking is expressed mathematically as follows:
[0010]
[0011]
[0012]
[0013]
[0014]
[0015] in, , and This represents the value of the finite state machine register after masking. Represents the initial vector; This represents the high-order 16 bytes of the key; This represents the lower 16 bytes of the key; and This represents the value of the linear feedback shift register after masking. This represents the value of the nonlinear feedback shift register after masking.
[0016] Furthermore, the method also includes: Regarding the The function performs masking protection processing, specifically including: During the S-box substitution operation stage, the input is the mask described above. The byte block, and based on the masked mapping, the mask state is implemented from the mask. The conversion to the first random mask; During the row shifting stage, a row shift linear operation is performed on the data block with the first random mask, while keeping the mask characteristics unchanged; During the column mixing stage, each byte is temporarily XORed with the second random mask before the operation, so as to realize the mask state from the first random mask to the mask. The transformation is performed; during the operation, a linear operation of the MixColumn matrix is executed while maintaining the mask characteristics; after the operation, each byte is XORed with the second random mask to realize the mask state from the mask. The conversion to the first random mask results in the output of a data block containing the first random mask.
[0017] Furthermore, the method also includes: Regarding the The function performs masking protection processing, specifically including: The receiver consists of two devices with the aforementioned mask. The data blocks are merged together, and the concatenation mask is included. Data pairs; the concatenated mask The mathematical expression is: ; Perform finite field multiplication and shift operations on the data pairs, and XOR the resulting intermediate values with a new concatenated mask. And remove the temporary displacement mask generated by the shift operation. The mask properties remain unchanged; The 16-bit data pair after the operation is completed is split into two 8-bit data blocks. Each byte is XORed with the first random mask to realize the mask state from the mask. The conversion to the second random mask; After the mask state transition, the 8-bit data block and the cell-arranged output are masked. The data blocks are merged to output an 8-bit data block with the first random mask.
[0018] Furthermore, the masking and re-protection of sensitive intermediate values generated during the register update process specifically includes: For the finite state machine register and the nonlinear feedback shift register after Before merging the output of the function operation with the intermediate values generated by the previous round of algorithm execution, a mask transformation consistent with the mask state is performed. For the linear feedback shift register after The intermediate value with the first random mask and the data stream with the second random mask output by the function are masked before the register is updated; Before the key stream is output, the output data with the mask is XORed with the second random mask.
[0019] Furthermore, the generation of the number of non-independent random delay operations used to break the time alignment pattern of energy generation during algorithm runtime includes: Based on the mask The mathematical expression for generating a random number seed is as follows: ; in, This represents the random number seed, used to randomize the number of delay operations in each algorithm run in sync with the mask; Based on the random number seed, an improved floating mean algorithm is used to generate the number of random delay operations.
[0020] Furthermore, the generation of the random sorting sequence for shuffling the original fixed S-box substitution operation order includes: Based on the mask The mathematical expression for generating a random number seed is as follows: ; in, This represents the random number seed, used to synchronously randomize the sorted sequence and the mask. Based on the aforementioned random number seed, a 16-byte non-repeating randomly sorted sequence is generated, as expressed mathematically below: ; in, Represents a randomly ordered sequence; Indicates the current number The S-box sequence number to be executed at each byte position.
[0021] According to a second aspect of the present invention, the present invention provides a side-channel protection implementation system for the LOL-MINI stream cipher algorithm, applied to the side-channel protection implementation method for the LOL-MINI stream cipher algorithm as described in any one of the second aspects of the present invention, comprising: The masking protection module is used to perform Boolean masking protection on all generated sensitive intermediate values during the register initialization phase, linear transformation operation phase, nonlinear logic operation phase, register update phase, and key stream generation phase of the LOL-MINI stream cipher algorithm, and to construct a masked S-box adapted for masking operations to replace the native fixed S-box; the sensitive intermediate values include register data, function, At least one of the functions and register update data; The random delay protection module is used to generate a number of non-independent random delay operations to break the time alignment rule of energy generated during algorithm operation before performing the S-box substitution operation based on the masked S-box, and to insert random delays based on the number of non-independent random delay operations. The out-of-order execution protection module is used to generate a random sorting sequence to shuffle the original fixed substitution operation order before performing the S-box substitution operation based on the masked S-box, and dynamically adjust the execution order according to the random sorting sequence. The execution order of the 16-byte S-box substitution operation inside the function.
[0022] According to a third aspect of the present invention, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the side-channel protection implementation method for the LOL-MINI stream cipher algorithm as described in any one of the first aspects of the present invention.
[0023] The present invention, by adopting the above technical solution, has at least the following beneficial effects: This invention proposes a side-channel protection method for the LOL-MINI stream cipher algorithm. During the register initialization, linear transformation, nonlinear logic operation, register update, and keystream generation phases of the LOL-MINI stream cipher algorithm, all generated sensitive intermediate values are protected using Boolean masking. A masked S-box adapted for masking operations is constructed to replace the original fixed S-box. Before performing the S-box substitution operation based on the masked S-box, a number of non-independent random delay operations are generated to break the time alignment rules of energy generation during algorithm runtime, and random delays are inserted based on these non-independent random delay operations. Furthermore, a random sorting sequence is generated to shuffle the original fixed substitution operation order, and the order is dynamically adjusted according to the random sorting sequence. The execution order of the 16-byte S-box substitution operation within the function. This invention employs a multi-dimensional collaborative protection architecture of "data randomization + temporal randomization + operation randomization," which effectively resists mainstream attack methods such as traditional correlation energy analysis, high-order side-channel analysis, and machine learning side-channel attacks based on deep learning, solving the technical challenges of high side-channel leakage risk and weak anti-attack capabilities.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A flowchart illustrating a side-channel protection implementation method for the LOL-MINI stream cipher algorithm provided in an embodiment of the present invention is shown. Figure 2 An embodiment of the present invention is shown. A flowchart illustrating the mask protection process of the function; Figure 3 An embodiment of the present invention is shown. A flowchart illustrating the mask protection process of the function; Figure 4 This diagram illustrates a flowchart of a process for masking register update data according to an embodiment of the present invention. Figure 5 A schematic diagram of the structure of a side-channel protection implementation system for the LOL-MINI stream cipher algorithm provided in an embodiment of the present invention is shown. Figure 6 A schematic diagram of the physical structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation
[0027] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0028] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0029] This invention provides a side-channel protection implementation method for the LOL-MINI stream cipher algorithm, such as... Figure 1 As shown, it may include at least the following steps S101~S106: Step S101: Load the initial data of the LOL-MINI stream cipher algorithm, perform register initialization based on the initial data; perform Boolean masking on all register data, and construct a masked S-box adapted for masking operations to replace the original fixed S-box.
[0030] First, the initialization vector and key bytes required by the algorithm are loaded, and data byte alignment, bit width verification, and format standardization are completed to provide compliant input data for subsequent initialization operations. Then, based on the loaded key and initialization vector, the algorithm's internal state register is initialized. Unlike the native algorithm, this embodiment adds a global sensitive data masking protection mechanism: for the register initialization stage, linear transformation operation stage, nonlinear logic operation stage, register update stage, and key stream generation stage of the LOL-MINI stream cipher algorithm, all generated sensitive intermediate values are subjected to Boolean masking protection to disrupt the statistical correlation between energy and sensitive data. Simultaneously, a dedicated improved S-box adapted for masking operations is used to replace the native fixed S-box, masking sensitive information from the initialization source and preventing leakage of initial state data. It should be noted that the masking coverage in this stage includes the initial register data and various sensitive intermediate values generated by the initialization stage function iterations.
[0031] The Boolean mask protection in this embodiment of the invention first requires generating a random mask: Specifically, it is possible to generate at least a first random mask. Second random mask Multiple 8-bit random masks; calculate the mask based on the 8-bit random mask. The mathematical expression is: .
[0032] During register initialization, masks are used for finite state machine registers, linear feedback shift registers, and nonlinear feedback shift registers. To perform initial masking and ensure that no plaintext sensitive data is leaked in the initial state, the mathematical expression can be:
[0033]
[0034]
[0035]
[0036]
[0037]
[0038] in, , and This represents the value of the finite state machine register after masking. Represents the initial vector; This represents the high-order 16 bytes of the key; This represents the lower 16 bytes of the key; and This represents the value of the linear feedback shift register after masking. This represents the value of the nonlinear feedback shift register after masking.
[0039] Therefore, by uniformly performing XOR masking on the finite state machine register, linear feedback shift register, and nonlinear feedback shift register, the key and initial vector data during the initialization phase are completely hidden, thus preventing the leakage of the initial state.
[0040] Furthermore, a masked mapping is performed on the S-box substitution operation to construct a masked S-box, the mathematical expression of which is:
[0041] in, This represents the input data for the S-box; This represents the S-box substitution operation; This represents the output data of the S-box.
[0042] It is understandable that the masked S-box achieves mask adaptation for S-box operations by replacing the original fixed S-box, thus providing a foundation for subsequent full-process mask operations.
[0043] Step S102: Before initialization begins, a random sorting sequence is generated to shuffle the original fixed S-box substitution operation order; before each S-box substitution operation is performed, a number of non-independent random delay operations are generated to break the time alignment rule of energy generation during algorithm runtime.
[0044] In this embodiment of the invention, before the S-box substitution operation, two types of random perturbation sequences are generated: a number of non-independent random delay operations used to eliminate the time alignment characteristics of the algorithm's energy waveform, and a random sorting sequence used to break the original fixed substitution timing.
[0045] Specifically, the number of non-independent random delay operations used to break the time alignment pattern of energy generation during algorithm runtime is implemented as follows: First, based on the mask The mathematical expression for generating a random number seed is: ; in, This represents the random number seed, used to randomize the number of delay operations and the mask in each algorithm run.
[0046] Furthermore, based on the random number seed, an improved floating average algorithm is used to generate the number of random delay operations. In practical applications, the iterative adjustment coefficient of the improved floating average algorithm can be set, such as... , , Generates 0-7 no-operations, with a single operation delay of 2 seconds. μs Total latency range 0-14 μs .
[0047] The improved floating mean algorithm uses a random number seed derived from a mask as the iterative driving source, abandoning fixed statistical windows and fixed mean benchmarks. It adopts a dynamic floating mean iterative update mechanism, adaptively updating the delay mean benchmark and fluctuation range based on the real-time seed value encrypted in each round. By iteratively correcting the mean deviation and dynamically scaling the fluctuation range, the delay correlation between adjacent operation cycles is weakened, giving the generated number of delay operations non-uniform, non-periodic, and dynamically floating characteristics. At the same time, it can constrain the delay fluctuation amplitude and avoid a sharp drop in algorithm efficiency caused by disordered randomness.
[0048] In practical applications, random delays are inserted based on the number of non-independent random delay operations to break the time alignment rule of energy generated during algorithm operation and resist energy side-channel analysis attacks.
[0049] Furthermore, a random sorting sequence is generated to shuffle the original fixed S-box substitution operation order, as detailed below: First, based on the mask The mathematical expression for generating a random number seed is as follows: ; in, This represents the random number seed, used to synchronously randomize the sorted sequence and the mask. Embodiments of this invention randomize the S-box sorted sequence and the mask... Linkage binding is implemented to achieve dynamic synchronization and randomization of the sorting sequence with the mask, avoiding a fixed perturbation sequence. The random number seed is generated in real time based on the dynamic mask state within the cryptographic operation, without relying on an external fixed random source. This ensures that the seed for each round of encryption is different, giving subsequent sorting perturbations cryptographic synchronization characteristics and effectively avoiding the periodic repetition defect caused by a fixed seed.
[0050] Furthermore, using a dynamically generated random number seed as the perturbation basis, the original fixed index sequence of the sixteen-byte S-box is randomly permuted to generate a dynamic sorted sequence with no repetition and full traversal, i.e., a random sorted sequence, whose mathematical expression is: ; in, Represents a randomly ordered sequence; Indicates the current number The current S-box sequence number that needs to be executed at the current byte position.
[0051] It is understandable that the native LOL-MINI stream cipher algorithm uses a fixed byte traversal order to complete the S-box substitution operation. The constant byte operation order generates fixed timing characteristics that can be collected and fitted, making it highly susceptible to timing-based side-channel attacks. This invention addresses this by using a seed random permutation mechanism to disrupt the inherent binding relationship between the 16-byte position and the S-box call order. Each fixed byte position will perform the S-box substitution operation in a random order during algorithm execution. In practical applications, a randomized sorting sequence is used to shuffle the fixed 16-byte S-box substitution execution order of the native algorithm, disrupting the temporal fixity of the leakage point. This method completely breaks the fixed timing pattern of the S-box substitution process, ensuring that the byte operation timing and energy waveform characteristics of each algorithm run are completely unique. It achieves dynamic random perturbation of the byte-level operation timing, effectively masking key-sensitive operation characteristics and significantly improving the LOL-MINI stream cipher algorithm's resistance to timing-based and energy-based side-channel attacks.
[0052] Step S103: Insert random delay based on the number of non-independent random delay operations, then start the S-box substitution operation based on the masked S-box, and dynamically adjust according to the random sorting sequence. The execution order of the 16-byte S-box substitution operation inside the function is determined by performing a randomized substitution operation.
[0053] This step is used to perform the two types of random perturbations mentioned above during the S-box substitution operation. Specifically, before performing the S-box substitution operation, a generated improved floating mean random delay is inserted. This non-independent random delay disrupts the timing of each round of the algorithm's operation, destroying the periodicity and alignment of the energy waveform, thus completing the timing perturbation preprocessing. During the S-box substitution operation, the fixed 16-byte operation order of the original algorithm is abandoned, and the random sorting sequence generated in step S102 is strictly followed, with dynamic adjustments made accordingly. The execution order of the 16-byte S-box substitution within the function; the entire process uses a masked S-box adapted for Boolean masking operations to perform non-linear substitution, while simultaneously... Throughout the function operation, Boolean mask updates are continuously performed to protect sensitive intermediate data.
[0054] The following is combined with Figure 2 , for targeting The masking protection process for functions is explained.
[0055] like Figure 2 As shown, this is for This is a flowchart illustrating the masking process of the function. Specifically, in the S-box substitution (non-linear) operation stage, the input is masked. byte blocks, and based on masked mapping To achieve the mask state from mask To the first random mask The conversion.
[0056] Step S104: After the S-box substitution operation is completed, a linear transformation operation is performed. Throughout the entire process of the S-box substitution operation and the linear transformation operation, the generated sensitive intermediate values are continuously protected by real-time masking to obtain the output value that is masked.
[0057] This step continues the core operational logic of the algorithm. After the disordered substitution operation is completed, linear transformation operations are performed sequentially, with the logical order remaining unchanged. During the operation, for function, The function performs a full mask adaptation operation: against Functions, such as Figure 2 As shown, in the row shift (linear) stage after the S-box substitution operation, the first random mask is used... The data block undergoes a row-shift linear operation while preserving the mask properties; in the column-mixing (linear) stage, each byte is temporarily XORed with a second random mask before the operation. This enables the mask state to change from the first random mask to the mask. The transformation is performed; during the operation, linear operations on the MixColumn matrix are carried out, while preserving the mask properties. The result remains unchanged; after the operation, each byte is XORed with the second random mask. To achieve the mask state from mask To the first random mask The conversion outputs a first random mask. Data blocks.
[0058] By performing the operation, The function performs full mask adaptation operations, completing the S-box substitution, row shifting, and column mixed operation stages. , Dynamic conversion of double masks ensures mask stability during linear operations and prevents leakage of intermediate values.
[0059] like Figure 3 As shown, this is for This is a flowchart illustrating the masking process of the function. Specifically, the receiver consists of two masks. Data blocks merged together, with a concatenated mask Data pairs; cascaded masks The mathematical expression is: Perform finite field multiplication on data pairs Operations and shift operations (linear), XORing the resulting intermediate values with a new concatenated mask. And remove the temporary displacement mask generated by the shift operation. (Cascaded mask) (Generated by left shifting one bit), preserving mask properties. The result remains unchanged; the 16-bit data pair after the operation is split into two 8-bit data blocks, and each byte is XORed with the first random mask. To achieve the mask state from mask To the second random mask The transformation; the 8-bit data block after mask state transformation and the cell-arranged output with mask. The data blocks are merged, and the output contains a first random mask. An 8-bit data block.
[0060] The embodiments of the present invention provide The function uses cascaded masks to perform mask protection for finite field multiplication and shift operations, synchronously completes the orderly transformation of mask states, ensures that sensitive data is not leaked throughout the operation, and outputs the mixed operation results.
[0061] Step S105: Perform a register update operation based on the output value, and re-protect the sensitive intermediate values generated during the register update process by masking them, thereby obtaining the updated internal security state of the algorithm.
[0062] This step, after completing the S-box substitution and linear transformation operations, updates the state of all registers based on the output values. It can be understood that before the update, [the process involves] targeting [the target registers]. function, The different mask state data output by the function are precisely masked and adapted. In order to unify the mask specification for register updates, the key-related data generated during the update process is masked and reprotected to eliminate the risk of leakage during the state update stage, and finally obtain the internal running data of the algorithm with secure mask state.
[0063] like Figure 4 The diagram shows a flowchart illustrating the mask protection process for register updates. Specifically, it addresses the mask protection for finite state machine registers. , , and nonlinear feedback shift register go through The output of the function operation undergoes a mask transformation consistent with the mask state before being merged with the intermediate values generated in the previous algorithm run; this is for nonlinear feedback shift registers. go through The output after function operation contains a first random mask. median value and with a second random mask of The data stream undergoes mask transformation before register updates; before key stream output, the masked output data is XORed with a second random mask. This ensures the correctness of the output key stream.
[0064] Step S106: Generate a key stream iteratively based on the internal security state of the algorithm, and continuously perform real-time masking protection on the generated sensitive intermediate values during the key stream generation process; before using the key stream to perform encryption and decryption operations on the data to be encrypted and decrypted, strip away redundant masking data to obtain the final key.
[0065] The keystream is generated iteratively based on a secure internal state. This step continues the aforementioned logic during the keystream generation phase, maintaining real-time mask protection throughout to prevent state data leakage during iteration. Before the final output, the original keystream is restored by XORing the corresponding redundant masks using preset mask stripping rules. This ensures the security of the keystream generation without compromising the accuracy of the algorithm's original keystream.
[0066] It should be noted that the protection scheme provided in this embodiment of the invention has been verified through actual testing, demonstrating excellent resistance to side-channel attacks and low hardware resource overhead. Specific test indicators are as follows: For first-order and second-order related energy analysis attacks, after collecting 10,000 energy waveform data points, attackers still cannot crack or recover the correct key. For machine learning-based intelligent side-channel analysis attacks based on MLP and CNN, under the test condition of 10,000 energy waveforms, the correct key's ranking is greater than 10, effectively resisting intelligent side-channel attacks. Resource overhead tests were conducted on the 8051 embedded hardware platform. The algorithm initialization time after protection increased from the original 2.4 s to 2.7 s, an increase of only 0.3 s in computation time; storage overhead increased from the original 257 bytes to 550 bytes, an increase of only 293 bytes, resulting in low overall performance loss and making it fully adaptable to various resource-constrained lightweight application scenarios such as IoT and embedded systems.
[0067] This invention provides a side-channel protection implementation method for the LOL-MINI stream cipher algorithm. The method involves loading initial data for the LOL-MINI stream cipher algorithm and performing register initialization based on this data. All register data undergoes Boolean masking, and a masked S-box adapted for masking operations is constructed to replace the native fixed S-box. Before initialization, a random sorting sequence is generated to shuffle the order of substitution operations in the native fixed S-box. Before each S-box substitution operation, a number of non-independent random delay operations is generated to break the time alignment pattern of energy generation during algorithm runtime. Random delays are inserted based on the number of non-independent random delay operations, followed by initiating the S-box substitution operation based on the masked S-box, and dynamically adjusting the random sorting sequence. The execution order of the 16-byte S-box substitution operation within the function is disordered; after the S-box substitution operation is completed, a linear transformation operation is performed, and throughout the entire process of the S-box substitution and linear transformation operations, sensitive intermediate values generated are continuously masked in real time to obtain the masked output value; based on the output value, a register update operation is performed, and sensitive intermediate values generated during the register update process are masked again to obtain the updated internal security state of the algorithm; based on the internal security state of the algorithm, a key stream is iteratively generated, and sensitive intermediate values generated during the key stream generation process are continuously masked in real time; before using the key stream to encrypt and decrypt the data to be encrypted and decrypted, redundant masked data is stripped to obtain the final key. Compared with existing technologies, it has comprehensive advantages of high security, low overhead, practicality, and strong versatility. Specific beneficial effects are as follows: This invention has at least the following beneficial effects: 1. Excellent anti-attack capability and comprehensive protection dimensions. This invention adopts a Boolean mask protection mechanism for sensitive data throughout the entire process, covering all key leakage risk points, solving the problems of incomplete coverage and poor adaptability of traditional single mask protection, and completely hiding key and initialization vector information; generating random sorting sequences and non-independent random delays, on the one hand, breaking the fixed substitution order of the original S-box and eliminating fixed operation logic characteristics; on the other hand, scrambling the algorithm's runtime sequence and disrupting the time alignment law of energy waveforms, thus doubly avoiding side-channel attacks of timing analysis and energy analysis; and specifically designed... function, The dedicated masking logic of the function is adapted to the core computing architecture of LOL-MINI. While ensuring the effectiveness of masking protection, it strictly matches the native operation rules of the algorithm, without affecting the accuracy of the generated key stream, thus balancing security and algorithm efficiency. Based on the deep integration of masking protection, out-of-order operation, and random delay, the various protection mechanisms work together and adapt in a coordinated manner. Compared with a single protection method, the ability to resist side-channel attacks is greatly improved. At the same time, the lightweight design is adapted to the low-power and lightweight application scenarios of LOL-MINI, making it highly practical. Real-world testing shows that this invention can effectively resist traditional energy analysis attacks such as first-order correlation energy analysis and second-order correlation energy analysis. Even if an attacker collects 10,000 energy waveforms, they still cannot recover the correct key. At the same time, it can effectively resist intelligent machine learning side-channel analysis based on MLP and CNN. Under the test conditions of 10,000 waveforms, the correct key ranking is always after tenth place, completely avoiding intelligent analysis methods and significantly improving the security of actual algorithm deployment.
[0068] 2. Low hardware overhead and adaptability to limited scenarios. This invention adopts a lightweight combined protection mechanism with no redundant and complex calculations, resulting in minimal hardware resource consumption. Based on practical testing on the 8051 embedded platform, compared to the native unprotected algorithm, this solution only adds 0.3 seconds of initialization time and 293 bytes of storage overhead, resulting in minimal overall performance loss. It does not require a large amount of hardware resources and can perfectly adapt to resource-constrained lightweight encryption application scenarios such as IoT terminals and embedded devices, achieving a balance between security performance and operational efficiency.
[0069] 3. Pure software implementation, strong engineering applicability. All protection logic in this invention is implemented through software algorithms, requiring no modification to the original hardware architecture or circuit design. It is compatible with the existing LOL-MINI algorithm deployment system and can be directly and quickly integrated into various cryptographic application systems such as IoT terminals and 5G / 6G embedded devices. It has low deployment cost, low adaptation difficulty, and strong engineering practical value.
[0070] Furthermore, as Figure 1 In specific implementation, embodiments of the present invention provide a side-channel protection implementation system for the LOL-MINI stream cipher algorithm, such as... Figure 5As shown, the system may include: a mask processing protection module 510, a random delay protection module 520, and an out-of-order execution protection module 530.
[0071] The masking protection module 510 can be used to perform Boolean masking protection on all generated sensitive intermediate values during the register initialization stage, linear transformation operation stage, nonlinear logic operation stage, register update stage, and key stream generation stage of the LOL-MINI stream cipher algorithm. It also constructs a masked S-box adapted for masking operations to replace the native fixed S-box. Sensitive intermediate values include register data, function, At least one of the functions and register update data; The random delay protection module 520 can be used to generate a number of non-independent random delay operations to break the time alignment rule of energy generated during algorithm runtime before performing S-box substitution operation based on masked S-box, and insert random delay based on the number of non-independent random delay operations. The out-of-order execution protection module 530 can be used to generate a random sorting sequence to shuffle the original fixed substitution operation order before initialization begins, and dynamically adjust the execution order based on the random sorting sequence. The execution order of the 16-byte S-box substitution operation inside the function.
[0072] It should be noted that other corresponding descriptions of the functional modules involved in the side-channel protection implementation system for the LOL-MINI stream cipher algorithm provided in this embodiment of the invention can be found in the following references. Figure 1 The corresponding description of the method shown will not be repeated here.
[0073] Based on the above, Figure 1 Accordingly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the side-channel protection implementation method for the LOL-MINI stream cipher algorithm of any of the above embodiments.
[0074] Based on the above, Figure 1 The method shown and as Figure 5 The embodiment of the system shown in the invention also provides a physical structure diagram of a computer device, such as... Figure 6 As shown, the computer device may include a communication bus, a processor, a memory, and a communication interface. It may also include input / output interfaces and a display device. The various functional units can communicate with each other via the bus. The memory stores a computer program, and the processor executes the program stored in the memory to perform the steps of the side-channel protection implementation method for the LOL-MINI stream cipher algorithm described in the above embodiments.
[0075] Those skilled in the art will clearly understand that the specific working process of the systems, devices, modules and units described above can be referred to the corresponding process in the foregoing method embodiments. For the sake of brevity, it will not be repeated here.
[0076] Furthermore, the functional units in the various embodiments of the present invention can be physically independent of each other, or two or more functional units can be integrated together, or all functional units can be integrated into one processing unit. The integrated functional units described above can be implemented in hardware, or in software or firmware.
[0077] Those skilled in the art will understand that if the integrated functional unit is implemented in software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or all or part of it, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computing device (e.g., a personal computer, server, or network device) to execute all or part of the steps of the methods described in the embodiments of the present invention when running the instructions. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0078] Alternatively, all or part of the steps of the foregoing method embodiments can be implemented by hardware (such as a computing device, personal computer, server, or network device) related to program instructions. The program instructions can be stored in a computer-readable storage medium. When the program instructions are executed by the processor of the computing device, the computing device executes all or part of the steps of the methods described in the various embodiments of the present invention.
[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the corresponding technical solutions to depart from the protection scope of the present invention.
Claims
1. A side-channel protection implementation method for the LOL-MINI stream cipher algorithm, characterized in that, The method includes: Load the initial data of the LOL-MINI stream cipher algorithm, and perform register initialization operations based on the initial data; Boolean masking is performed on all register data, and a masked S-box adapted for masking operations is constructed to replace the original fixed S-box; the register data includes the key and the initialization vector. Before initialization begins, a random sorting sequence is generated to shuffle the original fixed order of S-box substitution operations; before each S-box substitution operation is performed, a number of non-independent random delay operations are generated to break the time alignment rule of energy generation during algorithm runtime. Random delays are inserted based on the number of non-independent random delay operations, followed by the initiation of S-box substitution operations based on the masked S-box, and dynamic adjustments are made according to the random sorting sequence. The execution order of the 16-byte S-box substitution operation inside the function is determined by performing a random substitution operation. After the S-box substitution operation is completed, a linear transformation operation is performed. Throughout the entire process of the S-box substitution operation and the linear transformation operation, the generated sensitive intermediate values are continuously protected by real-time masking to obtain the output value that is masked. Based on the output value, a register update operation is performed, and the sensitive intermediate values generated during the register update process are masked and reprotected to obtain the updated internal security state of the algorithm. The key stream is generated iteratively based on the internal security state of the algorithm, and sensitive intermediate values generated are continuously masked in real time during the key stream generation process. Before using the key stream to encrypt or decrypt the data to be encrypted or decrypted, redundant mask data is stripped to obtain the final key. The sensitive intermediate values include register data, function, At least one of the functions and register update data.
2. The method according to claim 1, characterized in that, The step of performing Boolean masking on all register data and constructing a masked S-box adapted for masking operations includes: The generation includes at least a first random mask. Second random mask Multiple 8-bit random masks; Calculate the mask based on the 8-bit random mask. The mathematical expression is: ; The mask is used for finite state machine registers, linear feedback shift registers, and nonlinear feedback shift registers. Perform initial masking; Perform masked mapping on the S-box substitution operation to construct a masked S-box, the mathematical expression of which is: in, This represents the input data for the S-box; This represents the S-box substitution operation; This represents the output data of the S-box.
3. The method according to claim 2, characterized in that, The mask is used for finite state machine registers, linear feedback shift registers, and nonlinear feedback shift registers. The initial masking is expressed mathematically as follows: in, , and This represents the value of the finite state machine register after masking. Represents the initialization vector; This represents the high-order 16 bytes of the key; This represents the lower 16 bytes of the key; and This represents the value of the linear feedback shift register after masking. This represents the value of the nonlinear feedback shift register after masking.
4. The method according to claim 1, characterized in that, The method further includes: Regarding the The function performs masking protection processing, specifically including: During the S-box substitution operation stage, the input is the mask described above. The byte block, and based on the masked mapping, the mask state is implemented from the mask. The conversion to the first random mask; During the row shifting stage, a row shift linear operation is performed on the data block with the first random mask, while keeping the mask characteristics unchanged; During the column mixing stage, each byte is temporarily XORed with the second random mask before the operation, so as to realize the mask state from the first random mask to the mask. The transformation is performed; during the operation, a linear operation of the MixColumn matrix is executed while maintaining the mask characteristics; after the operation, each byte is XORed with the second random mask to realize the mask state from the mask. The conversion to the first random mask results in the output of a data block containing the first random mask.
5. The method according to claim 1, characterized in that, The method further includes: Regarding the The function performs masking protection processing, specifically including: The receiver consists of two devices with the aforementioned mask. The data blocks are merged together, and the concatenation mask is included. Data pairs; the concatenated mask The mathematical expression is: ; Perform finite field multiplication and shift operations on the data pairs, and XOR the resulting intermediate values with a new concatenated mask. And remove the temporary displacement mask generated by the shift operation. The mask properties remain unchanged; The 16-bit data pair after the operation is completed is split into two 8-bit data blocks. Each byte is XORed with the first random mask to realize the mask state from the mask. The conversion to the second random mask; The 8-bit data block after mask state transition is combined with the cell-arranged output containing the mask. The data blocks are merged to output an 8-bit data block with the first random mask.
6. The method according to claim 1, characterized in that, The process of masking and re-protecting sensitive intermediate values generated during register update specifically includes: For the finite state machine register and the nonlinear feedback shift register after Before merging the output of the function operation with the intermediate value generated by the previous round of algorithm execution, a mask conversion consistent with the mask state is performed. For the nonlinear feedback shift register after The intermediate value with the first random mask and the data stream with the second random mask output after the function operation are masked before the register is updated. Before the key stream is output, the output data with the mask is XORed with the second random mask.
7. The method according to claim 2, characterized in that, The number of non-independent random delay operations generated to break the time alignment pattern of energy generation during algorithm runtime includes: Based on the mask The mathematical expression for generating a random number seed is as follows: ; in, This represents the random number seed, used to randomize the number of delay operations in each algorithm run in sync with the mask; Based on the random number seed, an improved floating mean algorithm is used to generate the number of random delay operations.
8. The method according to claim 2, characterized in that, The generation of the random sorting sequence used to shuffle the original fixed S-box substitution operation order includes: Based on the mask The mathematical expression for generating a random number seed is as follows: ; in, This represents the random number seed, used to synchronously randomize the sorted sequence and the mask. Based on the aforementioned random number seed, a 16-byte non-repeating randomly sorted sequence is generated, as expressed mathematically below: ; in, Represents a randomly ordered sequence; Indicates the current number The S-box sequence number to be executed at each byte position.
9. A side-channel protection implementation system for the LOL-MINI stream cipher algorithm, characterized in that, The side-channel protection implementation method for the LOL-MINI stream cipher algorithm as described in any one of claims 1 to 8 includes: The masking protection module is used to perform Boolean masking protection on all generated sensitive intermediate values during the register initialization phase, linear transformation operation phase, nonlinear logic operation phase, register update phase, and key stream generation phase of the LOL-MINI stream cipher algorithm, and to construct a masked S-box adapted for masking operations to replace the native fixed S-box; the sensitive intermediate values include register data, function, At least one of the functions and register update data; The random delay protection module is used to generate a number of non-independent random delay operations to break the time alignment rule of energy generated during algorithm operation before performing the S-box substitution operation based on the masked S-box, and to insert random delays based on the number of non-independent random delay operations. The out-of-order execution protection module is used to generate a random sorting sequence to disrupt the original fixed S-box substitution operation order before initialization begins, and dynamically adjust the execution order based on the random sorting sequence. The execution order of the 16-byte S-box substitution operation inside the function.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the side-channel protection implementation method for the LOL-MINI stream cipher algorithm as described in any one of claims 1 to 8.
