Smart card protection method, apparatus, device, and program product

By performing computational energy budgeting and nonlinear modulation on smart cards, spurious computational sequences are generated, solving the problem of smart cards resisting energy analysis attacks and achieving a balance between high security and high efficiency.

CN122490516APending Publication Date: 2026-07-31INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing smart card protection technologies are insufficient to effectively resist power analysis attacks, which attackers can use to obtain keys or computational data.

Method used

By implementing computational energy budgeting in smart cards, fake computational sequences are generated, and nonlinear functions are used to mix real and fake computational energy data, disrupting energy patterns and increasing the difficulty of attacks.

Benefits of technology

It enhances the smart card's protection against advanced side-channel attacks while maintaining high computing efficiency, achieving a balance between high security and high efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122490516A_ABST
    Figure CN122490516A_ABST
Patent Text Reader

Abstract

This invention discloses a smart card protection method, device, equipment, and program product, relating to the field of financial technology, specifically the field of information security. The method includes: upon receiving a current encryption / decryption task from a smart card, determining the current computing power budget and its proportion based on the current computational task, current environmental parameters, and historical data corresponding to the current computational task; generating a current spoofed computational sequence based on the current computing power budget and its proportion; executing the current computational task to obtain current real computing power data, and simultaneously executing the current spoofed computational sequence to obtain current spoofed computing power data; and using a nonlinear function to mix the current real computing power data and the current spoofed computing power data, outputting the current computing power data. The technical solution of this invention can effectively resist power analysis attacks and achieves smart card security protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology, specifically to the field of information security, and particularly to a smart card protection method, device, equipment, and program product. Background Technology

[0002] With the rapid development of computer and communication technologies, smart cards are widely used in all aspects of life and have become an important part of people's lives, studies, and work. The cryptographic chip of a smart card stores the key information of the smart card owner. If lost or maliciously attacked, it may cause losses to the smart card owner.

[0003] In practical applications, because encryption and decryption operations are accompanied by a clear energy consumption pattern, attackers can obtain the energy information of the device during operation through energy analysis, and then deduce the internal keys or computational data. Currently, most smart card protection technologies mainly use side-channel interference methods such as adding spoofing operations, increasing random delays, or injecting fixed noise into encryption and decryption operations. However, because the perturbation methods are fixed or the perturbation signals can be deconstructed by statistical analysis methods, these techniques are difficult to effectively resist energy analysis attacks. Summary of the Invention

[0004] This invention provides a smart card protection method, device, equipment, and program product that can effectively resist power analysis attacks and achieve smart card security protection.

[0005] According to one aspect of the present invention, a smart card protection method is provided, the method comprising:

[0006] Upon receiving the current encryption / decryption task from the smart card, the current computing energy budget and the current computing energy budget ratio are determined based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task.

[0007] Based on the current computing energy budget and the current computing energy budget ratio, generate the current dummy computing sequence;

[0008] Execute the current computation task to obtain the current real computation energy data, and simultaneously execute the current spurious computation sequence to obtain the current spurious computation energy data;

[0009] A nonlinear function is used to mix the current real computing energy data and the current fake computing energy data, and the current computing energy data is output.

[0010] According to another aspect of the present invention, a smart card protection device is provided, the device comprising:

[0011] The current computing energy budget module is used to determine the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task when receiving the current encryption / decryption task of the smart card.

[0012] The current spurious computation sequence generation module is used to generate the current spurious computation sequence based on the current computational energy budget and the current computational energy budget ratio;

[0013] The current encryption / decryption task execution module is used to execute the current computing task, obtain the current real computing energy data, and simultaneously execute the current fake computing sequence to obtain the current fake computing energy data.

[0014] The current computing energy data output module is used to mix the current real computing energy data and the current fake computing energy data using a nonlinear function, and output the current computing energy data.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] At least one processor; and

[0017] A memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the smart card protection method according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the smart card protection method according to any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the smart card protection method according to any embodiment of the present invention.

[0021] The technical solution of this invention, through the current computing task, current environmental parameters, and historical data corresponding to the current computing task included in the current encryption / decryption task, performs computing energy budget planning for the current computing task of each encryption / decryption operation, determines the current computing energy budget and the current computing energy budget ratio, and allocates the current computing energy budget of each encryption / decryption operation according to the pre-planned current computing energy budget ratio. The real computing energy is split into real and spoof parts according to a fixed ratio, and the computing energy data of the real and spoof computing parts are nonlinearly modulated to obtain the current computing energy data. By using nonlinear modulation to mix the real and spoof computing energy data, the overall energy signal exhibits nonlinear, dynamic, and unreproducible characteristics, disrupting the energy pattern, increasing the difficulty of energy analysis attacks by attackers, and enhancing the protection capability against advanced side-channel attacks. At the same time, it also makes the energy allocation of each operation controllable, so that spoof computing does not affect the overall computing speed too much, achieving a balance between high security and high computing efficiency.

[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of a smart card protection method provided according to Embodiment 1 of the present invention;

[0025] Figure 2 This is a flowchart of a smart card protection method provided according to Embodiment 2 of the present invention;

[0026] Figure 3 This is a schematic diagram of the structure of a smart card protection device according to Embodiment 2 of the present invention;

[0027] Figure 4 This is a flowchart of a smart card protection method provided according to Embodiment 2 of the present invention;

[0028] Figure 5 This is a schematic diagram of the structure of a smart card protection device according to Embodiment 3 of the present invention;

[0029] Figure 6This is a schematic diagram of the structure of an electronic device that implements the smart card protection method of this invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] Example 1

[0033] Figure 1 This is a flowchart illustrating a smart card protection method according to Embodiment 1 of the present invention. This embodiment of the invention is applicable to situations involving energy analysis attack protection of smart cards. The method can be executed by a smart card protection device, which can be implemented in hardware and / or software. This smart card protection device can be configured in an electronic device that carries smart card protection functions, such as a client or server.

[0034] See Figure 1 The smart card protection method shown includes:

[0035] S101. Upon receiving the current encryption / decryption task from the smart card, determine the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task.

[0036] The current encryption / decryption task can be the encryption / decryption task of the smart card chip at the current moment. The current encryption / decryption task includes at least one current computation task. The current computation task can be a single encryption / decryption operation performed at the current moment. The current environmental parameters can be the environmental parameters of the smart card when executing the current computation task. For example, the current environmental parameters can include chip temperature and power supply voltage fluctuations. The historical data corresponding to the current computation task can be used to characterize the computational energy consumption of historical computation tasks of the same type as the current computation task. For example, the historical data corresponding to the current computation task can be historical baseline energy consumption. The current computational energy budget can be the energy expected to be consumed when executing the current computation task. The current computational energy budget ratio can be the ratio between the current actual computational energy budget and the current spurious computational energy budget in the current computational energy budget.

[0037] Specifically, a computing energy budget planning model can be pre-trained. Upon receiving the current encryption / decryption task from the smart card, the current computing task, current environmental parameters, and historical data corresponding to the current computing task can be input into the pre-trained computing energy budget planning model, which then outputs the current computing energy budget and its proportion.

[0038] In an optional embodiment of the present invention, determining the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environment parameters, and historical data corresponding to the current computing task included in the current encryption / decryption task includes: obtaining a preset computing energy budget ratio when the current encryption / decryption task is the first encryption / decryption task; determining the initial data volume coefficient and the initial computing priority coefficient based on the initial computing task included in the first encryption / decryption task; determining the initial environment coefficient based on the initial environment parameters; determining the historical baseline energy consumption of the initial computing task based on the historical data corresponding to the initial computing task; and determining the initial computing energy budget based on the initial data volume coefficient, the initial computing priority coefficient, the initial environment coefficient, and the historical baseline energy consumption.

[0039] The first encryption / decryption task can be the first encryption / decryption task executed by this device. The first computation task can be the computational task included in the first encryption task. The preset computational energy budget ratio can be the ratio between the first real computational energy budget and the first dummy computational energy budget within the preset first computational energy budget. The first data volume coefficient can be used to characterize the influence of the amount of computational data in the first computational energy budget. Optionally, the first data volume coefficient can correspond to the block length or key length of the first computation task. The first computation priority coefficient can be used to characterize the influence of the computational priority in the first computational energy budget. The first computation priority coefficient corresponds to the computational priority of the first computation task. For example, the computational priority can include security priority or performance priority. Accordingly, the first computation priority coefficient for security priority can be greater than the first computation priority coefficient for performance priority. The first environment coefficient can be used to characterize the influence of environmental parameters in the first computational energy budget. The first environment coefficient can correspond to the first environmental parameters of the first computation task. The historical baseline energy consumption of the first computation task can be the historical computational energy consumption of the first computation task. Optionally, the historical baseline energy consumption of the initial computation task can be the average historical computation energy consumption of historical computation tasks of the same type as the initial computation task. The initial computation energy budget can be an estimate of the computation energy consumed in executing the initial computation task.

[0040] Specifically, when the current encryption / decryption task is the first encryption / decryption task, a preset computing energy budget ratio can be obtained. Based on the block length or key length of the first computing tasks included in the first encryption / decryption task, the corresponding initial data volume coefficient is determined. Based on the computing priority of the first computing tasks included in the first encryption / decryption task, the corresponding initial computing priority coefficient is determined. Based on the initial environment parameters, the corresponding initial environment coefficient is determined. Based on the historical data corresponding to the first computing task, the average historical computing energy consumption of historical computing tasks of the same type as the first computing task is determined, thus determining the historical baseline energy consumption of the first computing task. The product of the initial data volume coefficient, the initial computing priority coefficient, the initial environment coefficient, and the historical baseline energy consumption is calculated to determine the initial computing energy budget for the first computing task.

[0041] This solution determines the initial data volume coefficient, initial computation priority coefficient, initial environment coefficient, and historical baseline energy consumption based on the initial encryption / decryption task, initial environment parameters, and corresponding historical data during the initial encryption / decryption task. This allows for the rapid determination of the initial computational energy budget for the initial encryption / decryption task, improving the efficiency of computational energy budget planning for the initial encryption / decryption task.

[0042] In an optional embodiment of the present invention, the current computing energy budget and the current computing energy budget ratio are planned based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task. This includes: when the current encryption / decryption task is not the first encryption / decryption task, a pre-trained computing energy budget planning model is used to plan the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task; wherein, the training samples of the computing energy budget planning model include historical computing tasks, historical environmental parameters, historical data corresponding to historical computing tasks, historical computing energy consumption, and historical actual computing energy ratio.

[0043] Non-first encryption / decryption tasks can be encryption / decryption tasks that are not executed for the first time on this device. In fact, non-first encryption / decryption tasks can be subsequent encryption / decryption tasks following the first execution on this device. A computing energy budget planning model can be used to plan the computing energy budget for the current computing task. The input data for the computing energy budget planning model can be the current computing task, current environmental parameters, and historical data corresponding to the current computing task. The output of the computing energy budget planning model can be the current computing energy budget and the current computing energy budget ratio. The training samples for the computing energy budget planning model include historical computing tasks, historical environmental parameters, historical data corresponding to historical computing tasks, historical computing energy consumption, and the actual historical computing energy ratio. Historical computing tasks can be encryption / decryption tasks performed on the smart card chip at a historical time. Historical computing tasks include at least one historical computing task. A historical computing task can be a single encryption / decryption operation performed at a historical time. Historical environmental parameters can be the environmental parameters of the smart card when executing the historical computing task. For example, historical environmental parameters can include chip temperature and power supply voltage fluctuations. Historical data corresponding to historical computing tasks can be used to characterize the computing energy consumption of similar historical computing tasks. Historical computational energy consumption refers to the actual energy consumed in executing historical computational tasks. The actual proportion of historical computational energy consumption can be the ratio between the actual historical computational energy consumption and the spurious historical computational energy consumption when executing historical computational tasks and historical spurious computational sequences.

[0044] Specifically, when receiving the current encryption / decryption task from the smart card, if the current encryption / decryption task is not the first encryption / decryption task, a pre-trained computing energy budget planning model is used. The current computing task, current environmental parameters, and historical data corresponding to the current computing task are input, and the current computing energy budget and the current computing energy budget ratio are output.

[0045] This solution employs a pre-trained computational energy budget planning model to perform computational energy budget planning for the current computational task of non-first-time encryption / decryption tasks. The introduction of this computational energy budget planning model can improve the efficiency and accuracy of computational energy budget planning for the current computational task of non-first-time encryption / decryption tasks.

[0046] S102. Generate the current spurious computation sequence based on the current computational energy budget and the current computational energy budget ratio.

[0047] The current spoof sequence can be a set of executable spoof instructions that are executed in parallel by the current computation task. The current spoof sequence can be used to obfuscate the actual execution of the current computation task.

[0048] Specifically, the current spurious computing energy budget is calculated based on the current computing energy budget and its proportion. A spurious computing template corresponding to the current spurious computing energy budget can be selected. Based on the spurious computing template, a spurious computing sequence is directly generated. The spurious computing template can be a pre-defined set of spurious computing instructions. For example, the spurious computing template may include a pre-defined spurious computing energy budget and a corresponding spurious computing sequence. The spurious computing template can be directly filtered based on the spurious computing energy budget to determine the appropriate spurious computing sequence.

[0049] In an optional embodiment of the present invention, generating a current spoofing sequence based on the current computing energy budget and the current computing energy budget ratio includes: calculating the current spoofing computing energy budget based on the current computing energy budget and the current computing energy budget ratio; obtaining a random seed and selecting a current spoofing template based on the random seed; adjusting the current spoofing instructions in the current spoofing template based on the current spoofing computing energy budget so that the total energy consumption of the current spoofing instructions in the current spoofing template reaches the current spoofing computing energy budget, and generating the current spoofing sequence.

[0050] The current dummy computation energy budget can be the estimated energy consumption of dummy computations executed in parallel with the current computation task. Optionally, the dummy computation template can include a random seed, a pre-defined dummy computation energy budget, and a corresponding dummy computation sequence. The random seed can be used to filter the current dummy computation template. Filtering the dummy computation template based on the random seed and then generating the dummy computation sequence can enhance the randomness of both the current dummy computation template and the current dummy computation sequence.

[0051] Specifically, based on the current computing energy budget ratio, the proportion of the current spurious computing energy budget within the current computing energy budget can be determined. The current spurious computing energy budget is obtained by multiplying this proportion by the current computing energy budget. A random number generator is used to generate a random seed. Based on the random seed, a corresponding current spurious computing template is selected. The current spurious computing instructions contained in the current spurious computing template can be adjusted so that the total energy consumption of these instructions reaches the current spurious computing energy budget, thus generating the current spurious computing sequence.

[0052] This scheme selects the current spoofing template using a random seed and adjusts the current spoofing instructions in the current spoofing template based on the current spoofing energy budget to generate the current spoofing sequence. This increases the randomness of the generated current spoofing sequence, thereby increasing the randomness of the energy patterns in the current computing energy data and improving the smart card's ability to defend against energy analysis attacks.

[0053] S103. Execute the current computation task, obtain the current real computation energy data, and simultaneously execute the current spurious computation sequence to obtain the current spurious computation energy data.

[0054] The current real computing energy data can be the data on the computing energy consumed when executing the current computing task. This data can be used to characterize the fluctuations in energy consumption during the execution of the current computing task. For example, the current real computing energy data can be a current real computing energy signal. The current spurious computing energy data can be the data on the computing energy consumed when executing the current spurious computing sequence. This data can be used to characterize the fluctuations in energy consumption during the execution of the current spurious computing sequence. For example, the current spurious computing energy data can be a current spurious computing energy signal. For example, the cryptographic algorithm of the current computing task can be the Advanced Encryption Standard (AES). The current spurious computing instructions in the current spurious computing sequence can include fake substitution box lookup operations or round key addition with random numbers, etc. The results of the current spurious computing instructions contained in the current spurious computing sequence have no impact on the actual computing results of the current encryption / decryption task and can be discarded.

[0055] Specifically, it can execute the current computational task and collect real-time computational energy data. Simultaneously, it can execute the current dummy computational sequence and collect real-time dummy computational energy data.

[0056] S104. Using a nonlinear function, the current real computing energy data and the current spurious computing energy data are mixed, and the current computing energy data is output.

[0057] Nonlinear functions can be used to nonlinearly modulate the current real computing energy data and the current spoof computing energy data. Nonlinear functions can also induce chaotic characteristics in the generated current computing energy data. This can improve the smart card's protection against energy analysis attacks. For example, nonlinear functions can include hyperbolic tangent functions, exponential functions, logarithmic functions, or custom piecewise functions. The current computing energy data can be the result of nonlinear modulation of the current real computing energy data and the current spoof computing energy data. Attackers in smart card energy analysis attacks can only detect the nonlinearly modulated current computing energy data.

[0058] Specifically, a nonlinear function can be used to nonlinearly modulate the current real computing energy data and the current spurious computing energy data to obtain the current computing energy data.

[0059] For example, the following formula can be used to represent the process of calculating the operational energy signal using a nonlinear function:

[0060] O(t) = f(R(t), D(t));

[0061] In the formula, O(t) is the operational energy signal of the output after nonlinear modulation; f(·) is a nonlinear function; R(t) is the real operational energy signal; and D(t) is the spurious operational energy signal.

[0062] For example, the following formula can be used to represent a nonlinear function:

[0063] f(R(t),D(t))=(α·R(t)+β·D(t)) k ;

[0064] In the formula, f(·) is a nonlinear function; α, β and k are nonlinear function parameters; R(t) is the real computational energy signal; and D(t) is the spurious computational energy signal.

[0065] For example, the following formula can be used to represent a nonlinear function:

[0066] f(R(t),D(t))=tan(k·(α·R(t)+β·D(t)));

[0067] In the formula, f(·) is a nonlinear function; α, β and k are nonlinear function parameters; R(t) is the real computational energy signal; and D(t) is the spurious computational energy signal.

[0068] The technical solution of this invention, through the current computing task, current environmental parameters, and historical data corresponding to the current computing task included in the current encryption / decryption task, performs computing energy budget planning for the current computing task of each encryption / decryption operation, determines the current computing energy budget and the current computing energy budget ratio, and allocates the current computing energy budget of each encryption / decryption operation according to the pre-planned current computing energy budget ratio. The real computing energy is split into real and spoof parts according to a fixed ratio, and the computing energy data of the real and spoof computing parts are nonlinearly modulated to obtain the current computing energy data. By using nonlinear modulation to mix the real and spoof computing energy data, the overall energy signal exhibits nonlinear, dynamic, and unreproducible characteristics, disrupting the energy pattern, increasing the difficulty of energy analysis attacks by attackers, and enhancing the protection capability against advanced side-channel attacks. At the same time, it also makes the energy allocation of each operation controllable, so that spoof computing does not affect the overall computing speed too much, achieving a balance between high security and high computing efficiency.

[0069] In an optional embodiment of the present invention, after using a nonlinear function to mix the current real computing energy data and the current spurious computing energy data and output the current computing energy data, the method further includes: obtaining the current real energy consumption, the current spurious energy consumption, and the current computing energy consumption for multiple current computing cycles; calculating the current correlation coefficient between each current computing cycle based on the current real energy consumption, the current spurious energy consumption, the current computing energy consumption, the current real energy budget, the current spurious energy budget, and the current computing energy budget for each current computing cycle; and adjusting the nonlinear function or the nonlinear function parameters when the current correlation coefficient is greater than or equal to a preset correlation coefficient threshold.

[0070] The current computation cycle can be the execution cycle of the current computation task. The current actual energy consumption can be the computational energy consumed in executing the current computation task. The current spurious energy consumption can be the computational energy consumed by the current spurious computation sequence corresponding to the current computation task. The current computational energy consumption can be the computational energy consumed in executing the current computation task. The current correlation coefficient between current computation cycles can be used to characterize the regularity of the fluctuations in current computational energy consumption between each computation cycle. The higher the current correlation coefficient between current computation cycles, the more regular the fluctuations in current computational energy consumption between each computation cycle tend to be; the lower the current correlation coefficient between current computation cycles, the more chaotic the fluctuations in current computational energy consumption between each computation cycle tend to be. A preset correlation coefficient threshold can be used to measure the regularity of the fluctuations in current computational energy consumption between each computation cycle. The preset correlation coefficient threshold can be preset and adjusted by technical personnel. For example, the preset correlation coefficient threshold can be 0.8.

[0071] Specifically, the process involves obtaining the current actual energy consumption, current spurious energy consumption, and current computational energy consumption for multiple current computation cycles. It calculates the ratio between the current actual energy consumption and the current actual energy budget for each current computation cycle, the ratio between the current spurious energy consumption and the current spurious energy budget for each current computation cycle, and the ratio between the current computational energy consumption and the current computational energy budget for each current computation cycle. Based on these ratios, the current correlation coefficients between the current computation cycles are calculated. These correlation coefficients are then compared to a preset correlation coefficient threshold. If the current correlation coefficient is greater than or equal to the preset threshold, the nonlinear function is adjusted, or the parameters of the original nonlinear function are adjusted. If all current correlation coefficients are less than the preset threshold, no adjustment is made.

[0072] This solution calculates the current correlation coefficient between current computing cycles based on the current real energy consumption, current spurious energy consumption, and current computing energy consumption of multiple current computing cycles. Based on the current correlation coefficient of each current computing cycle, the nonlinear function or its parameters are adjusted to ensure the high randomness of the current computing energy data for each current computing cycle, thereby further improving the smart card's ability to defend against energy analysis attacks.

[0073] Example 2

[0074] Figure 2 This is a flowchart of a smart card protection method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment further adds the following steps after "using a nonlinear function to mix the current real computing energy data and the current fake computing energy data, and outputting the current computing energy data": "obtaining the current average encryption / decryption energy consumption of the current encryption / decryption cycle; detecting the current encryption / decryption energy deviation between the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget of the current encryption / decryption cycle; and adjusting the current computing energy budget parameters, the current computing energy budget ratio, and / or the current nonlinear function parameters when the current encryption / decryption energy deviation is greater than or equal to a preset encryption / decryption energy deviation." This further improves the accuracy of the smart card's computing energy budget planning and enhances the smart card's protection against energy analysis attacks. It should be noted that parts not detailed in this embodiment can be found in the descriptions of other embodiments.

[0075] See Figure 2 The smart card protection method shown includes:

[0076] S201. Upon receiving the current encryption / decryption task from the smart card, determine the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task.

[0077] S202. Generate the current spurious computation sequence based on the current computational energy budget and the current computational energy budget ratio.

[0078] S203. Generate the current spurious computation sequence based on the current computational energy budget and the current computational energy budget ratio.

[0079] S204. Using a nonlinear function, the current real computing energy data and the current spurious computing energy data are mixed, and the current computing energy data is output.

[0080] S205. Obtain the average energy consumption for encryption and decryption in the current encryption / decryption cycle.

[0081] The current encryption / decryption cycle can be considered the overall execution cycle of the current encryption / decryption task. The current average encryption / decryption energy consumption can be considered the average of the current computational energy consumption of each current computational task included in the current encryption / decryption task.

[0082] Specifically, it is possible to obtain the current computational energy consumption of the current computational tasks included in the current encryption / decryption cycle. The average energy consumption of each current computation can be calculated to obtain the current average encryption / decryption energy consumption.

[0083] S206. Detect the current encryption / decryption energy deviation between the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget for the current encryption / decryption cycle.

[0084] The current average encryption / decryption energy budget is the average of the current computing energy budgets for all current computational tasks included in the current encryption / decryption cycle. In comparison, both the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget correspond to the current encryption / decryption cycle. However, the current average encryption / decryption energy consumption characterizes the actual computing energy consumption of the current encryption / decryption cycle, while the current average encryption / decryption energy budget characterizes the estimated computing energy consumption of the current encryption / decryption cycle. The current encryption / decryption energy deviation is the difference between the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget. The current encryption / decryption energy deviation can be used to characterize the accuracy of the computing energy budget planning. It can be understood that the larger the current encryption / decryption energy deviation, the lower the accuracy of the computing energy budget planning; the smaller the current encryption / decryption energy deviation, the higher the accuracy of the computing energy budget planning.

[0085] Specifically, the deviation between the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget for the current encryption / decryption cycle can be calculated to obtain the current encryption / decryption energy deviation.

[0086] S207. When the current encryption / decryption energy deviation is greater than or equal to the preset encryption / decryption energy deviation, adjust the current computing energy budget parameter, the current computing energy budget ratio, and / or the current nonlinear function parameter.

[0087] The preset encryption / decryption energy deviation can be used to measure whether adjustments need to be made to the current computing energy budget parameters, the current computing energy budget ratio, and / or the current nonlinear function parameters. The preset encryption / decryption energy deviation can be determined in advance by technical personnel. For example, the preset encryption / decryption energy deviation can be ±20%. The current computing energy budget parameters can be used to adjust the computing energy budget planning. For example, a computing energy budget planning model can be used to plan the computing energy budget for the current computing task; correspondingly, the current computing energy budget parameters can be the model parameters of the computing energy budget planning model. Alternatively, a computing energy budget formula can be used to plan the computing energy budget for the current computing task; correspondingly, the current computing energy budget parameters can include data volume coefficients, computing priority coefficients, and environmental coefficients, etc. Optionally, the current computing energy budget and / or the current computing energy budget ratio can also be adjusted directly. The current computing energy budget ratio can be used to characterize the injection ratio of the current spoof computing sequence in the current encryption / decryption task. The current nonlinear function can be a nonlinear function that nonlinearly modulates the current real computing energy data and the current spoof computing energy data of the current computing task. The current nonlinear function parameters can be the parameters of the current nonlinear function.

[0088] Specifically, the current encryption / decryption energy deviation can be compared with the preset encryption / decryption energy deviation. When the current encryption / decryption energy deviation is greater than or equal to the preset encryption / decryption energy deviation, the current computing energy budget parameters, the current computing energy budget ratio, and / or the current nonlinear function parameters are adjusted.

[0089] In an optional embodiment of the present invention, adjusting the current computing energy budget parameters, the current computing energy budget ratio, and / or the current nonlinear function parameters includes: using a pre-trained computing energy budget parameter adjustment model, and determining the adjusted current computing energy budget parameters, the current computing energy budget ratio, and the current nonlinear function parameters based on the current computing energy data, the current encryption / decryption energy deviation, the current computing energy budget parameters, the current computing energy budget ratio, and the current nonlinear function parameters; wherein, the training samples of the computing energy budget parameter adjustment model include historical computing energy data, historical encryption / decryption energy deviation, historical computing energy budget parameters, historical computing energy budget ratios, historical nonlinear function parameters, and the adjusted historical computing energy budget parameters, historical computing energy budget ratios, and historical nonlinear function parameters.

[0090] The computing power budget parameter adjustment model can be used to adjust the computing power budget parameters, computing power budget ratio, and nonlinear function parameters. The input data for the computing power budget parameter adjustment model includes the current computing power data, the current encryption / decryption power deviation, the current computing power budget parameters, the current computing power budget ratio, and the current nonlinear function parameters. The output results of the computing power budget parameter adjustment model include the adjusted current computing power budget parameters, the current computing power budget ratio, and the current nonlinear function parameters.

[0091] Historical computing energy data can be the nonlinear modulation result of historical real computing energy data and historical spoof computing energy data. Historical encryption / decryption energy deviation is the deviation between historical average encryption / decryption energy consumption and historical average encryption / decryption energy budget. Historical computing energy budget parameters can be used to adjust computing energy budget planning. For example, using a computing energy budget planning model to plan the computing energy budget for historical computing tasks, the corresponding historical computing energy budget parameters can be the model parameters of the computing energy budget planning model. Alternatively, using a computing energy budget formula to plan the computing energy budget for historical computing tasks, the corresponding historical computing energy budget parameters can include data volume coefficients, computing priority coefficients, and environmental coefficients, etc. Optionally, the historical computing energy budget and / or the historical computing energy budget ratio can also be directly adjusted. The historical computing energy budget ratio can be used to characterize the injection ratio of historical spoof computing sequences in historical encryption / decryption tasks. The historical nonlinear function can be a nonlinear function that nonlinearly modulates historical real computing energy data and historical spoof computing energy data for historical computing tasks. The historical nonlinear function parameters can be the parameters of the historical nonlinear function.

[0092] Specifically, a pre-trained computing energy budget parameter adjustment model is used. The inputs are the current computing energy data, the current encryption / decryption energy deviation, the current computing energy budget parameter, the current computing energy budget ratio, and the current nonlinear function parameter. The outputs are the adjusted current computing energy budget parameter, the current computing energy budget ratio, and the current nonlinear function parameter.

[0093] This scheme adopts a computing energy budget parameter adjustment model. Based on the current computing energy data, the current encryption / decryption energy deviation, the current computing energy budget parameters, the current computing energy budget ratio, and the current nonlinear function parameters, it determines the adjusted current computing energy budget parameters, the current computing energy budget ratio, and the current nonlinear function parameters, which further improves the accuracy of computing energy budget planning and can improve the accuracy of subsequent computing energy budgets.

[0094] The technical solution of this invention calculates the current encryption / decryption energy deviation between the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget based on the current average encryption / decryption energy consumption of the current encryption / decryption cycle. Then, it adjusts the current computing energy budget parameters, the current computing energy budget ratio, and / or the current nonlinear function parameters, thereby further improving the accuracy of the computing energy budget planning of the smart card and enhancing the smart card's protection against energy analysis attacks.

[0095] This invention also proposes an encryption / decryption architecture based on energy budgeting and nonlinear modulation, realizing energy budget management, hybrid virtual-real computation, and nonlinear modulation. It is applicable to any block cipher algorithm running within different smart cards. The overall system architecture is mainly divided into two parts: first, the encryption / decryption module, whose main function is to execute encryption and decryption tasks, completing data encryption and decryption; this module is no different from a normal cryptographic chip. Second, the energy budgeting and nonlinear modulation part, including an energy budget management module, a dummy computation sequence generation module, a nonlinear modulation module, an energy data acquisition and preprocessing module, and a software control module. This part determines the dummy energy budget through energy budgeting, monitors energy in real time, and uses a nonlinear modulation algorithm to mix the energy consumption of real computation with that of dummy computation, achieving dynamic perturbation of the energy trajectory. Figure 3 This is a schematic diagram of a smart card protection device according to Embodiment 2 of the present invention.

[0096] The energy budget management module primarily plans the allowable initial computing energy budget for the first encryption / decryption task before it begins, based on the initial computation task, initial environmental parameters, and corresponding historical data. The initial computation task type corresponds to different cryptographic algorithms, block lengths, password lengths, and computation priorities. Computation priorities include those requiring higher security and those requiring higher performance. Initial environmental parameters include chip temperature and power supply voltage fluctuations. Historical data for the initial computation task includes historical baseline energy consumption for different cryptographic algorithms. The preset computing energy ratio can be the ratio between the actual energy budget and the dummy energy budget. This preset ratio can be pre-set by technical personnel. For example, a preset computing energy budget ratio of 7:3 can be understood as allocating 70% of the initial computing energy budget to actual encryption / decryption operations and 30% to dummy operations.

[0097] Specifically, the process involves obtaining the initial encryption / decryption task, its initial environment parameters, and corresponding historical data. Based on the historical average energy consumption of the cryptographic algorithm contained in the historical data, the historical baseline energy consumption of the initial encryption / decryption task is determined. The initial data volume coefficient is determined based on the block length or key length of the initial computation task. The initial computation priority coefficient is determined based on the computation priority of the initial computation task. The initial environment coefficient is determined based on the initial environment parameters of the initial computation task. Using the computational energy budget formula, the product of the historical baseline energy consumption, the initial data volume coefficient, the initial computation priority coefficient, and the initial environment coefficient is calculated to obtain the initial computational energy budget. Finally, a preset computational energy budget ratio is obtained.

[0098] The spoofing sequence generation module utilizes a random number generator to produce a spoofing sequence based on the current computing energy budget. Each generated spoofing sequence differs from the previous one. The current computing energy budget is updated in real-time by a software control module that adjusts the budget based on real-time computing energy data, disrupting the spoofing templates built by traditional energy analysis attackers using repetitive features. The spoofing sequence is a set of executable spoofing instructions. For example, the cryptographic algorithm for the current computing task can be an Advanced Encryption Standard (AES) algorithm. The spoofing instructions in the current spoofing sequence can include fake substitution box lookup operations or round key addition with random numbers. The results of the spoofing instructions within the current spoofing sequence have no impact on the actual results of the current encryption / decryption task and can be discarded. The energy consumption of the spoofing sequences and each spoofing instruction within the spoofing template is pre-defined.

[0099] Specifically, the random seed output by the random number generator is obtained. Based on the current computational energy budget and its proportion for the current computational task, the current dummy computational energy budget is calculated. A current dummy computation template is selected according to the random seed. Based on the current dummy computational energy budget, the current dummy computation instructions in the current dummy computation template are adjusted so that the total energy consumption of all current dummy computation instructions reaches the current dummy computational energy budget, thus generating the current dummy computation sequence.

[0100] The nonlinear modulation module induces chaotic characteristics in the overall chip energy consumption signal (i.e., current computational energy data) of the smart card through nonlinear modulation, thereby increasing the difficulty of side-channel attacks. A set of nonlinear computation circuits can be designed in the hardware implementation, using analog circuit methods to perform nonlinear function calculations. Specifically, the nonlinear functions that can be used include, but are not limited to, hyperbolic tangent functions, exponential functions, logarithmic functions, or custom piecewise functions. Through the nonlinear function, the current spurious computational energy data of the current spurious computation sequence is nonlinearly integrated with the current real computational energy data of the real computation, reducing the correlation between the overall chip energy consumption of the smart card and encryption / decryption operations, thus improving the smart card's protection against energy analysis attacks. The parameters of the nonlinear function can be adjusted. The input data of the nonlinear computation circuit and the corresponding nonlinear modulation unit are the current real computational energy signal and the current spurious computational energy signal; the output is the nonlinearly modulated current computational energy signal. Attackers performing smart card energy analysis attacks can only detect the nonlinearly modulated current computational energy signal.

[0101] For example, the following formula can be used to represent the process of calculating the operational energy signal using a nonlinear function:

[0102] O(t) = f(R(t), D(t));

[0103] In the formula, O(t) is the operational energy signal of the output after nonlinear modulation; f(·) is a nonlinear function; R(t) is the real operational energy signal; and D(t) is the spurious operational energy signal.

[0104] For example, the following formula can be used to represent a nonlinear function:

[0105] f(R(t),D(t))=(α·R(t)+β·D(t)) k ;

[0106] In the formula, f(·) is a nonlinear function; α, β and k are nonlinear function parameters; R(t) is the real computational energy signal; and D(t) is the spurious computational energy signal.

[0107] For example, the following formula can be used to represent a nonlinear function:

[0108] f(R(t),D(t))=tan(k·(α·R(t)+β·D(t)));

[0109] In the formula, f(·) is a nonlinear function; α, β and k are nonlinear function parameters; R(t) is the real computational energy signal; and D(t) is the spurious computational energy signal.

[0110] The energy data acquisition and preprocessing module includes a multi-channel energy data acquisition unit and an energy data preprocessing unit. The multi-channel energy data acquisition unit sets up energy acquisition interfaces at key locations such as the encryption / decryption module, the spurious budget sequence generation module, and the nonlinear modulation module to continuously acquire real computational energy signals, spurious computational energy signals, and computational energy signals output by nonlinear modulation. The energy data preprocessing unit filters, reduces noise, and normalizes the acquired real, spurious, and nonlinear modulation computational energy signals, providing basic data for the software control module.

[0111] The software control module is used for comprehensive regulation of various modules and units at the hardware level, mainly including the following adaptive optimization, parameter recording, and intelligent learning functions. Among them, the adaptive optimization function analyzes and adjusts the current computing energy budget parameters, the current computing energy budget ratio, and the nonlinear function parameters based on the real computing energy signals, spurious computing energy signals, and nonlinear modulation output signals collected in real time by the multi-channel energy data acquisition unit. For example, when a deviation is detected between the real-time collected current computing energy consumption and the predetermined current computing energy budget (e.g., a deviation of ±20%), the current computing energy budget parameters, the current computing energy budget ratio, and the nonlinear function parameters are dynamically adjusted. For example, when the fluctuation of the current computing energy consumption detected in real time tends to be regularized, the nonlinear function parameter of the modulation nonlinear function is increased, making the current computing energy signal curve more chaotic. For instance, correlation analysis is performed on the current computing energy signals output from several consecutive current computing cycles. If the current correlation coefficient between each current computing cycle reaches a preset correlation coefficient threshold (e.g., 0.8), then it is determined that the fluctuation of the current computing energy consumption tends to be regularized. In this case, if the nonlinear function is an exponential function, i.e., f(R(t),D(t))=(α·R(t)+β·D(t)) kTherefore, the correlation between the output current computational energy signal and the current actual computational energy signal can be reduced by decreasing α and increasing β and k. Specifically, in implementing parameter recording and intelligent learning functions, the system has a built-in storage unit to record the current computational energy budget parameters, current computational energy data, and adjustment records of nonlinear function parameters for each encryption / decryption operation. Through data analysis and machine learning methods, it continuously learns from the adjustment records of the current computational energy budget parameters, current computational energy data, and nonlinear function parameters for each encryption / decryption operation, improving the security and efficiency of subsequent computational energy budgeting.

[0112] Figure 4 This is a flowchart of a smart card protection method provided by the present invention. Based on the above embodiments, Figure 4 This is a preferred embodiment of a smart card protection method provided by the present invention. See also Figure 4 The smart card protection method shown includes:

[0113] S401, System Initialization.

[0114] First, a power-on self-test is performed, sequentially starting and self-testing each module and unit to confirm that the spurious computation sequence generation module, nonlinear modulation module, and energy budget management module are all in normal working order. Then, initial parameters are loaded, such as the preset computational energy budget ratio and nonlinear function parameters. Internally, a bus connection is established, enabling secure communication.

[0115] S402, Encryption / Decryption Task Launch and Computational Energy Budget Planning.

[0116] Upon receiving a current encryption / decryption task, the energy budget management module plans the current energy budget (i.e., the current computing energy budget) based on the current computing task, current environment parameters, and historical data corresponding to the current computing task. Then, based on the proportion of the current computing energy budget, it allocates the real computing energy budget and the dummy computing energy budget. The current computing energy budget proportion is the ratio between the current real computing energy budget and the current dummy computing energy budget within the current computing energy budget.

[0117] S403, Simultaneously perform encryption / decryption operations and spoofing operations.

[0118] The encryption / decryption module encrypts or decrypts real data, generating a real energy trajectory, i.e., the current real computing energy data. Simultaneously, a spurious computing sequence generation module is started, generating a current spurious computing sequence based on the current computing energy budget ratio. This spurious sequence is executed in parallel with the current real computing task, generating current spurious computing energy data. The nonlinear modulation module receives the current real computing energy data and the current spurious computing energy data, and outputs a nonlinearly modulated mixed current computing energy data.

[0119] S404, Real-time energy data acquisition and data preprocessing.

[0120] The multi-channel energy data acquisition unit continuously samples the real-time output current computing energy signal and collects the current real computing energy data and current spurious computing energy data for each current computing cycle. The energy data preprocessing unit filters, reduces noise, and extracts statistical features from the real-time output current real computing energy signal, current spurious computing energy signal, and current computing energy signal, calculates the average energy consumption, and transmits it to the software controller. The average energy consumption represents the average value of computing energy consumption within a current encryption / decryption cycle or a single current computing cycle.

[0121] S405, Adaptive Optimization.

[0122] The software control module analyzes the preprocessed data from the energy data preprocessing subunit. When it detects a potential stability pattern in the distribution of current computing energy consumption across current computing cycles, or when the current average encryption / decryption energy consumption in the current encryption / decryption cycle deviates from the original current average encryption / decryption energy budget by a factor greater than or equal to the preset encryption / decryption energy deviation, it immediately recalculates the spurious computing injection ratio (i.e., the current computing energy budget ratio) and the nonlinear function parameters, and sends parameter update commands to other modules. The nonlinear modulation module and the spurious computing module adjust according to the new parameters to ensure that each computing cycle exhibits highly random energy characteristics. Simultaneously, the system records this adjustment data and stores it in the internal log.

[0123] S406. End of encryption / decryption operation and archiving of results.

[0124] After the current encryption / decryption task is completed, the software control module records the adjustments made during the encryption / decryption operation, the current computing energy data, and the current nonlinear parameters. It then intelligently learns and updates the computing energy budget parameter adjustment model. Based on the current computing energy budget parameters, current computing energy budget ratio, and nonlinear function parameters output by the model, the system is adjusted and awaits the next encryption / decryption task. The input data for the computing energy budget parameter adjustment model includes real-time collected current computing energy data, current encryption / decryption energy deviation, current computing energy budget parameters, current computing energy budget ratio, and adjustment records of nonlinear function parameters. The output of the model is the optimal solution for the next encryption / decryption task, including the current computing energy budget parameters, current computing energy budget ratio, and nonlinear function parameters. This closed-loop process ensures that the system achieves nonlinear transformation and random control of energy throughout the entire encryption / decryption operation, effectively preventing energy analysis attacks.

[0125] Existing smart card protection methods against energy analysis attacks employ side-channel interference techniques such as adding spoofing operations, increasing random delays, and injecting fixed noise during encryption and decryption. In contrast, the smart card protection method based on energy budgeting and nonlinear modulation proposed in this invention not only allocates the energy budget for each encryption and decryption operation using a pre-planned energy budget, but also nonlinearly modulates the energy characteristics of both the real and spoofed computational energy data. Compared to existing technologies, the proposed solution pre-plans the energy budget, splits the real computational energy into real and spoof components at a fixed ratio, and then mixes them using a nonlinear modulation algorithm. This results in a nonlinear, dynamic, and unreproducible overall energy signal, disrupting energy patterns and increasing the difficulty of energy analysis attacks, thus enhancing protection against advanced side-channel attacks. Simultaneously, it ensures that the energy allocation for each operation is controllable, preventing spoofing operations from excessively impacting the overall computational speed, achieving a balance between high security and high computational efficiency.

[0126] Example 3

[0127] Figure 5 This is a schematic diagram of a smart card protection device provided in Embodiment 3 of the present invention. This embodiment of the invention is applicable to situations involving protection against power analysis attacks on smart cards. The device can execute smart card protection methods and can be implemented in hardware and / or software. It can be configured in an electronic device that carries smart card protection functions, such as a client or server.

[0128] See Figure 5 The smart card protection device shown includes: an energy budget management module 501, a spoofing operation sequence generation module 502, an encryption / decryption task execution module 503, and a nonlinear modulation module 504. The energy budget management module, upon receiving a current encryption / decryption task from the smart card, determines the current computing energy budget and its proportion based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task. The spoofing operation sequence generation module generates a current spoofing operation sequence based on the current computing energy budget and its proportion. The encryption / decryption task execution module executes the current computing task to obtain current real computing energy data and simultaneously executes the current spoofing operation sequence to obtain current spoofing computing energy data. The nonlinear modulation module uses a nonlinear function to mix the current real computing energy data and the current spoofing computing energy data, outputting the current computing energy data.

[0129] The technical solution of this invention, through the current computing task, current environmental parameters, and historical data corresponding to the current computing task included in the current encryption / decryption task, performs computing energy budget planning for the current computing task of each encryption / decryption operation, determines the current computing energy budget and the current computing energy budget ratio, and allocates the current computing energy budget of each encryption / decryption operation according to the pre-planned current computing energy budget ratio. The real computing energy is split into real and spoof parts according to a fixed ratio, and the computing energy data of the real and spoof computing parts are nonlinearly modulated to obtain the current computing energy data. By using nonlinear modulation to mix the real and spoof computing energy data, the overall energy signal exhibits nonlinear, dynamic, and unreproducible characteristics, disrupting the energy pattern, increasing the difficulty of energy analysis attacks by attackers, and enhancing the protection capability against advanced side-channel attacks. At the same time, it also makes the energy allocation of each operation controllable, so that spoof computing does not affect the overall computing speed too much, achieving a balance between high security and high computing efficiency.

[0130] In an optional embodiment of the present invention, the energy budget management module 501 includes: a preset computing energy budget ratio acquisition unit, configured to acquire a preset computing energy budget ratio when the current encryption / decryption task is the first encryption / decryption task; a first data volume coefficient determination unit, configured to determine a first data volume coefficient and a first computing priority coefficient based on the first computing task included in the first encryption / decryption task; a first environment coefficient determination unit, configured to determine a first environment coefficient based on first environment parameters; a historical baseline energy consumption determination unit, configured to determine the historical baseline energy consumption of the first computing task based on historical data corresponding to the first computing task; and a first computing energy budget planning unit, configured to determine the first computing energy budget based on the first data volume coefficient, the first computing priority coefficient, the first environment coefficient, and the historical baseline energy consumption.

[0131] In an optional embodiment of the present invention, the energy budget management module 501 includes: a non-first-time computing energy budget planning unit, used to, when the current encryption / decryption task is a non-first-time encryption / decryption task, use a pre-trained computing energy budget planning model to plan the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task; wherein, the training samples of the computing energy budget planning model include historical computing tasks, historical environmental parameters, historical data corresponding to the historical computing tasks, historical computing energy consumption, and historical actual computing energy ratio.

[0132] In an optional embodiment of the present invention, the spurious computation sequence generation module 502 includes: a current spurious computation energy budget calculation unit, configured to calculate a current spurious computation energy budget based on the current computation energy budget and the current computation energy budget ratio; a current spurious computation template selection unit, configured to obtain a random seed and select a current spurious computation template based on the random seed; and a current spurious computation sequence generation unit, configured to adjust the current spurious computation instructions in the current spurious computation template according to the current spurious computation energy budget, so that the total energy consumption of the current spurious computation instructions in the current spurious computation template reaches the current spurious computation energy budget, thereby generating a current spurious computation sequence.

[0133] In an optional embodiment of the present invention, the device further includes: a current average encryption / decryption energy consumption acquisition module, configured to acquire the current average encryption / decryption energy consumption for the current encryption / decryption cycle after mixing the current real computing energy data and the current spurious computing energy data using a nonlinear function and outputting current computing energy data; a current encryption / decryption energy deviation detection module, configured to detect the current encryption / decryption energy deviation between the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget for the current encryption / decryption cycle; and a current computing energy budget parameter adjustment module, configured to adjust the current computing energy budget parameter, the current computing energy budget ratio, and / or the current nonlinear function parameter when the current encryption / decryption energy deviation is greater than or equal to a preset encryption / decryption energy deviation.

[0134] In an optional embodiment of the present invention, the current computing energy budget parameter adjustment module includes: a current computing energy budget parameter adjustment unit, used to determine the adjusted current computing energy budget parameter, the current computing energy budget ratio, and the current nonlinear function parameter by using a pre-trained computing energy budget parameter adjustment model based on the current computing energy data, the current encryption / decryption energy deviation, the current computing energy budget parameter, the current computing energy budget ratio, and the current nonlinear function parameter; wherein, the training samples of the computing energy budget parameter adjustment model include historical computing energy data, historical encryption / decryption energy deviation, historical computing energy budget parameter, historical computing energy budget ratio, historical nonlinear function parameter, and the adjusted historical computing energy budget parameter, historical computing energy budget ratio, and historical nonlinear function parameter.

[0135] In an optional embodiment of the present invention, the device further includes: a current computing energy consumption acquisition module, configured to acquire the current real energy consumption, current false energy consumption, and current computing energy consumption for multiple current computing cycles after mixing the current real computing energy data and the current false computing energy data using a nonlinear function and outputting current computing energy data; a current correlation coefficient calculation module, configured to calculate the current correlation coefficient between each current computing cycle based on the current real energy consumption, current false energy consumption, current computing energy consumption, current real energy budget, current false energy budget, and current computing energy budget for each current computing cycle; and a current nonlinear function parameter adjustment module, configured to adjust the current nonlinear function or the current nonlinear function parameter when the current correlation coefficient is greater than or equal to a preset correlation coefficient threshold.

[0136] The smart card protection device provided in the embodiments of the present invention can execute the smart card protection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.

[0137] In the technical solutions of this invention, the information collected is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0138] Example 4

[0139] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.

[0140] Figure 6 A schematic diagram of an electronic device 600 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0141] like Figure 6As shown, the electronic device 600 includes at least one processor 601 and a memory, such as a read-only memory 602 or a random access memory 603, communicatively connected to the at least one processor 601. The memory stores computer programs executable by the at least one processor. The processor 601 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 602 or loaded into the random access memory 603 from storage unit 608. The random access memory 603 can also store various programs and data required for the operation of the electronic device 600. The processor 601, read-only memory 602, and random access memory 603 are interconnected via a bus 604. An input / output interface 605 is also connected to the bus 604.

[0142] Multiple components in electronic device 600 are connected to input / output interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0143] Processor 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 601 include, but are not limited to, central processing units, graphics processing units, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any suitable processor, controller, microcontroller, etc. Processor 601 performs the various methods and processes described above, such as smart card protection methods.

[0144] In some embodiments, the smart card protection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 600 via read-only memory 602 and / or communication unit 609. When the computer program is loaded into random access memory 603 and executed by processor 601, one or more steps of the smart card protection method described above may be performed. Alternatively, in other embodiments, processor 601 may be configured to perform the smart card protection method by any other suitable means (e.g., by means of firmware).

[0145] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays, application-specific integrated circuits (ASICs), application-specific standard products (ASICs), systems-on-a-chip (SoCs), complex programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0146] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0147] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0148] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube or liquid crystal display monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0149] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0150] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system. This addresses the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.

[0151] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0152] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method of protecting a smart card, characterized by, The method includes: Upon receiving the current encryption / decryption task from the smart card, the current computing energy budget and the current computing energy budget ratio are determined based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task. Based on the current computing energy budget and the current computing energy budget ratio, generate the current dummy computing sequence; Execute the current computation task to obtain the current real computation energy data, and simultaneously execute the current spurious computation sequence to obtain the current spurious computation energy data; A nonlinear function is used to mix the current real computing energy data and the current fake computing energy data, and the current computing energy data is output.

2. The method of claim 1, wherein, The step of determining the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environment parameters, and historical data corresponding to the current computing task includes: When the current encryption / decryption task is the first encryption / decryption task, obtain the preset computing energy budget ratio; Based on the initial computation task included in the initial encryption / decryption task, determine the initial data volume coefficient and the initial computation priority coefficient; Determine the initial environmental coefficient based on the initial environmental parameters; Based on the historical data corresponding to the first computing task, determine the historical baseline energy consumption of the first computing task; The initial computing energy budget is determined based on the initial data volume coefficient, the initial computing priority coefficient, the initial environmental coefficient, and the historical baseline energy consumption.

3. The method of claim 1, wherein, The step of planning the current computing energy budget and its proportion based on the current computing task, current environment parameters, and historical data corresponding to the current encryption / decryption task includes: When the current encryption / decryption task is not the first encryption / decryption task, a pre-trained computing energy budget planning model is used to plan the current computing energy budget and the current computing energy budget ratio based on the current computing task, the current environmental parameters, and the historical data corresponding to the current computing task. The training samples of the computing energy budget planning model include historical computing tasks, historical environmental parameters, historical data corresponding to the historical computing tasks, historical computing energy consumption, and historical actual computing energy ratio.

4. The method of claim 1, wherein, The step of generating the current spurious computation sequence based on the current computing energy budget and the current computing energy budget ratio includes: Calculate the current spurious computing energy budget based on the current computing energy budget and the current computing energy budget ratio; Obtain a random seed, and select the current dummy computation template based on the random seed; Based on the current spoofing energy budget, the current spoofing instructions in the current spoofing template are adjusted so that the total energy consumption of the current spoofing instructions in the current spoofing template reaches the current spoofing energy budget, and the current spoofing sequence is generated.

5. The method of claim 1, wherein, After mixing the current real computing energy data and the current spurious computing energy data using a nonlinear function to output the current computing energy data, the method further includes: Get the average energy consumption for encryption and decryption in the current encryption / decryption cycle; Detect the current encryption / decryption energy deviation between the current average encryption / decryption energy consumption and the current average encryption / decryption energy budget for the current encryption / decryption cycle; When the current encryption / decryption energy deviation is greater than or equal to the preset encryption / decryption energy deviation, the current computing energy budget parameter, the current computing energy budget ratio, and / or the current nonlinear function parameter are adjusted.

6. The method of claim 5, wherein, The adjustment of the current computing energy budget parameters, the current computing energy budget ratio, and / or the current nonlinear function parameters includes: A pre-trained computing energy budget parameter adjustment model is used to determine the adjusted current computing energy budget parameters, current computing energy budget ratio, and current nonlinear function parameters based on the current computing energy data, the current encryption / decryption energy deviation, the current computing energy budget parameters, the current computing energy budget ratio, and the current nonlinear function parameters. The training samples for the computing energy budget parameter adjustment model include historical computing energy data, historical encryption / decryption energy deviation, historical computing energy budget parameters, historical computing energy budget ratios, historical nonlinear function parameters, and the adjusted historical computing energy budget parameters, historical computing energy budget ratios, and historical nonlinear function parameters.

7. The method of claim 1, wherein, After mixing the current real computing energy data and the current spurious computing energy data using a nonlinear function to output the current computing energy data, the method further includes: Obtain the current actual energy consumption, current spurious energy consumption, and current computational energy consumption for multiple current computation cycles; Calculate the current correlation coefficient between each current operation cycle based on the current actual energy consumption, current spurious energy consumption, current operation energy consumption, current actual energy budget, current spurious energy budget, and current operation energy budget of each current operation cycle; When the current correlation coefficient is greater than or equal to a preset correlation coefficient threshold, the current nonlinear function or the parameters of the current nonlinear function are adjusted.

8. A smart card shield apparatus, characterized by, The device includes: The energy budget management module is used to determine the current computing energy budget and the current computing energy budget ratio based on the current computing task, current environmental parameters, and historical data corresponding to the current computing task when receiving the current encryption / decryption task of the smart card. A fake computation sequence generation module is used to generate a current fake computation sequence based on the current computational energy budget and the current computational energy budget ratio; The encryption / decryption task execution module is used to execute the current computing task, obtain the current real computing energy data, and simultaneously execute the current fake computing sequence to obtain the current fake computing energy data. The nonlinear modulation module is used to mix the current real computing energy data and the current spurious computing energy data using a nonlinear function, and output the current computing energy data.

9. An electronic device, comprising: The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the smart card protection method according to any one of claims 1-7.

10. A computer program product, characterised in that, The computer program product includes a computer program that, when executed by a processor, implements the smart card protection method according to any one of claims 1-7.