Lightweight s-box implementation method and device based on chaotic sequence dynamic update
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID JIBEI ELECTRIC POWER CO LTD
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]有鉴于此,本申请提供了一种基于混沌序列动态更新的轻量化S盒实现方法及装置,主要目的在于解决现有技术中固定S盒易被逆向分析、动态S盒生成计算复杂度过高、缺乏侧信道防护且难以在资源受限终端上实时运行的问题
本申请提供的一种基于混沌序列动态更新的轻量化S盒实现方法及装置,本申请获取电力物联网终端的真随机数发生器生成的随机数作为初始种子,构建轻量化二维复合混沌系统,基于轻量化二维复合混沌系统迭代生成混沌主序列,其中,系统采用按位异或等整数运算,替代传统高维混沌庞大的浮点计算;对混沌主序列进行轻量化多维度熵值评估,得到综合熵值,对综合熵值所处的区间进行检测,能主动感知到混沌随机性衰退并自动重置熵源,从根本上预防因伪随机数质量下降导致的安全隐患;当检测到综合熵值所处的区间为危险区间时,获取真随机数发生器生成的新随机数作为新初始种子,重置轻量化二维复合混沌系统,基于重置后的轻量化二维复合混沌系统生成新混沌主序列;基于新混沌主序列,对初始S盒状态序列依次执行第一轮全序列置换和第二轮非线性字节扰动,并经过双射性校验与修正,生成动态S盒,其中,S盒从固定变为动态且不可预测,每次更新后其内部替换规则完全改变,使得依赖分析固定S盒模式的传统差分攻击、线性攻击等方法完全失效;基于重置后的轻量化二维复合混沌系统生成掩码随机数,采用掩码随机数和动态S盒预计算掩码化S盒表,通过集成掩码技术,确保加密运算过程中真实的敏感数据始终被随机数掩盖,从而消除数据依赖的功耗泄露,具备抗一阶功耗分析的能力;将掩码化S盒表适配集成至电力物联网终端的国密分组加密算法中,替换运行中的掩码化S盒表,无需修改算法核心,便于在现有电力物联网体系中快速部署和升级。
Smart Images

Figure CN122533732A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication encryption technology, and in particular to a lightweight S-box implementation method and apparatus based on dynamic updating of chaotic sequences. Background Technology
[0002] With the deepening of the construction of new power systems, the number of power Internet of Things (IoT) terminals is experiencing explosive growth. The security of sensitive information such as electricity consumption data and control commands collected and transmitted by these terminals is of paramount importance. Block encryption algorithms are the core of ensuring data security, and the S-box, as the only nonlinear component in the algorithm, is the cornerstone of the entire encryption system. Currently, power IoT terminals generally use fixed static S-boxes with algorithms such as AES and SM4, which face two major contradictions: the fixed replacement rules of static S-boxes are vulnerable to cryptanalysis such as differential attacks and linear attacks, resulting in inherent security flaws; while existing dynamic S-box schemes based on high-dimensional chaotic systems are computationally complex and have poor real-time performance, making it difficult to adapt to the stringent limitations of terminal computing power, storage, and power consumption.
[0003] In related technologies, to improve the security of S-boxes, the following solutions mainly exist: Solution 1: A power analysis mask protection scheme based on fixed S-boxes. This scheme protects fixed S-boxes against side-channel attacks by using threshold masks and other techniques. However, this scheme cannot solve the fundamental problem that S-boxes themselves are fixed in rules and easily reverse-engineered, and its update flexibility is poor. Solution 2: A dynamic S-box generation scheme based on high-dimensional chaotic systems. This scheme uses four-dimensional, six-dimensional, and other hyperchaotic mappings to generate dynamic S-boxes, improving the unpredictability of S-boxes. However, this system has extremely high computational complexity, requires a large number of floating-point operations, cannot run in real time on resource-constrained terminals, and lacks protection design against side-channel attacks. Solution 3: A S-box generation scheme based on spatiotemporal chaotic systems. This scheme generates S-boxes through m-sequence perturbation and two-dimensional coupled mapping lattice iteration. However, this scheme still requires thousands of pre-iterations, resulting in high generation overhead and insufficient real-time performance. It also does not fully consider the lightweight implementation of terminals and the requirements for side-channel protection. Summary of the Invention
[0004] In view of this, this application provides a lightweight S-box implementation method and apparatus based on dynamic updating of chaotic sequences. The main purpose is to solve the problems in the prior art where fixed S-boxes are easily reverse-engineered, dynamic S-boxes have high computational complexity in generation, lack side-channel protection, and are difficult to run in real time on resource-constrained terminals.
[0005] According to the first aspect of this application, a lightweight S-box implementation method based on dynamic updating of chaotic sequences is provided, the method comprising: A lightweight two-dimensional composite chaotic system is constructed by using a random number generated by a true random number generator of a power Internet of Things terminal as an initial seed, and a chaotic master sequence is iteratively generated based on the lightweight two-dimensional composite chaotic system. A lightweight multi-dimensional entropy value evaluation is performed on the chaotic master sequence to obtain a comprehensive entropy value, and the interval in which the comprehensive entropy value is located is detected. When the interval in which the comprehensive entropy value is located is detected to be a dangerous interval, a new random number generated by the true random number generator is obtained as a new initial seed, the lightweight two-dimensional composite chaotic system is reset, and a new chaotic master sequence is generated based on the reset lightweight two-dimensional composite chaotic system. Based on the new chaotic master sequence, the initial S-box state sequence is subjected to the first round of full sequence permutation and the second round of nonlinear byte perturbation, and after bijective verification and correction, a dynamic S-box is generated. Based on the reset lightweight two-dimensional composite chaotic system, a masked random number is generated, and the masked random number and the dynamic S-box are used to pre-compute the masked S-box table; The masked S-box table is adapted and integrated into the national cryptographic block encryption algorithm of the power Internet of Things terminal, replacing the running masked S-box table.
[0006] According to a second aspect of this application, a lightweight S-box implementation device based on dynamic updating of chaotic sequences is provided, the device comprising: A lightweight chaotic system generation module is used to obtain random numbers generated by a true random number generator of a power Internet of Things terminal as an initial seed, construct a lightweight two-dimensional composite chaotic system, and iteratively generate a chaotic master sequence based on the lightweight two-dimensional composite chaotic system. The sequence health monitoring module is used to perform lightweight multi-dimensional entropy value evaluation on the chaotic main sequence to obtain a comprehensive entropy value, and to detect the interval in which the comprehensive entropy value is located. An adaptive update decision module is used to obtain a new random number generated by the true random number generator as a new initial seed when the interval in which the comprehensive entropy value is detected to be a dangerous interval, reset the lightweight two-dimensional composite chaotic system, and generate a new chaotic master sequence based on the reset lightweight two-dimensional composite chaotic system. The dynamic S-box generation module is used to perform a first round of full sequence permutation and a second round of nonlinear byte perturbation on the initial S-box state sequence based on the new chaotic master sequence, and generate a dynamic S-box after bijective verification and correction. The side-channel mask protection module is used to generate a mask random number based on the reset lightweight two-dimensional composite chaotic system, and to pre-compute the masked S-box table using the mask random number and the dynamic S-box. The national cryptographic algorithm adaptation and integration module is used to adapt and integrate the masked S-box table into the national cryptographic block encryption algorithm of the power Internet of Things terminal, replacing the masked S-box table in operation.
[0007] By employing the above-described technical solution, the technical solution provided in this application has at least the following advantages: This application provides a lightweight S-box implementation method and apparatus based on dynamic updating of chaotic sequences. The method uses a random number generated by a true random number generator from a power IoT terminal as an initial seed to construct a lightweight two-dimensional composite chaotic system. A chaotic master sequence is iteratively generated based on this system. The system employs bitwise XOR and other integer operations to replace the massive floating-point calculations of traditional high-dimensional chaos. A lightweight multi-dimensional entropy evaluation is performed on the chaotic master sequence to obtain a comprehensive entropy value. The system detects the interval where the comprehensive entropy value falls, proactively sensing the decay of chaotic randomness and automatically resetting the entropy source, fundamentally preventing safety hazards caused by the deterioration of pseudo-random number quality. When the interval where the comprehensive entropy value falls is detected as a dangerous interval, a new random number generated by the true random number generator is used as a new initial seed to reset the lightweight two-dimensional composite chaotic system. A new chaotic master sequence is generated based on the reset lightweight two-dimensional composite chaotic system. The new chaotic master sequence sequentially performs a first round of full sequence permutation and a second round of nonlinear byte perturbation on the initial S-box state sequence, followed by bijective verification and correction to generate a dynamic S-box. The S-box changes from fixed to dynamic and unpredictable; its internal replacement rules completely change after each update, rendering traditional differential attacks and linear attacks that rely on fixed S-box patterns completely ineffective. Based on the reset lightweight two-dimensional composite chaotic system, masked random numbers are generated. Masked random numbers and a pre-computed masked S-box table using the dynamic S-box are employed. Through integrated masking technology, the true sensitive data is always masked by random numbers during encryption operations, thus eliminating power leakage due to data dependencies and providing resistance to first-order power analysis. The masked S-box table is adapted and integrated into the national cryptographic block encryption algorithm of the power IoT terminal, replacing the running masked S-box table without modifying the algorithm core, facilitating rapid deployment and upgrades in the existing power IoT system.
[0008] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0009] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This illustration shows a flowchart of a lightweight S-box implementation method based on dynamic updating of chaotic sequences, provided in an embodiment of this application. Figure 2 This paper illustrates a flowchart of another lightweight S-box implementation method based on dynamic updating of chaotic sequences provided in an embodiment of this application. Figure 3 This illustration shows a structural schematic diagram of a lightweight S-box implementation device based on dynamic updating of chaotic sequences, provided in an embodiment of this application. Figure 4 This paper shows a schematic diagram of another lightweight S-box implementation device based on dynamic updating of chaotic sequences provided in an embodiment of this application; Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation
[0010] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0011] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0012] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0013] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application 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 application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0014] Existing technical solution 1: Power consumption analysis mask protection scheme based on fixed S-box.
[0015] This scheme is based on the fixed S-box of the AES algorithm and achieves anti-power analysis protection through techniques such as threshold masking and composite field decomposition. Its core idea is to decompose the finite field inversion operation of the S-box into multiple levels of low-complexity operations, performing share splitting and masking processing on sensitive data, thus reducing hardware implementation costs while ensuring first-order side-channel security. A typical example is the patent "A Low-Overhead Anti-Power Analysis AES Algorithm Masking Protection Method" (CN121396428A), which requires only 3 clock cycles to complete the S-box masking operation, optimizing random number requirements and chip area usage, and is currently the mainstream S-box protection implementation scheme for embedded terminals.
[0016] However, this solution relies on a fixed static S-box, which only solves the problem of side-channel attack protection and is difficult to resist differential attacks, linear attacks, and reverse engineering analysis targeting fixed replacement rules. The inherent security vulnerabilities of the static S-box are not fundamentally resolved. Furthermore, the mask protection is tightly coupled with the S-box itself. If the S-box needs to be updated, the entire mask operation logic needs to be redesigned, which is not flexible enough and cannot enhance the active defense capability of the encryption system through dynamic updates. In addition, the solution is designed for a fixed S-box for the AES algorithm, which has poor adaptability and cannot flexibly meet the lightweight transformation requirements of national cryptographic algorithms such as SM4 in power Internet of Things terminals.
[0017] Existing technical solution 2: Dynamic S-box generation scheme based on high-dimensional chaotic system.
[0018] This scheme leverages the complex dynamic characteristics of hyperchaotic systems to generate dynamic S-boxes. The core idea is to generate highly random chaotic sequences using four-dimensional and six-dimensional hyperchaotic systems, construct S-boxes based on sequence numerical transformations, and improve cryptographic metrics such as nonlinearity and differential uniformity of the S-boxes through multi-objective optimization. Typical schemes include: the patent "Market Supervision Data Security Protection Method Based on Dynamic Encryption Strategy" (CN120223430A), which generates dynamic S-boxes and subkeys based on four-dimensional hyperchaotic mapping; and the patent "Dynamic S-box and Cross-channel Diffusion Image Encryption Method Based on Six-dimensional Hyperchaotic Driving" (CN121262325A), which constructs a dynamic S-box library using a six-dimensional hyperchaotic system to achieve dynamic nonlinear replacement.
[0019] However, when using high-dimensional hyperchaotic systems such as four-dimensional and six-dimensional systems, the iterative computation of differential equations is highly complex, requiring a large number of floating-point operations and iterations. This places stringent demands on the computing power of the MCU in the power IoT terminal, making it difficult to achieve real-time generation and dynamic updates in resource-constrained terminals. At the same time, the solution lacks a lightweight entropy monitoring and adaptive update mechanism. Although some solutions can generate dynamic S-boxes, they do not address the entropy degradation problem in the long-term operation of chaotic systems, posing a security risk of decreased sequence randomness. Furthermore, the solution does not incorporate side-channel attack protection design, and the generated dynamic S-boxes do not consider the protection requirements against power analysis attacks. In the actual deployment of power IoT terminals, there is still a security risk of bypass information leakage.
[0020] Existing technical solution 3: S-box generation and testing scheme based on spatiotemporal chaotic system This scheme constructs an iterative matrix using m-sequences, dynamically perturbs the initial chaotic sequence, and generates chaotic sequences through the iteration of a two-dimensional coupled mapping lattice, thereby completing the construction of the S-box. A corresponding cryptographic performance testing system for the S-box is also established. A typical example is the patent "A Dynamic S-Box Generation Method and Testing System Based on Spatiotemporal Chaotic Systems" (CN119602926A), which enhances the randomness of chaotic sequences through m-sequence perturbation, effectively solving the problem of insufficient initial value sensitivity in low-dimensional chaotic systems, and enabling the batch generation of S-boxes conforming to cryptographic standards.
[0021] However, the iterative process of the two-dimensional coupled image lattice and the m-sequence perturbation process still have high computational overhead, and the generation of the S-box requires thousands of pre-iterations, which is difficult to meet the real-time requirements of encrypted communication of power IoT terminals. The solution only focuses on the generation method and performance testing of the S-box, without designing a lightweight dynamic update mechanism adapted to the operation of the terminal, or formulating a hierarchical security strategy for the power IoT scenario, and its engineering feasibility needs to be improved. In addition, the solution does not consider the lightweight implementation of the S-box in the terminal hardware, lacks optimization design for storage occupation and operating power consumption, and does not have a corresponding mask protection scheme, so the security protection dimensions are not complete.
[0022] To address this issue, this application proposes a lightweight S-box implementation method based on dynamic updates of chaotic sequences. First, a lightweight two-dimensional composite chaotic system is driven by a terminal-embedded true random number generator to produce a high-quality random sequence. Based on this sequence, a dynamic S-box is rapidly constructed, fundamentally solving the problem of fixed S-boxes being vulnerable to cryptanalysis attacks. Furthermore, through real-time entropy monitoring and a hierarchical update decision mechanism, the entropy degradation problem of long-term chaotic system operation is effectively overcome, ensuring that the dynamic S-box maintains high randomness. A low-overhead mask protection mechanism linked to the dynamic S-box is also designed to overcome the challenge of incompatibility between dynamics and resistance to side-channel attacks. In addition, by leveraging a flexible hierarchical update strategy and adaptation mode, the basic security and side-channel security of the encryption algorithm are significantly improved, while perfectly matching the stringent constraints of power IoT terminals in terms of computing power, storage, and power consumption. The implementing entity of this application can be a lightweight S-box implementation system based on dynamic updates of chaotic sequences. This system relies on the computing power of a server to provide services to users. The server can be an independent server or a server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0023] This application provides a lightweight S-box implementation method based on dynamic updating of chaotic sequences, such as... Figure 1 As shown, the method includes: 101. Obtain the random number generated by the true random number generator of the power Internet of Things terminal as the initial seed, construct a lightweight two-dimensional composite chaotic system, and iteratively generate the chaotic master sequence based on the lightweight two-dimensional composite chaotic system.
[0024] In this embodiment, a high-entropy random number generator (TRNG) built into the power IoT terminal is invoked to generate random numbers, which are then used as the initial seed of the system. Next, a specially designed lightweight two-dimensional composite chaotic system is constructed using this seed. This system integrates Logistic and Tent mappings and innovatively uses bitwise XOR operations instead of traditional floating-point operations. The system iterates continuously, outputting continuous state variables, which are then converted into a discrete chaotic master sequence. Compared with traditional high-dimensional chaotic systems, its computational complexity is extremely low, allowing for efficient operation on resource-constrained microcontrollers, providing a sustainable and high-quality source of randomness for the entire solution. The power IoT terminal includes the terminal hardware itself, a microcontroller unit (MCU), a security encryption module, a communication module, and a data acquisition module. The security encryption module deploys the aforementioned lightweight S-box implementation device. Through a lightweight S-box implementation method based on dynamic updates of chaotic sequences, the terminal performs SM4 encryption protection on the acquired power data and transmitted control commands, while also possessing resistance to differential attacks, linear attacks, and side-channel power consumption analysis. It should be noted that the scope of application of this terminal includes, but is not limited to, various power Internet of Things (IoT) terminal devices such as smart meters, distribution automation terminals, electricity information collectors, load control terminals, and distributed power monitoring terminals. It can adapt to the encryption and protection needs of the entire power system, including power generation, transmission, transformation, distribution, and consumption.
[0025] 102. Perform lightweight multi-dimensional entropy evaluation on the chaotic master sequence to obtain the comprehensive entropy value, and detect the interval in which the comprehensive entropy value is located.
[0026] In this embodiment, a lightweight, multi-dimensional entropy evaluation is performed on the chaotic master sequence to calculate a comprehensive entropy value. This evaluation considers not only the uniformity of byte distribution but also the periodicity of the sequence, thereby comprehensively quantifying the randomness quality of the sequence. The evaluation results are divided into three predefined intervals: safe, warning, and dangerous. This enables real-time, quantitative monitoring of the quality of the random sequence, addressing the implicit risk of entropy degradation that may occur in chaotic systems during long-term operation. It transforms the abstract concept of randomness into a measurable and decision-making indicator.
[0027] 103. When the interval in which the comprehensive entropy value is located is detected to be a dangerous interval, a new random number generated by a true random number generator is obtained as a new initial seed, the lightweight two-dimensional composite chaotic system is reset, and a new chaotic master sequence is generated based on the reset lightweight two-dimensional composite chaotic system.
[0028] In this embodiment, when the comprehensive entropy value is detected to have fallen into the danger zone, it indicates that the randomness of the current chaotic sequence no longer meets the safety requirements. At this point, the system immediately responds by calling the true random number generator again to obtain a new seed, thereby completely resetting the entire lightweight two-dimensional composite chaotic system and generating a new, high-quality chaotic master sequence. By thoroughly refreshing from the source, rather than simply adjusting parameters, the system can most effectively break the deterioration trajectory that the chaotic system might fall into, ensuring that the system's randomness foundation can be quickly restored to a safe level, fundamentally guaranteeing the long-term safety of the dynamic S-box.
[0029] 104. Based on the new chaotic master sequence, the initial S-box state sequence is subjected to the first round of full sequence permutation and the second round of nonlinear byte perturbation, and after bijective verification and correction, a dynamic S-box is generated.
[0030] In this embodiment, a newly generated chaotic sequence is used as raw material to generate a dynamic S-box through an efficient pipeline. First, a first round of global random scrambling is performed on the standard 0-255 sequence to disrupt the mapping relationship. Then, a second round of nonlinear perturbation is applied to each byte value to enhance the confusion strength. Finally, rigorous mathematical verification and correction are performed to ensure that the generated S-box is a perfect bijective function. This allows for the rapid generation of a dynamic S-box with excellent cryptographic performance with extremely low computational overhead. Moreover, the entire process requires only a finite number of chaotic sequence iterations and simple calculations. The generated S-box possesses high nonlinearity and low differential uniformity, and its generation result is entirely determined by a one-time random sequence, achieving true dynamism and unpredictability. The S-box is a core nonlinear component in block cipher algorithms, responsible for the confusion function in data encryption. Its cryptographic performance directly determines the encryption algorithm's resistance to attacks and its security, making it a core module of commercial cryptographic algorithms such as AES and SM4.
[0031] 105. Generate masked random numbers based on the reset lightweight two-dimensional composite chaotic system, and use masked random numbers and dynamic S-box pre-computation of masked S-box tables.
[0032] In this embodiment, the pre-computed masked S-box table is equivalent to giving the dynamic S-box an "invisibility cloak." By reusing a reset lightweight chaotic system to generate mask random numbers, and then using these mask numbers to perform a one-time pre-computation on the dynamic S-box, the masked S-box table can be obtained. This achieves strong protection against side-channel attacks with near-zero runtime overhead. Since the encryption operation directly queries this pre-computed mask table, the real data is completely masked by random masks, effectively resisting attacks such as power consumption analysis. At the same time, the mask parameters are naturally and synchronously updated with the dynamic S-box, solving the traditional problem of incompatibility between dynamism and side-channel protection.
[0033] 106. Adapt and integrate the masked S-box table into the national cryptographic block encryption algorithm of the power Internet of Things terminal, replacing the running masked S-box table.
[0034] In this embodiment, the masked S-box table is seamlessly integrated into the existing national standard SM4 and other block encryption algorithms in power IoT terminals, directly replacing the original fixed S-box lookup in the algorithm. Only the core S-box lookup table is replaced; no other parts of the encryption algorithm, such as round functions and key expansion, require any modification, thus ensuring full compatibility with existing national standards and communication protocols. This allows the high security gains of this application to be rapidly deployed on a massive number of existing terminal devices with minimal integration costs, demonstrating strong engineering practicality and scalability.
[0035] This application provides a lightweight S-box implementation method based on dynamic updating of chaotic sequences. Compared with the prior art, this application uses a random number generated by a true random number generator from a power Internet of Things (IoT) terminal as the initial seed to construct a lightweight two-dimensional composite chaotic system. A chaotic master sequence is iteratively generated based on this system. The system uses bitwise XOR and other integer operations to replace the massive floating-point calculations of traditional high-dimensional chaos. A lightweight multi-dimensional entropy value evaluation is performed on the chaotic master sequence to obtain a comprehensive entropy value. The interval in which the comprehensive entropy value falls is detected, enabling proactive detection of chaotic randomness decay and automatic reset of the entropy source, fundamentally preventing safety hazards caused by the deterioration of pseudo-random number quality. When the interval in which the comprehensive entropy value falls is detected to be a dangerous interval, a new random number generated by the true random number generator is obtained as a new initial seed, the lightweight two-dimensional composite chaotic system is reset, and a new chaotic sequence is generated based on the reset lightweight two-dimensional composite chaotic system. The main sequence is based on a new chaotic main sequence. The initial S-box state sequence undergoes a first round of full sequence permutation and a second round of nonlinear byte perturbation, followed by bijective verification and correction to generate a dynamic S-box. The S-box changes from fixed to dynamic and unpredictable; its internal replacement rules completely change after each update, rendering traditional differential and linear attacks that rely on fixed S-box patterns completely ineffective. Masked random numbers are generated based on the reset lightweight two-dimensional composite chaotic system. Masked random numbers and a pre-computed masked S-box table using the dynamic S-box are employed. Through integrated masking technology, the system ensures that the real sensitive data is always masked by random numbers during encryption operations, thereby eliminating power leakage due to data dependencies and providing resistance to first-order power analysis. The masked S-box table is adapted and integrated into the national cryptographic block encryption algorithm of the power IoT terminal, replacing the existing masked S-box table without modifying the algorithm core, facilitating rapid deployment and upgrades within the existing power IoT system.
[0036] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, in order to fully illustrate the specific implementation process of this embodiment, this application provides another lightweight S-box implementation method based on dynamic updating of chaotic sequences, such as... Figure 2 As shown, the method includes: 201. Obtain the random number generated by the true random number generator of the power Internet of Things terminal as the initial seed. Based on the random number generated by the true random number generator, generate two initial state values of the lightweight two-dimensional composite chaotic system and the initial value of the m-sequence nonlinear perturbation of the linear feedback shift register.
[0037] In this embodiment, a truly random number generated by physical noise is obtained from a truly random number generator built into the power Internet of Things (IoT) terminal, and this is used as the cryptographic entropy source for the entire system. Subsequently, two key parameters are derived from this truly random number: one is two initial state values used to drive the lightweight two-dimensional composite chaotic system, providing an unpredictable starting point for the chaotic dynamic system; the other is a seed used to initialize the linear feedback shift register (LFSR) to generate an m-sequence with good pseudo-random characteristics that will be subsequently injected into the chaotic system, serving as a perturbation source to enhance nonlinear characteristics. The LFSR, used to generate the m-sequence (maximum-length LFSR sequence), possesses good periodicity and randomness, and can be used to enhance the perturbation effect of the chaotic sequence.
[0038] 202. By integrating the Logistic mapping and the Tent mapping, and introducing m-sequence nonlinear perturbations, a lightweight two-dimensional composite chaotic system is constructed.
[0039] In this embodiment, addressing the lightweight requirements of power IoT terminals, the complex floating-point operations of high-dimensional hyperchaotic systems are abandoned. Instead, a two-dimensional composite chaotic system integrating Logistic and Tent mappings is constructed, balancing high chaos characteristics with low computational overhead. Simultaneously, m-sequence nonlinear perturbations are introduced to avoid the short-period behavior and dynamic degradation problems of low-dimensional chaotic systems. The lightweight implementation refers to the technical approach of reducing computational complexity, memory usage, and runtime latency through algorithm optimization, addressing the limitations of computing power, limited storage resources, and stringent power consumption requirements of power IoT terminals.
[0040] Alternatively, one-dimensional chaotic maps with lower complexity, such as the improved one-dimensional Logistic map or the ICMIC map, can be used to replace the lightweight two-dimensional composite chaotic system, further reducing computational overhead. It should be noted that the chaotic characteristics and initial condition sensitivity of the one-dimensional chaotic system are weaker than those of the two-dimensional composite system, requiring additional perturbation mechanisms to compensate for security. This can serve as a supplementary alternative for ultra-low-power terminals.
[0041] 203. Input the two initial state values and the initial value of the m-sequence nonlinear perturbation into the lightweight two-dimensional composite chaotic system for iterative calculation to obtain the chaotic master sequence value corresponding to each iteration number.
[0042] In this embodiment, for the current iteration number, the two state variables corresponding to the current iteration number are input into the lightweight two-dimensional composite chaotic system for calculation to obtain the two state variables corresponding to the next iteration number, as shown in Formula 1 below: Formula 1:
[0043]
[0044]
[0045] in, These are the two state variables corresponding to the next iteration number. These are the two state variables corresponding to the current iteration number. The control parameter for the Logistic mapping is set to 3.9999 (in the completely chaotic region). The perturbation coefficient for the Tent mapping is a fixed value between 0.1 and 0.5, used to balance the coupling strength between the two mappings. For tent mapping functions, For the input values of the tent mapping function, This method uses bitwise XOR operations to replace traditional floating-point addition, significantly reducing the computational overhead of the MCU. The 8-bit m-sequence nonlinear perturbation value generated for the linear feedback shift register (LFSR) is generated by an 8-level LFSR. The initial state is generated using the terminal hardware unique identifier (UID) and the master key, which enhances the initial condition sensitivity and anti-predictability of the chaotic system. When n=0, These are two initial state values for a lightweight two-dimensional composite chaotic system, ranging from (0,1). This lightweight two-dimensional composite chaotic system can be implemented using only fixed-point arithmetic, eliminating the need for complex floating-point calculations. It can complete a single iteration in a single cycle on an 8-bit / 32-bit low-power MCU, perfectly adapting to the lightweight computing power of power IoT terminals.
[0046] Perform numerical transformation operations on the two state variables corresponding to the current iteration number to generate an 8-bit first chaotic sequence and an 8-bit second chaotic sequence corresponding to the current iteration number, as shown in Formula 2 below: Formula 2:
[0047]
[0048] in, This is the first chaotic sequence corresponding to the current iteration number. This is the second chaotic sequence corresponding to the current iteration number. These are the two state variables corresponding to the current iteration number. For modulo operation, This is the floor function.
[0049] The first and second chaotic sequences corresponding to the current iteration number are merged to obtain the chaotic master sequence value corresponding to the current iteration number, as shown in Formula 3 below: Formula 3:
[0050] in, This represents the chaotic master sequence value corresponding to the current iteration number. This is the first chaotic sequence corresponding to the current iteration number. This is the second chaotic sequence corresponding to the current iteration number. This is a bitwise XOR operation.
[0051] 204. Sort the chaotic master sequence values corresponding to each iteration number according to the iteration order to generate the chaotic master sequence.
[0052] In this embodiment, after each iteration of the lightweight two-dimensional composite chaotic system, the system converts the obtained pair of state variables into two independent byte values in real time, and performs a bitwise XOR operation on them to generate a unique corresponding chaotic master sequence value. These calculated chaotic master sequence values are arranged sequentially according to the iteration order, ultimately forming a complete, ordered byte sequence of length N, i.e., the final chaotic master sequence. This ensures the temporal continuity and causal determinism of the chaotic sequence. Since chaotic systems are sensitive to initial conditions, the iteration order itself is an important source of entropy. Generating the sequence strictly according to this order completely preserves all the information of the chaotic dynamic evolution, making any segment of the sequence strongly correlated with its preceding and following states. This is the basis for ensuring the high randomness and unpredictability of the sequence. If the order is disordered, the statistical properties of the sequence will be completely destroyed, leading to the failure of security assessment and errors in S-box generation.
[0053] 205. Perform lightweight multi-dimensional entropy evaluation on the chaotic master sequence to obtain the comprehensive entropy value. Detect the interval in which the comprehensive entropy value is located. When the interval in which the comprehensive entropy value is located is detected as a safe interval, execute the following step 206; when the interval in which the comprehensive entropy value is located is detected as a warning interval, execute the following step 207; when the interval in which the comprehensive entropy value is detected as a danger interval, execute the following step 208.
[0054] In this embodiment, multiple recently generated chaotic master sequence values are selected from the chaotic master sequence according to a preset number of sequence values to generate a sample sequence. Then, the uniformity of the node value distribution is calculated on the sample sequence to obtain the Shannon entropy value, as shown in Formula 4 below: Formula 4:
[0055] in, The Shannon entropy value is an 8-bit value, with an ideal value of 8. It is a quantitative indicator that measures the uncertainty of a random sequence. The higher the entropy value, the stronger the randomness and unpredictability of the sequence, and the higher the encryption security. Let i be the probability of byte value i appearing in the sample sequence.
[0056] The sequence repeatability of the sample sequence is calculated to obtain the periodicity score, which is normalized to the [0,8] interval. The lower the sequence repeatability, the higher the score.
[0057] To address the limitations of terminal computing power, the traditional multi-dimensional entropy calculation is simplified, and a comprehensive entropy evaluation system is constructed with Shannon entropy as the core and sequence periodicity detection as an auxiliary method. The comprehensive entropy value is calculated as shown in Formula 5 below: Formula 5:
[0058] in, This is the comprehensive entropy value. This is the Shannon entropy value. To score the periodic characteristics, These are the weighting coefficients. .
[0059] Optionally, the above-mentioned lightweight entropy evaluation model uses Shannon entropy plus periodic characteristics. Alternative solutions could introduce simplified sample entropy, Renyi entropy evaluation, or the simplified NISTSP800-22 test item for sequence randomness detection to improve the comprehensiveness of the entropy evaluation. It should be noted that the disadvantage of these alternative solutions is increased computational overhead, making them suitable for power distribution terminal scenarios with relatively sufficient computing power.
[0060] Then, the range in which the comprehensive entropy value falls is detected; If the detected comprehensive entropy value is greater than or equal to the first threshold, the interval in which the comprehensive entropy value is located is determined to be a safe interval, and the following step 206 is executed. Under the premise of keeping the current chaotic system state and S-box parameters completely unchanged, the encryption operation is performed normally according to the preset encryption process. If the detected comprehensive entropy value is greater than or equal to the second threshold and less than the first threshold, the interval in which the comprehensive entropy value is located is determined to be the warning interval, and the following step 207 is executed to trigger the disturbance of the chaotic system parameters, dynamically adjust the initial state and coupling coefficient of the m sequence to enhance the nonlinear characteristics of the chaotic system and increase the sequence entropy value; If the detected comprehensive entropy value is less than the second threshold, the interval in which the comprehensive entropy value is located is determined to be a dangerous interval. Step 208 is then executed, immediately triggering a full dynamic update of the S-box and regenerating the initial chaotic seed and a brand new S-box. The first threshold is 7.6, and the second threshold is 7.2.
[0061] 206. When the interval in which the comprehensive entropy value is detected is a safe interval, the lightweight two-dimensional composite chaotic system and the dynamic S-box remain unchanged.
[0062] In this embodiment, when the interval in which the comprehensive entropy value is detected is a safe interval, the lightweight two-dimensional composite chaotic system will continue to iterate normally with its current state (including state variables, parameters, etc.) without any adjustments. Simultaneously, the current dynamic S-box and masked S-box table generated based on this high-quality chaotic sequence will continue to be used without triggering a regeneration process.
[0063] 207. When the interval in which the comprehensive entropy value is located is detected to be a warning interval, a new m-sequence nonlinear perturbation initial value and a new coupling coefficient are generated to perform perturbation operation on the operating parameters of the lightweight two-dimensional composite chaotic system.
[0064] In this embodiment, when the interval in which the comprehensive entropy value is located is detected to be a warning interval, a temporary random number generated by a true random number generator, the initial value of the m-sequence nonlinear perturbation of the linear feedback shift register, and two current state variables of the lightweight two-dimensional composite chaotic system are obtained. Next, the initial value of the m-sequence nonlinear perturbation is adjusted based on the temporary random number generated by the true random number generator and the two current state variables of the lightweight two-dimensional composite chaotic system to obtain a new initial value of the m-sequence nonlinear perturbation. Subsequently, a random perturbation value is generated and added to the coupling coefficient of the tent mapping function in the lightweight two-dimensional composite chaotic system to obtain a new coupling coefficient. Finally, the new initial value of the m-sequence nonlinear perturbation and the new coupling coefficient are used to perform a perturbation operation on the operating parameters of the lightweight two-dimensional composite chaotic system. By dynamically adjusting only the two key parameters—the m-sequence perturbation source and the system coupling coefficient—the system dynamics can be optimized instantly and flexibly with extremely low overhead based on early signs of entropy decrease, effectively interrupting the trend of randomness degradation. This avoids costly full system reconstruction in most cases, maximizing system stability and terminal energy efficiency while ensuring a safety baseline.
[0065] 208. When the interval in which the comprehensive entropy value is located is detected to be a dangerous interval, a new random number generated by a true random number generator is obtained as a new initial seed, the lightweight two-dimensional composite chaotic system is reset, and a new chaotic master sequence is generated based on the reset lightweight two-dimensional composite chaotic system.
[0066] In this embodiment, a new physical random number generator is invoked on the terminal hardware to generate a new physical random number, which is then used as a new initial seed to completely reset the state variables of the lightweight two-dimensional composite chaotic system. Subsequently, based on this new seed, the lightweight two-dimensional composite chaotic system is re-driven to iterate, generating a completely independent and unpredictable new chaotic master sequence. This operation not only fundamentally interrupts the possible random degradation trajectory of the chaotic system by injecting new true random entropy, ensuring that the sequence quality is restored to a safe level, but also enables the system to dynamically and thoroughly update the generation source of its core cryptographic parameters when facing serious security threats, thereby greatly enhancing the system's long-term security resilience, dynamic defense capabilities, and proactive resistance to cryptanalysis attacks.
[0067] 209. Based on the new chaotic master sequence, the initial S-box state sequence is subjected to the first round of full sequence permutation and the second round of nonlinear byte perturbation, and after bijective verification and correction, a dynamic S-box is generated.
[0068] In this embodiment, an S-box generation process with low iteration overhead is designed based on a high-entropy chaotic sequence to ensure that the generated S-box meets core cryptographic indicators such as high nonlinearity, low differential uniformity, and strict avalanche criterion, while significantly reducing terminal computing overhead.
[0069] First, generate the initial 8×8S box state sequence. The initial S-box state sequence is a sequence of integers from 0 to 255 arranged in order. Then, the first N values of the new chaotic master sequence are obtained, where N is the capacity of the S-box, which can be 256.
[0070] Then, a chaotic-driven dual-wheel permutation perturbation is performed, abandoning the traditional high-overhead multi-objective optimization and thousands of pre-iterations. Two lightweight permutation operations are designed to achieve highly nonlinear perturbation of the S-box.
[0071] Specifically, based on the Fisher-Yates shuffle algorithm, the first N values of the new chaotic master sequence are used to perform a global random permutation on the initial S-box state sequence, completing the full range of position permutations to obtain the first intermediate sequence. Then, for each byte in the first intermediate sequence, a nonlinear transformation is performed according to the new chaotic master sequence. Through a nonlinear combination of XOR and addition, the confusion characteristics of the S-box are further enhanced to obtain the second intermediate sequence, as shown in Formula 6 below: Formula 6:
[0072] in, Let i be the i-th byte in the second intermediate sequence (0≤i≤255). For the i-th byte in the first intermediate sequence, This is the (i+256th)th byte in the new chaotic master sequence. This is the (i+512)th byte in the new chaotic master sequence. For modulo operation, This is a bitwise XOR operation.
[0073] Then, bijective verification and fast correction are performed. Since block cipher algorithms require the S-box to be a bijective function, i.e., the input and output must correspond one-to-one, to avoid information loss, a lightweight bijective verification and correction mechanism is designed as follows: Perform byte value duplication detection on each byte in the second intermediate sequence; If the detection determines that a byte is a duplicate byte value, a random value is generated using the chaotic master sequence, and the duplicate byte value is replaced with the random value to ensure that there are no duplicates or omissions in the 256 bytes.
[0074] By traversing the second intermediate sequence through byte value repetition detection, the dynamic S-box is obtained. In this context, each byte value in the dynamic S-box is unique.
[0075] This generation process requires only 3 chaotic sequence iterations (768 bytes in total) to complete the S-box construction. Compared with the traditional chaotic S-box scheme, the number of iterations is reduced by more than 90%. It can be generated in milliseconds on low-power MCUs, fully meeting the real-time encryption requirements of power terminals.
[0076] Optionally, the above method uses a two-round permutation disturbance to generate the S-box. An alternative is to use an index sorting method based on chaotic sequences, directly using the chaotic sequence values as indices to perform sorting and permutation on the initial S-box, further simplifying the generation process. It should be noted that the disadvantage of the alternative is that the nonlinear perturbation effect is weaker than that of the two-round permutation, requiring an additional byte-level nonlinear transformation. It can be used as an alternative to the minimalist mode.
[0077] 210. Generate masked random numbers based on the reset lightweight two-dimensional composite chaotic system, and use masked random numbers and dynamic S-box pre-computation of masked S-box tables.
[0078] In this embodiment, a lightweight first-order masking protection scheme adapted to dynamic S-boxes is designed to address the side-channel attack risk in power IoT terminals. This solves the problems of incompatibility and excessive overhead between traditional masking schemes and dynamic S-boxes. Specifically, the input sensitive data of the S-box is split into two parts, as shown in Formula 7 below: Formula 7:
[0079] in, To input sensitive data, As the first share, It is the second share.
[0080] For dynamically generated S-boxes, a masked S-box table is pre-computed to avoid the complex computations of traditional composite field decomposition masks and adapt to dynamic update characteristics. First, the two current state variables of the reset lightweight two-dimensional composite chaotic system are obtained. These two current state variables are then input into the reset lightweight two-dimensional composite chaotic system to continue iteratively generating the chaotic master sequence. Mask random numbers are extracted from the continuously generated chaotic master sequence. Then, the dynamic S-box is pre-computed based on the mask random numbers to generate a masked S-box table, as shown in Formula 8 below: Formula 8:
[0081] in, To mask the S-box table, For dynamic S-box, The mask is a random number. This is a bitwise XOR operation.
[0082] During encryption operations, a lookup operation is directly performed on the masked input data, and the output result contains the mask. No sensitive plaintext data needs to be exposed throughout the process, achieving first-order protection against power consumption analysis. It should be noted that when the S-box is dynamically updated, the masked S-box table is updated synchronously. The update process requires only 256 XOR operations, resulting in extremely low computational overhead and perfect compatibility with dynamic update mechanisms. Furthermore, the mask random number is updated synchronously with the S-box. Each time the S-box is updated, new mask parameters are generated synchronously, ensuring the unpredictability of the mask and further enhancing side-channel protection strength.
[0083] Optionally, the above-described protection scheme uses a pre-computed masked S-box table. An alternative scheme can be a threshold masking scheme based on composite field decomposition, which performs fractional processing on the S-box operation, eliminating the need for pre-computed mask tables and further reducing memory usage. It should be noted that the disadvantage of this alternative scheme is its higher computational complexity and poorer adaptability to dynamic S-boxes, requiring readjustment of the masking operation logic as the S-box is updated. It can be considered an alternative for scenarios with extremely limited memory.
[0084] 211. Adapt and integrate the masked S-box table into the national cryptographic block encryption algorithm of the power Internet of Things terminal, and replace the running masked S-box table.
[0085] In this embodiment, a seamless adaptation scheme is designed for the SM4 block encryption algorithm, a national standard widely used in power IoT terminals, while optimizing terminal storage and operating overhead. The generated dynamic S-box directly replaces the fixed S-box of the SM4 algorithm. The round function and key expansion process of the SM4 algorithm do not need modification, thus achieving dynamic upgrades of the encryption algorithm and full compatibility with existing national standard encryption specifications for power systems.
[0086] Optionally, a lightweight operation mode or a pre-generated library mode can be used to manage the masked S-box meters in the power IoT terminal. The lightweight operation mode, designed for situations with limited terminal storage resources, employs a "real-time generation - on-demand loading - use-and-destroy" mechanism: the S-box is only loaded into memory during encryption operations, and the old S-box data is immediately cleared after the operation is completed and an update is triggered, without occupying persistent storage resources. The pre-generated library mode, designed for ultra-low-power terminals, pre-generates eight sets of highly secure S-boxes and stores them in the terminal. During encryption, the S-box is randomly selected using a chaotic sequence, and the S-box library is updated periodically, maximizing computational overhead while retaining dynamic protection capabilities.
[0087] To address the needs of different business scenarios and security levels of power Internet of Things (IoT) terminals, this application designs a three-pronged hierarchical dynamic update strategy: "timed update, event-triggered update, and entropy-triggered update," balancing security and terminal operating efficiency, as detailed below: Scheduled Updates: This feature retrieves the dynamic S-box update cycle of the power IoT terminal. The dynamic S-box update cycle is determined based on the security sensitivity level of the services processed by the power IoT terminal. It also retrieves the runtime since the last dynamic S-box update. If the runtime since the last dynamic S-box update meets the dynamic S-box update cycle, and the power IoT terminal is currently in an idle state, a dynamic S-box update operation is performed, generating a new dynamic S-box and its corresponding masked S-box table. Scheduled periodic updates are suitable for low-sensitivity services such as ordinary electricity consumption information collection. A configurable update cycle can be set (default 24 hours). During idle periods, the terminal automatically refreshes the chaotic system seed and regenerates the S-box. The update process does not affect normal service execution.
[0088] Event-triggered update: The system detects the operational status of power IoT terminals. If the detected operational status is a critical event, a dynamic S-box update operation is performed, generating a new dynamic S-box and its corresponding masked S-box table. Critical events include any one of the following: terminal restart or power-on events, completion of encrypted communication for highly sensitive services, or detection of security attacks. When the critical event is a terminal restart or power-on event, the dynamic S-box update operation includes calling a true random number generator to reset the initial seed, ensuring that the encryption replacement rules are different each time. When the critical event is the completion of encrypted communication for highly sensitive services, an S-box update is immediately triggered, achieving "one-time password" level dynamic protection. When the critical event is a security attack detection event, i.e., abnormal access, multiple decryption failures, or other attack behaviors are detected, a full S-box update and a chaotic system restart are immediately triggered to block attack paths.
[0089] Entropy-triggered update: As in steps S205 and S208-S209 above, when the comprehensive entropy value of the chaotic sequence falls into the danger zone, the S-box is immediately triggered for forced update. At the same time, the terminal true random number generator is called again to generate a brand new chaotic initial seed, which completely solves the problem of entropy degradation in the chaotic system and ensures the continuous high randomness of the S-box.
[0090] It should be noted that, to avoid data decryption failure at both ends of the communication due to S-box updates, an S-box synchronization mechanism based on session keys is designed: in encrypted communication between the terminal and the master station, the session identifier is bound to the S-box version number; after each S-box update, the S-box version and derived parameters are synchronized through a key negotiation process. For encrypted data stored locally on the terminal, a method of associating data block identifiers with the S-box version is used to ensure that historical data can be decrypted normally through the corresponding version of the S-box.
[0091] Alternatively, alternative solutions may employ a trigger update mechanism based on the amount of encrypted data, such as triggering an S-box update every 1MB of encrypted data, or a linkage update mechanism based on the key lifecycle, where the S-box is updated synchronously when the key is updated. This can be flexibly replaced according to the business characteristics of the power terminal.
[0092] This application designs a lightweight two-dimensional composite chaotic system adapted to power IoT terminals. It integrates the advantages of Logistic and Tent mappings, and combines m-sequence nonlinear perturbation to achieve the generation of highly random chaotic sequences with extremely low computational overhead, solving the problem that traditional high-dimensional chaotic systems cannot be implemented on resource-constrained terminals. A lightweight dual-wheel permutation S-box rapid generation method is designed, which significantly reduces the number of iterations and computational overhead of the generation process while ensuring high cryptographic performance of the S-box, achieving millisecond-level real-time generation of the S-box on the terminal side. A lightweight multi-dimensional entropy monitoring and three-level adaptive response mechanism is constructed to effectively solve the problem of low... To address the entropy degradation problem in chaotic systems, a three-pronged S-box hierarchical dynamic update strategy integrating "timed updates + events + entropy values" was designed, balancing security and terminal operating efficiency. A low-overhead mask protection mechanism adapted to dynamic S-boxes was designed, resolving the incompatibility issue between traditional masking schemes and dynamic S-boxes. This achieves resistance to power analysis side-channel attacks with extremely low overhead, filling the gap in side-channel protection for dynamic S-boxes. Furthermore, a flexible adaptation scheme was designed for terminals across all scenarios in the power IoT, seamlessly integrating with the national cryptographic SM4 algorithm. It supports adaptation to all types of devices, from ultra-low-power sensing terminals to high-performance power distribution terminals, demonstrating strong engineering feasibility.
[0093] This application can be implemented in lightweight software within a smart meter, as shown in Example 1 below: The application scenario of this embodiment is a State Grid smart meter. The meter uses a 32-bit low-power MCU (Cortex-M0 core, 48MHz main frequency, 128KB Flash, 16KB RAM). The core requirements are lightweight, low power consumption and high security for encrypted transmission of electricity data.
[0094] System initialization: After the meter is powered on, the built-in hardware true random number generator (TRNG) is called to generate a 16-bit random number, which is then split into the initial values x0 and y0 of the chaotic system (normalized to the (0,1) interval); at the same time, based on the meter's unique hardware UID and root key, an 8-level linear feedback shift register (LFSR) is initialized to generate an m-sequence, thus completing the initialization of the two-dimensional composite chaotic system.
[0095] Initial S-box generation: The chaotic system iterates 768 times to generate a chaotic master sequence, and executes a double-round permutation perturbation process to generate an initial dynamic S-box; bijectivity verification is completed simultaneously to ensure that the S-box is a bijective function with all permutations from 0 to 255; masked random numbers are generated based on the chaotic sequence, and the masked S-box table is pre-computed and stored in the MCU's RAM.
[0096] Adaptation to the national cryptographic SM4 algorithm: The original fixed S-box of the SM4 algorithm is replaced with the dynamic S-box generated by this invention. The round function, key expansion and encryption / decryption process of the SM4 algorithm fully comply with the "GM / T 0002-2012 SM4 block cipher algorithm" specification. Only the S-box call interface of the byte replacement step is modified to ensure compatibility with encrypted communication with the power grid master station.
[0097] Dynamic update execution process: Scheduled update: The update cycle is set to 24 hours. The meter automatically performs S-box updates during the nighttime idle period (such as 2 am), regenerating the chaotic seed and S-box, and synchronizing the S-box version with the master station through the power grid key negotiation protocol; Event-triggered update: After each completion of meter frozen data reporting and remote control command interaction, the S-box update is triggered immediately to ensure that the encryption rules for highly sensitive operations are used only once; Entropy monitoring: After every 1000 encryption operations, the entropy value of the chaotic sequence is evaluated. If the entropy value is lower than 7.2, a forced update is triggered immediately to regenerate the initial seed and S-box.
[0098] Encrypted communication execution: When the meter performs SM4 encryption on sensitive data such as collected voltage, current, and power consumption, it directly calls the dynamic S-box and masked S-box table in RAM to complete the byte replacement operation. The entire encryption process is protected by a mask, which can effectively resist power analysis attacks. After encryption, the data packet is accompanied by the S-box version number, and the master station completes the decryption through the corresponding version of the S-box parameters.
[0099] Resource optimization: The electricity meter adopts the "single S-box real-time operation" mode, which only retains the currently effective S-box and the masked S-box table in RAM, with a total storage occupation of only 512 bytes; the old S-box is immediately cleared from memory after the update is completed, without occupying persistent Flash resources; the generation time of a single S-box is less than 2ms, which has no significant impact on the normal operation and power consumption of the electricity meter.
[0100] This application can be implemented with hardware acceleration in a power distribution terminal, as shown in the following Example 2: The application scenario of this embodiment is a power distribution automation terminal. The terminal adopts an FPGA+ARM architecture, and its core requirements are high real-time performance, high-concurrency encrypted computing and strong security protection, which are adapted to the encryption requirements of power distribution line operation data and control commands.
[0101] The hardware logic design implements a lightweight two-dimensional composite chaotic system hardware acceleration circuit in FPGA. A pipelined architecture is used to design the chaotic mapping iteration module, which can complete one chaotic iteration and numerical transformation in a single clock cycle, realizing high-speed generation of chaotic sequences. At the same time, an S-box rapid generation hardware circuit is built in FPGA, integrating the entire process of Fisher-Yates permutation, nonlinear perturbation and bijective verification hardware acceleration.
[0102] Regarding the dynamic update and multi-instance management of S-boxes, the power distribution terminal supports concurrent operation of multiple encrypted channels, allocates an independent dynamic S-box instance for each communication session, generates exclusive S-boxes for different sessions based on a chaotic system, and achieves encrypted isolation between sessions; the S-box update cycle is set to 1 hour, and it also supports regenerating the S-box every time a TCP session is established, achieving "one session, one key".
[0103] In terms of enhancing side-channel protection, the mask protection mechanism of this invention is combined in the FPGA hardware circuit to perform fractional processing on the input, output and table lookup process of the S-box, thereby achieving first-order anti-power analysis protection; at the same time, random clock jitter is introduced to further enhance the side-channel attack protection capability and meet the high security level requirements of the power distribution terminal.
[0104] In terms of security auditing and anomaly protection, the terminal records the entire process of generating, updating and calling the S-box, and the log data is stored in encrypted form to support security auditing of the power grid operation and maintenance platform; it detects abnormal decryption requests and side-channel attack characteristics in real time, and once an attack is detected, it immediately triggers a full update of the S-box and a restart of the chaotic system, while reporting alarm information.
[0105] This application can be implemented in a simplified mode in an ultra-low power terminal, as shown in the following embodiment 3: The application scenario of this embodiment is an ultra-low power wireless sensing terminal (such as a power distribution room environmental monitoring sensor, a line fault indicator). This type of terminal uses an 8-bit MCU with a main frequency of only 8MHz, and its RAM and Flash resources are extremely limited. The core requirements are extreme lightweight and low power consumption.
[0106] In terms of optimizing the simplified chaotic system, we perform extreme fixed-point optimization on the two-dimensional composite chaotic system. All operations are implemented using 8-bit / 16-bit fixed-point numbers, completely abandoning floating-point operations. At the same time, we simplify the entropy evaluation mechanism, retaining only the Shannon entropy core index, effectively reducing computational overhead.
[0107] The S-box pre-generation and dynamic rotation mode is as follows: Before the terminal leaves the factory, 8 sets of high-security S-boxes that meet cryptographic indicators are pre-generated and stored in the terminal's Flash memory, with a total storage occupation of only 2KB; when the terminal is running, a random index is generated through a chaotic sequence, and a set of S-boxes is randomly selected for each encryption operation to achieve lightweight dynamic protection.
[0108] The low-overhead update mechanism is designed as follows: The terminal is set to an ultra-long update cycle (7 days by default). During the idle window when the battery is powered, the S-box is fully regenerated once to replace the pre-generated S-box library in Flash. At the same time, during critical events such as power-on and parameter configuration, the S-box is randomly rotated to ensure encryption dynamism with extremely low overhead.
[0109] In the encryption algorithm adaptation stage, the lightweight block cipher algorithm SM4-ECB is adopted, replacing the fixed S-box with a dynamically selected S-box. The encryption operation only needs to call the S-box table lookup operation, without any additional computational overhead, which is suitable for the ultra-low computing power and low power consumption requirements of the terminal.
[0110] This application addresses the scenario characteristics and core needs of power Internet of Things (IoT) terminals, overcoming the bottleneck of the difficulty in balancing high security and lightweight design in existing technologies, and bringing the following significant benefits: 1. Security is comprehensively improved, fundamentally solving the inherent defects of static S-boxes.
[0111] By dynamically generating and updating S-boxes using chaotic sequences, the encryption replacement rules become unpredictable, completely solving the problem of fixed S-boxes being vulnerable to differential attacks, linear attacks, and reverse analysis, thus significantly improving the anti-attack capability of the encryption algorithm. A real-time monitoring and adaptive update mechanism for the entropy value of chaotic sequences is designed, effectively solving the entropy degradation problem of low-dimensional chaotic systems and ensuring the continuous high randomness of dynamic S-boxes. A low-overhead mask protection mechanism adapted to dynamic S-boxes is designed, simultaneously achieving mathematical attack protection at the algorithm level and side-channel attack protection at the physical level, constructing a comprehensive security protection system. The generated S-boxes have an average nonlinearity of ≥10⁴, a differential uniformity of ≤4, and a strict avalanche criterion deviation of ≤0.02, fully meeting the S-box security standards of commercial cryptographic algorithms.
[0112] 2. Extremely lightweight design, perfectly adapted to scenarios where power IoT terminals have limited resources.
[0113] Abandoning the complex computations of high-dimensional hyperchaotic systems, the designed two-dimensional composite chaotic system requires only basic fixed-point arithmetic and XOR operations, and can be efficiently implemented on 8-bit / 32-bit low-power MCUs. Compared with four-dimensional / six-dimensional hyperchaotic solutions, the computational overhead is reduced by more than 90%. The innovative dual-wheel lightweight S-box generation process eliminates the need for extensive pre-iteration and multi-objective optimization, completing S-box generation in milliseconds. Compared with traditional chaotic S-box solutions, the generation efficiency is improved by tens of times. The storage footprint is extremely low, requiring only 512 bytes of memory to store the S-box during runtime. It supports a "use and destroy" operating mode, eliminating the need for large amounts of persistent storage resources, and is fully compatible with resource-constrained power IoT devices such as smart meters and sensor terminals.
[0114] 3. High flexibility and engineering feasibility, deeply adapted to the business needs of the power system.
[0115] A hierarchical dynamic update strategy was designed, which can flexibly configure update rules according to the type of power terminal and the security level of the service, balancing security and operational efficiency, and adapting to all types of power IoT devices from ultra-low power sensor terminals to high-performance distribution terminals; it can seamlessly adapt to the national cryptographic SM4 block encryption algorithm, without modifying the core process of the original encryption algorithm, and can realize the upgrade from static encryption to dynamic encryption, fully compatible with the national cryptographic application specifications of the existing power system, with extremely low engineering implementation and transformation costs; an S-box version management and synchronization mechanism was designed to solve the decryption synchronization problem between the two ends of communication caused by dynamic S-box updates, ensuring the continuity and reliability of encrypted communication in power services.
[0116] 4. Low power consumption characteristics, meeting the long battery life requirements of power terminals.
[0117] The core operations of this application are all low-overhead basic logic operations, without complex floating-point calculations and a large number of iterative operations. The computing power consumption of S-box generation and updating is extremely low, and the impact on the terminal's operating power consumption is minimal. It is adapted to the long battery life requirements of battery-powered wireless terminals and will not increase the terminal's energy consumption burden.
[0118] This application provides a lightweight S-box implementation method based on dynamic updating of chaotic sequences. Compared with the prior art, this application uses a random number generated by a true random number generator from a power Internet of Things (IoT) terminal as the initial seed to construct a lightweight two-dimensional composite chaotic system. A chaotic master sequence is iteratively generated based on this system. The system uses bitwise XOR and other integer operations to replace the massive floating-point calculations of traditional high-dimensional chaos. A lightweight multi-dimensional entropy value evaluation is performed on the chaotic master sequence to obtain a comprehensive entropy value. The interval in which the comprehensive entropy value falls is detected, enabling proactive detection of chaotic randomness decay and automatic reset of the entropy source, fundamentally preventing safety hazards caused by the deterioration of pseudo-random number quality. When the interval in which the comprehensive entropy value falls is detected to be a dangerous interval, a new random number generated by the true random number generator is obtained as a new initial seed, the lightweight two-dimensional composite chaotic system is reset, and a new chaotic sequence is generated based on the reset lightweight two-dimensional composite chaotic system. The main sequence is based on a new chaotic main sequence. The initial S-box state sequence undergoes a first round of full sequence permutation and a second round of nonlinear byte perturbation, followed by bijective verification and correction to generate a dynamic S-box. The S-box changes from fixed to dynamic and unpredictable; its internal replacement rules completely change after each update, rendering traditional differential and linear attacks that rely on fixed S-box patterns completely ineffective. Masked random numbers are generated based on the reset lightweight two-dimensional composite chaotic system. Masked random numbers and a pre-computed masked S-box table using the dynamic S-box are employed. Through integrated masking technology, the system ensures that the real sensitive data is always masked by random numbers during encryption operations, thereby eliminating power leakage due to data dependencies and providing resistance to first-order power analysis. The masked S-box table is adapted and integrated into the national cryptographic block encryption algorithm of the power IoT terminal, replacing the existing masked S-box table without modifying the algorithm core, facilitating rapid deployment and upgrades within the existing power IoT system.
[0119] Furthermore, as Figure 1 To specifically implement the method, this application provides a lightweight S-box implementation device based on dynamic updates of chaotic sequences, such as... Figure 3 As shown, the device includes: a lightweight chaotic system generation module 301, a sequence health monitoring module 302, an adaptive update decision module 303, a dynamic S-box generation module 304, a side channel mask protection module 305, and a national cryptographic algorithm adaptation and integration module 306.
[0120] The lightweight chaotic system generation module 301 is used to obtain random numbers generated by the true random number generator of the power Internet of Things terminal as the initial seed, construct a lightweight two-dimensional composite chaotic system, and iteratively generate a chaotic main sequence based on the lightweight two-dimensional composite chaotic system. The sequence health monitoring module 302 is used to perform lightweight multi-dimensional entropy value evaluation on the chaotic main sequence to obtain a comprehensive entropy value, and to detect the interval in which the comprehensive entropy value is located. The adaptive update decision module 303 is used to obtain a new random number generated by the true random number generator as a new initial seed when it is detected that the interval in which the comprehensive entropy value is located is a dangerous interval, reset the lightweight two-dimensional composite chaotic system, and generate a new chaotic main sequence based on the reset lightweight two-dimensional composite chaotic system. The dynamic S-box generation module 304 is used to perform a first round of full sequence permutation and a second round of nonlinear byte perturbation on the initial S-box state sequence based on the new chaotic master sequence, and generate a dynamic S-box after bijective verification and correction. The side-channel mask protection module 305 is used to generate a mask random number based on the reset lightweight two-dimensional composite chaotic system, and to pre-compute the masked S-box table using the mask random number and the dynamic S-box. The national cryptographic algorithm adaptation and integration module 306 is used to adapt and integrate the masked S-box table into the national cryptographic block encryption algorithm of the power Internet of Things terminal, replacing the masked S-box table in operation.
[0121] In a specific application scenario, the lightweight chaotic system generation module 301 is used to generate two initial state values of the lightweight two-dimensional composite chaotic system and an initial value of the m-sequence nonlinear perturbation of the linear feedback shift register based on the random numbers generated by the true random number generator; to fuse the Logistic mapping and the Tent mapping, and to introduce the m-sequence nonlinear perturbation, the lightweight two-dimensional composite chaotic system is constructed; the two initial state values and the initial value of the m-sequence nonlinear perturbation are input into the lightweight two-dimensional composite chaotic system for iterative calculation to obtain the chaotic master sequence value corresponding to each iteration number; and the chaotic master sequence value corresponding to each iteration number is sorted according to the iteration order to generate the chaotic master sequence.
[0122] In specific application scenarios, the lightweight chaotic system generation module 301 is used to input the two state variables corresponding to the current iteration number into the lightweight two-dimensional composite chaotic system for calculation, so as to obtain the two state variables corresponding to the next iteration number.
[0123]
[0124]
[0125] in, These are the two state variables corresponding to the next iteration number. These are the two state variables corresponding to the current iteration number. These are the control parameters for the Logistic mapping. For the perturbation coefficients of the Tent mapping, For tent mapping functions, The input value for the tent mapping function is... For bitwise XOR operation, The m-sequence nonlinear perturbation value generated by the linear feedback shift register, when n=0, Let the two initial state values be the values of the lightweight two-dimensional composite chaotic system; perform numerical transformation operations on the two state variables corresponding to the current iteration number to generate the first chaotic sequence and the second chaotic sequence corresponding to the current iteration number.
[0126]
[0127] in, The first chaotic sequence corresponding to the current iteration number. The second chaotic sequence corresponding to the current iteration number. These are the two state variables corresponding to the current iteration number. For modulo operation, The function is a floor function; the first and second chaotic sequences corresponding to the current iteration number are merged to obtain the chaotic master sequence value corresponding to the current iteration number.
[0128] in, The value of the chaotic master sequence corresponding to the current iteration number. The first chaotic sequence corresponding to the current iteration number. The second chaotic sequence corresponding to the current iteration number. This is a bitwise XOR operation.
[0129] In specific application scenarios, the sequence health monitoring module 302 is used to select multiple recently generated chaotic master sequence values from the chaotic master sequence according to a preset number of sequence values to generate a sample sequence; and to calculate the uniformity of the node value distribution of the sample sequence to obtain the Shannon entropy value.
[0130] in, The entropy value of Shannon. Let byte value i be the probability of appearing in the sample sequence; calculate the sequence repetition rate of the sample sequence to obtain a periodicity score; calculate the comprehensive entropy value using the Shannon entropy value and the periodicity score.
[0131] in, The comprehensive entropy value is... The entropy value of Shannon. Score the periodic characteristics. These are the weighting coefficients. The interval in which the comprehensive entropy value is located is detected; if the comprehensive entropy value is detected to be greater than or equal to a first threshold, the interval in which the comprehensive entropy value is located is determined to be a safe interval; if the comprehensive entropy value is detected to be greater than or equal to a second threshold and less than the first threshold, the interval in which the comprehensive entropy value is located is determined to be a warning interval; if the comprehensive entropy value is detected to be less than the second threshold, the interval in which the comprehensive entropy value is located is determined to be a danger interval, wherein the first threshold is greater than the second threshold.
[0132] In a specific application scenario, the dynamic S-box generation module 304 is used to generate the initial S-box state sequence, wherein the initial S-box state sequence is a sequence of integers from 0 to 255 arranged in order; obtain the first N values of the new chaotic master sequence, where N is the S-box capacity; based on the Fisher-Yates shuffle algorithm, perform a global random permutation on the initial S-box state sequence using the first N values of the new chaotic master sequence to obtain a first intermediate sequence; and perform a nonlinear transformation on each byte in the first intermediate sequence according to the new chaotic master sequence to obtain a second intermediate sequence.
[0133] in, This refers to the i-th byte in the second intermediate sequence. This refers to the i-th byte in the first intermediate sequence. This refers to the (i+256th) byte in the new chaotic master sequence. This refers to the (i+512)th byte in the new chaotic master sequence. For modulo operation, The process involves bitwise XOR operation; byte value duplication detection is performed on each byte in the second intermediate sequence; if the detection determines that the byte is a duplicate byte value, a random value is generated using the chaotic main sequence, and the duplicate byte value is replaced by the random value; the second intermediate sequence is traversed through the byte value duplication detection to obtain the dynamic S-box, where each byte value in the dynamic S-box is unique.
[0134] In a specific application scenario, the side-channel masking protection module 305 is used to obtain two current state variables of the reset lightweight two-dimensional composite chaotic system, input the two current state variables of the reset lightweight two-dimensional composite chaotic system into the reset lightweight two-dimensional composite chaotic system, continue to iteratively generate a chaotic master sequence, extract the mask random number from the continuously generated chaotic master sequence, and pre-calculate the dynamic S-box according to the mask random number to generate the masked S-box table.
[0135] in, For the masked S-box table, For the dynamic S-box, For the mask, a random number is generated. This is a bitwise XOR operation.
[0136] In specific application scenarios, such as Figure 4 As shown, the device also includes: a dynamic disturbance module for chaotic system parameters 307, a timed update module 308, and an event-triggered update module 309.
[0137] The chaotic system parameter dynamic perturbation module 307 is used to, when the interval in which the comprehensive entropy value is detected to be a warning interval, acquire a temporary random number generated by the true random number generator, an initial value of the m-sequence nonlinear perturbation of the linear feedback shift register, and two current state variables of the lightweight two-dimensional composite chaotic system; adjust the initial value of the m-sequence nonlinear perturbation according to the temporary random number generated by the true random number generator and the two current state variables of the lightweight two-dimensional composite chaotic system to obtain a new initial value of the m-sequence nonlinear perturbation; generate a random perturbation value, add the random perturbation value to the coupling coefficient of the tent mapping function in the lightweight two-dimensional composite chaotic system to obtain a new coupling coefficient; and perform a perturbation operation on the operating parameters of the lightweight two-dimensional composite chaotic system using the new initial value of the m-sequence nonlinear perturbation and the new coupling coefficient.
[0138] The timed update module 308 is used to obtain the dynamic S-box update cycle of the power IoT terminal, wherein the dynamic S-box update cycle is determined according to the security sensitivity level of the service processed by the power IoT terminal; obtain the runtime of the dynamic S-box after the last update is completed; if it is detected that the runtime of the dynamic S-box after the last update is completed meets the dynamic S-box update cycle, and the power IoT terminal is currently in a service idle state, then the dynamic S-box update operation is performed to generate a new dynamic S-box and a masked S-box table corresponding to the new dynamic S-box.
[0139] The event-triggered update module 309 is used to detect the operating status of the power IoT terminal. If the detected operating status of the power IoT terminal belongs to a critical event, a dynamic S-box update operation is performed to generate a new dynamic S-box and a masked S-box table corresponding to the new dynamic S-box. The critical event includes any one of the following: terminal restart or power-on event, high-sensitivity service encrypted communication completion event, and security attack behavior detection event. When the critical event is a terminal restart or power-on event, the dynamic S-box update operation includes calling the true random number generator to reset the initial seed.
[0140] This application provides an apparatus that, compared to existing technologies, uses a random number generated by a true random number generator from a power Internet of Things (IoT) terminal as an initial seed to construct a lightweight two-dimensional composite chaotic system. Based on this system, a chaotic master sequence is iteratively generated. The system employs bitwise XOR and other integer operations to replace the massive floating-point calculations of traditional high-dimensional chaos. A lightweight multi-dimensional entropy evaluation is performed on the chaotic master sequence to obtain a comprehensive entropy value. The range of the comprehensive entropy value is detected, enabling proactive sensing of chaotic randomness decay and automatic reset of the entropy source, fundamentally preventing safety hazards caused by the deterioration of pseudo-random number quality. When the range of the comprehensive entropy value is detected as a dangerous range, a new random number generated by the true random number generator is used as a new initial seed to reset the lightweight two-dimensional composite chaotic system. A new chaotic master sequence is generated based on the reset lightweight two-dimensional composite chaotic system. Based on the new chaotic master sequence... The main sequence sequentially performs a first round of full sequence permutation and a second round of nonlinear byte perturbation on the initial S-box state sequence, followed by bijective verification and correction to generate a dynamic S-box. The S-box changes from fixed to dynamic and unpredictable; its internal replacement rules completely change after each update, rendering traditional differential attacks and linear attacks that rely on fixed S-box patterns completely ineffective. Masked random numbers are generated based on the reset lightweight two-dimensional composite chaotic system. A masked S-box table is pre-computed using masked random numbers and the dynamic S-box. Through integrated masking technology, it is ensured that the real sensitive data is always masked by random numbers during the encryption operation, thereby eliminating power leakage due to data dependencies and providing resistance to first-order power analysis. The masked S-box table is adapted and integrated into the national cryptographic block encryption algorithm of the power IoT terminal, replacing the running masked S-box table without modifying the algorithm core, facilitating rapid deployment and upgrades in the existing power IoT system.
[0141] It should be noted that other corresponding descriptions of the functional units involved in the lightweight S-box implementation device based on dynamic updating of chaotic sequences provided in this application embodiment can be found in the following references. Figure 1 and Figure 2 The corresponding description in [the document] will not be repeated here.
[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0143] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0144] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
[0145] In an exemplary embodiment, see Figure 5 The invention also provides a computer device including a bus, a processor, a memory, and a communication interface. It may also include an input / output interface and a display device, wherein the various functional units can communicate with each other via the bus. The memory stores computer programs, and the processor executes the programs stored in the memory, performing the lightweight S-box implementation method based on chaotic sequence dynamic updates described in the above embodiments. The memory is divided into four layers from top to bottom: the top layer consists of application software modules directly addressing functional requirements; the second layer is the application programming interface (API) providing the application layer with an interface to call underlying functions; the third layer is middleware providing general services and connecting software components at the upper and lower layers; and the bottom layer is the kernel, the foundational core of the software system, responsible for underlying functions such as hardware resource management and process scheduling.
[0146] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the lightweight S-box implementation method based on dynamic updating of chaotic sequences.
[0147] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented in hardware or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0148] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application.
[0149] Those skilled in the art will understand that the modules in the apparatus of the implementation scenario can be distributed within the apparatus of the implementation scenario as described, or they can be located in one or more apparatuses different from this implementation scenario, with corresponding changes. The modules of the above-described implementation scenario can be combined into one module, or they can be further divided into multiple sub-modules.
[0150] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of the implementation scenario.
[0151] The above disclosures are only a few specific implementation scenarios of this application. However, this application is not limited to these. Any variations that can be conceived by those skilled in the art should fall within the protection scope of this application.
Claims
1. A lightweight S-box implementation method based on chaotic sequence dynamic update, characterized in that, include: A lightweight two-dimensional composite chaotic system is constructed by using a random number generated by a true random number generator of a power Internet of Things terminal as an initial seed, and a chaotic master sequence is iteratively generated based on the lightweight two-dimensional composite chaotic system. A lightweight multi-dimensional entropy value evaluation is performed on the chaotic master sequence to obtain a comprehensive entropy value, and the interval in which the comprehensive entropy value is located is detected. When the interval in which the comprehensive entropy value is located is detected to be a dangerous interval, a new random number generated by the true random number generator is obtained as a new initial seed, the lightweight two-dimensional composite chaotic system is reset, and a new chaotic master sequence is generated based on the reset lightweight two-dimensional composite chaotic system. Based on the new chaotic master sequence, the initial S-box state sequence is subjected to the first round of full sequence permutation and the second round of nonlinear byte perturbation, and after bijective verification and correction, a dynamic S-box is generated. Based on the reset lightweight two-dimensional composite chaotic system, a masked random number is generated, and the masked random number and the dynamic S-box are used to pre-compute the masked S-box table; The masked S-box table is adapted and integrated into the national cryptographic block encryption algorithm of the power Internet of Things terminal, replacing the running masked S-box table.
2. The method according to claim 1, characterized in that, The random number generated by the true random number generator of the power Internet of Things terminal is used as the initial seed to construct a lightweight two-dimensional composite chaotic system. Based on this lightweight two-dimensional composite chaotic system, a chaotic master sequence is iteratively generated, including: Based on the random numbers generated by the true random number generator, generate two initial state values for the lightweight two-dimensional composite chaotic system, as well as the initial value of the m-sequence nonlinear perturbation of the linear feedback shift register; By integrating the Logistic mapping and the Tent mapping, and introducing the nonlinear perturbation of the m-sequence, the lightweight two-dimensional composite chaotic system is constructed. The two initial state values and the initial value of the m-sequence nonlinear perturbation are input into the lightweight two-dimensional composite chaotic system for iterative calculation to obtain the chaotic master sequence value corresponding to each iteration number. The chaotic master sequence values corresponding to each iteration number are sorted according to the iteration order to generate the chaotic master sequence.
3. The method according to claim 2, characterized in that, The step of inputting the two initial state values and the initial value of the m-sequence nonlinear perturbation into the lightweight two-dimensional composite chaotic system for iterative calculation to obtain the chaotic master sequence value corresponding to each iteration number includes: For the current iteration number, the two state variables corresponding to the current iteration number are input into the lightweight two-dimensional composite chaotic system for calculation to obtain the two state variables corresponding to the next iteration number. in, These are the two state variables corresponding to the next iteration number. These are the two state variables corresponding to the current iteration number. These are the control parameters for the Logistic mapping. For the perturbation coefficients of the Tent mapping, For tent mapping functions, The input value for the tent mapping function is... For bitwise XOR operation, The m-sequence nonlinear perturbation value generated by the linear feedback shift register, when n=0, These are the two initial state values of the lightweight two-dimensional composite chaotic system; Perform numerical transformation operations on the two state variables corresponding to the current iteration number to generate a first chaotic sequence and a second chaotic sequence corresponding to the current iteration number. in, The first chaotic sequence corresponding to the current iteration number. The second chaotic sequence corresponding to the current iteration number. These are the two state variables corresponding to the current iteration number. For modulo operation, This is the floor function; The first chaotic sequence and the second chaotic sequence corresponding to the current iteration number are merged to obtain the chaotic master sequence value corresponding to the current iteration number. in, The value of the chaotic master sequence corresponding to the current iteration number. The first chaotic sequence corresponding to the current iteration number. The second chaotic sequence corresponding to the current iteration number. This is a bitwise XOR operation.
4. The method according to claim 1, characterized in that, The step of performing a lightweight multi-dimensional entropy evaluation on the chaotic master sequence to obtain a comprehensive entropy value, and detecting the interval in which the comprehensive entropy value falls, includes: According to a preset number of sequence values, select the most recently generated chaotic master sequence values from the chaotic master sequence to generate a sample sequence; The Shannon entropy value is obtained by calculating the uniformity of the segment value distribution of the sample sequence. in, The entropy value of Shannon. Let i be the probability of byte value i appearing in the sample sequence; The sequence repeatability of the sample sequence is calculated to obtain a periodicity characteristic score; The comprehensive entropy value is calculated using the Shannon entropy value and the periodicity characteristic score. in, The comprehensive entropy value is... The entropy value of Shannon. Score the periodic characteristics. These are the weighting coefficients. ; The interval in which the comprehensive entropy value is located is detected; If the overall entropy value is detected to be greater than or equal to the first threshold, then the interval in which the overall entropy value is located is determined to be a safe interval; If the overall entropy value is detected to be greater than or equal to the second threshold and less than the first threshold, then the interval in which the overall entropy value is located is determined to be a warning interval; If the overall entropy value is detected to be less than the second threshold, then the interval in which the overall entropy value is located is determined to be a dangerous interval, wherein the first threshold is greater than the second threshold.
5. The method according to claim 1, characterized in that, After detecting the interval in which the comprehensive entropy value lies, the method further includes: When the interval in which the comprehensive entropy value is located is detected to be a warning interval, the temporary random number generated by the true random number generator, the initial value of the m-sequence nonlinear perturbation of the linear feedback shift register, and the two current state variables of the lightweight two-dimensional composite chaotic system are obtained. The initial value of the m-sequence nonlinear perturbation is adjusted based on the temporary random number generated by the true random number generator and the two current state variables of the lightweight two-dimensional composite chaotic system to obtain a new initial value of the m-sequence nonlinear perturbation. A random perturbation value is generated, and the random perturbation value is added to the coupling coefficient of the tent mapping function in the lightweight two-dimensional composite chaotic system to obtain a new coupling coefficient; The operating parameters of the lightweight two-dimensional composite chaotic system are perturbed using the new m-sequence nonlinear perturbation initial value and the new coupling coefficient.
6. The method according to claim 1, characterized in that, Based on the new chaotic master sequence, the initial S-box state sequence is sequentially subjected to a first round of full sequence permutation and a second round of nonlinear byte perturbation, followed by bijective verification and correction to generate a dynamic S-box, including: Generate the initial S-box state sequence, wherein the initial S-box state sequence is a sequence of integers from 0 to 255 arranged in order; Obtain the first N values of the new chaotic master sequence, where N is the capacity of the S-box; Based on the Fisher-Yates shuffle algorithm, the first intermediate sequence is obtained by performing a global random permutation on the initial S-box state sequence using the first N values of the new chaotic master sequence. For each byte in the first intermediate sequence, a nonlinear transformation is performed according to the new chaotic main sequence to obtain the second intermediate sequence. in, This refers to the i-th byte in the second intermediate sequence. This refers to the i-th byte in the first intermediate sequence. This refers to the (i+256th) byte in the new chaotic master sequence. This refers to the (i+512)th byte in the new chaotic master sequence. For modulo operation, This is a bitwise XOR operation; Perform byte value duplication detection on each byte in the second intermediate sequence; If the detection determines that the byte is a duplicate byte value, then a random value is generated using the chaotic master sequence, and the duplicate byte value is replaced by the random value. By traversing the second intermediate sequence through the byte value repetition detection, the dynamic S-box is obtained, and each byte value in the dynamic S-box is unique.
7. The method according to claim 1, characterized in that, The process of generating masked random numbers based on the reset lightweight two-dimensional composite chaotic system, and using the masked random numbers and the dynamic S-box pre-computation of the masked S-box table, includes: Obtain the two current state variables of the reset lightweight two-dimensional composite chaotic system, input the two current state variables of the reset lightweight two-dimensional composite chaotic system into the reset lightweight two-dimensional composite chaotic system, continue to iterate and generate the main chaotic sequence, and extract the mask random number from the main chaotic sequence generated by the continued iteration. The dynamic S-box is pre-calculated based on the mask random number to generate the masked S-box table. in, For the masked S-box table, For the dynamic S-box, For the mask, a random number is generated. This is a bitwise XOR operation.
8. The method according to claim 1, characterized in that, The method further includes: The dynamic S-box update cycle of the power Internet of Things terminal is obtained, wherein the dynamic S-box update cycle is determined according to the security sensitivity level of the service processed by the power Internet of Things terminal. Get the runtime of the last update of the dynamic S-box; If the runtime after the last update of the dynamic S-box is detected to meet the dynamic S-box update cycle, and the power IoT terminal is currently in an idle state, then the dynamic S-box update operation is performed to generate a new dynamic S-box and a masked S-box table corresponding to the new dynamic S-box.
9. The method according to claim 1, characterized in that, The method further includes: Detect the operating status of the power Internet of Things terminal; If the operating status of the power IoT terminal is detected to be a critical event, a dynamic S-box update operation is performed to generate a new dynamic S-box and a masked S-box table corresponding to the new dynamic S-box. The critical event includes any one of the following: terminal restart or power-on event, high-sensitivity service encrypted communication completion event, and security attack behavior detection event. When the critical event is a terminal restart or power-on event, the dynamic S-box update operation includes calling the true random number generator to reset the initial seed.
10. A lightweight S-box implementation device based on dynamic updating of chaotic sequences, characterized in that, include: A lightweight chaotic system generation module is used to obtain random numbers generated by a true random number generator of a power Internet of Things terminal as an initial seed, construct a lightweight two-dimensional composite chaotic system, and iteratively generate a chaotic master sequence based on the lightweight two-dimensional composite chaotic system. The sequence health monitoring module is used to perform lightweight multi-dimensional entropy value evaluation on the chaotic main sequence to obtain a comprehensive entropy value, and to detect the interval in which the comprehensive entropy value is located. An adaptive update decision module is used to obtain a new random number generated by the true random number generator as a new initial seed when the interval in which the comprehensive entropy value is detected to be a dangerous interval, reset the lightweight two-dimensional composite chaotic system, and generate a new chaotic master sequence based on the reset lightweight two-dimensional composite chaotic system. The dynamic S-box generation module is used to perform a first round of full sequence permutation and a second round of nonlinear byte perturbation on the initial S-box state sequence based on the new chaotic master sequence, and generate a dynamic S-box after bijective verification and correction. The side-channel mask protection module is used to generate a mask random number based on the reset lightweight two-dimensional composite chaotic system, and to pre-compute the masked S-box table using the mask random number and the dynamic S-box. The national cryptographic algorithm adaptation and integration module is used to adapt and integrate the masked S-box table into the national cryptographic block encryption algorithm of the power Internet of Things terminal, replacing the masked S-box table in operation.
Citation Information
Patent Citations
Dynamic S box generation method and test system based on spatiotemporal chaotic system
CN119602926A
Market supervision data security protection method and system based on dynamic encryption strategy
CN120223430A
Dynamic S-box and cross-channel diffusion image encryption method based on six-dimensional hyper-chaos driving
CN121262325A
Low-overhead anti-power analysis AES algorithm mask protection method
CN121396428A