Asynchronous code execution for improved performance and security measures to protect digital security devices
Asynchronous task execution in digital security devices randomizes execution times and balances branch execution to protect against side-channel and fault injection attacks without performance degradation.
Patent Information
- Application Number
- JP2024534000
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-12-07
- Filing Date
- 2022-12-05
- Publication Date
- 2026-02-04
- Estimated Expiration
- 2042-12-05
AI Technical Summary
Digital security devices are vulnerable to side-channel and fault injection attacks, which compromise the security of sensitive information by analyzing execution timing and power consumption, and existing countermeasures degrade performance through predictable desynchronization or padding.
Implement asynchronous task execution to non-linearize the execution of applications by using an asynchronous task queue, where tasks are selected based on predicted execution times and desynchronization needs to randomize execution times and balance branch execution times.
Enhances security against side-channel and fault injection attacks while maintaining performance by making execution patterns unpredictable and avoiding useless dummy tasks.
Smart Images

Figure 0007811268000002 
Figure 0007811268000003 
Figure 0007811268000004
Abstract
Description
[Technical Field]
[0001] The present invention relates generally to digital security devices, and more particularly to countermeasures for protecting digital security devices against side channel attacks, fault injection attacks, and timing attacks. [Background technology]
[0002] Electronic communication and commerce can be powerful, but dangerous, tools. With the widespread availability of networking technologies, such as the Internet, there is an ever-increasing use of online tools for communication and commerce. Each year, more users find it easier or faster to conduct important transactions using computers and computer networks, regardless of the form of communication or commerce.
[0003] Furthermore, digital technologies play an ever-increasing role in identity management, for example, digital identities and passports.
[0004] Such digital security technologies may involve any of a wide variety of software and hardware techniques, such as encryption, antivirus software, and biometrics. These digital security technologies may be deployed in many types of digital security devices, such as smart cards, USB tokens with embedded smart cards, subscriber identity modules (SIMs) embedded or built into mobile devices, and Internet of Things (IoT) devices. Indeed, any computerized device entrusted with protecting secrets, such as private communications, encryption keys, account numbers, and health information, may be considered a digital security device. [Prior art documents] [Non-patent literature]
[0005] [Non-Patent Document 1] Mark Randolph and William Diehl, Power Side-Channel Attack Analysis: A Review of 20 Years of Study for the Layman,Cryptography 2020,4,15;doi:10.3390 / cryptography4020015 Summary of the Invention [Problem to be solved by the invention]
[0006] However, there is always a risk that the security of actions performed by a digital security device may be compromised through interception by a third party who has no right to participate in the transaction. When a malicious third party gains access to otherwise private transactions and data, there is financial loss, loss of privacy, and even loss of physical safety.
[0007] As an example, consider encryption, one mechanism used to avoid intrusions into electronic transactions and data privacy. Traditionally, both the sender and receiver of an encrypted message were considered secure. The primary use of encryption was to transmit an encoded message from sender to receiver without fear that an intermediary could decode the message. If an attacker did not have access to the sender's or receiver's encryption device, the attacker would be limited to using the encoded message itself, or possibly the encoded message and the corresponding plaintext message, to determine the encryption key used to encode or decode the message. However, if the attacker had access to the encryption device, the situation changed dramatically, as the attacker could then also analyze artifacts, so-called side-channel data, power consumption, etc., to infer the data manipulated by the encryption device.
[0008] One mechanism for ensuring that private keys remain truly private is to store the private keys and associated keying material on a secure, portable device, such as a smart card or mobile device. Smart cards are small, tamper-resistant computers, often in a package the size and shape of a credit card. Smart cards can be used to store cryptographic keys and cryptographic engines for encryption, decryption, and digital signing.
[0009] In one example, a user can receive an encrypted message and use the user's smart card to decrypt the message by first authenticating the smart card and then passing the message to the smart card for decryption. If authentication is successful, the smart card can decrypt the message using an encryption key stored on the card and a corresponding encryption engine and provide the decrypted message to the user. Similarly, if a user wants to cryptographically sign a message, the user can pass the message to the user's smart card, which will digitally sign the message using the user's encryption key and return the signature to the user or a third-party recipient.
[0010] Although cryptographic mechanisms are extremely difficult, if not impossible, to break from an algorithmic standpoint, the implementation of cryptographic mechanisms on the electronics of digital security devices may be much less secure than algorithmic analysis suggests. If an attacker has access to a smartcard, the attacker may be able to make repeated observations of, for example, power consumption or electromagnetic emissions during the execution of a cryptographic algorithm and use such auxiliary information in an attempt to determine secrets stored on the smartcard, in particular private cryptographic keys stored on the smartcard. One such attack is the so-called side-channel attack.
[0011] Side-channel attacks exploit the program timing, power consumption, and / or electronic emissions of devices performing cryptographic computations. The behavior of the device (timing, power consumption, and electronic emissions) varies and depends directly on the program and data being manipulated in the cryptographic algorithms. Attackers can use these variations to infer sensitive data, leading to the recovery of private keys.
[0012] In parallel with the development of side-channel analysis attacks, techniques have been developed to protect against attempts to recover keys or other sensitive information from side-channel leaks. These techniques are known as countermeasures and include attempts to hide the operation of a cryptographic device from any side-channel data leaks, for example, by masking the data while it is manipulated by a cryptographic algorithm, introducing dummy instructions, changing the order of instructions, or manipulating the system clock to introduce jitter in any collected side-channel data.
[0013] There are several different types of side-channel attacks, and conversely, several different types of countermeasures. With regard to side-channel attacks based on the electrical activity of a device, Mark Randolph and William Diehl, Power Side-Channel Attack Analysis: A Review of 20 Years of Study for the Layman, Cryptography 2020, 4, 15; doi:10.3390 / cryptography4020015 (incorporated herein by reference) provides an extensive survey of the techniques used, as well as a discussion of countermeasures.
[0014] One form of attack is based on the analysis of execution paths through a security algorithm, e.g., a cryptographic algorithm. Essentially, the attacker monitors, for example, the power consumption or execution time through one path relative to the power consumption or execution time of another path through a sensitive routine to determine which path is executed in response to particular input data.
[0015] Another form of attack, fault injection attacks, attempts to manipulate a device through its behavior when some fault is induced, for example, by introducing an out-of-range power supply voltage or clock manipulation. Fault injection can be used to cause, for example, skipping instructions, incorrect data or instruction fetches, or failure to correctly write data to memory. The success of a fault injection attack depends on the precise timing of the attack, for example, when branch and compare instructions are targeted to potentially cause the execution of a particular branch.
[0016] One countermeasure defense against side-channel and fault injection attacks is to desynchronize the execution of each path through a routine so that no given path through a portion of code can result in the same power consumption or timing signature. Such desynchronization can be achieved by introducing dummy routines that intentionally slow down a portion of code, thereby desynchronizing the timing of the execution of sensitive routines, to prevent an attacker from performing a fault injection attack at a precise time or location. Introducing dummy routines can also induce unpredictable power usage profiles for the execution of a portion of code, thereby making side-channel analysis attacks more difficult.
[0017] An alternative solution, uniform branch timing, pads the code execution of sensitive routines so that all possible branches through the sensitive portion have uniform execution time, i.e., the same execution time regardless of which conditions apply.
[0018] Both execution desynchronization and uniform branch timing suffer from performance degradation due to the execution of counterproductive actions intended to cause unpredictable execution timing or uniform execution of all code branches.
[0019] Furthermore, desynchronization and padding are typically performed in simple and predictable ways, such as empty loops or loops performing simple operations. Such behavior can be easily detected through side-channel analysis (e.g., simple power analysis or differential power analysis). Thus, padding codes, by themselves, can make sensitive routines vulnerable to attack.
[0020] It should be noted that vulnerability to side-channel analysis is not limited to cryptographic operations: there are many other computer operations in which sensitive information, e.g., passwords, must be protected. Thus, side-channel analysis is also a problem in such scenarios.
[0021] From the above, it is apparent that there is a need for an improved method for protecting sensitive routines executed by digital security devices against side-channel attacks and fault injection attacks through desynchronization and uniform branching execution without the wasteful execution of useless code that may be vulnerable to side-channel attacks. [Means for solving the problem]
[0022] According to a first aspect, the technology described herein provides a method for improving performance while protecting a computerized digital security device against side-channel attacks, fault injection attacks, and timing attacks. The method includes: identifying asynchronous tasks to be executed by the computerized digital security device, placing the identified asynchronous tasks in an asynchronous task queue, and executing a first application by selecting at least one task from the asynchronous task queue, executing the selected at least one task, and removing the selected at least one task from the asynchronous task queue, thereby non-linearizing execution of the application.
[0023] The method may further include predicting an execution time for each identified asynchronous task, and wherein selecting at least one task from the asynchronous task queue includes selecting the at least one task from the asynchronous task queue based on the predicted execution times of the tasks in the asynchronous task queue.
[0024] The method may further include identifying an execution location to add the desynchronization time and determining how much desynchronization time to add. The step of selecting at least one task may then include selecting at least one task such that a sum of predicted execution times of the selected at least one task is shorter than the determined desynchronization time to add, and executing at least one dummy task such that the execution time is equal to the difference between the determined desynchronization time to add and the sum of the predicted execution times of the selected at least one task.
[0025] The method may further include shuffling execution of the first application by selecting at least one task from the asynchronous task queue and executing the selected at least one task before continuing execution of the first application.
[0026] The method may further include desynchronizing execution of the first application by selecting at least one task from the asynchronous task queue and modifying the execution flow of the first application by executing the selected task before continuing execution of the first application.
[0027] The method may further include identifying at least first and second code branches, where the execution times for the first and second code branches are unequal, and equalizing the execution times for the first and second code branches by selecting at least one task from the asynchronous task queue such that a predicted execution time of the selected at least one task balances the execution times of both code branches.
[0028] The method may further include randomly selecting a task from the asynchronous task queue.
[0029] The method may include adding tasks to an asynchronous task queue, including tasks selected from tasks required by the first application, tasks required by an operating system of the computerized digital security device, and tasks required by applications other than the first application.
[0030] The tasks added to the asynchronous task queue may include tasks selected from the group of: calculating very large prime numbers, memory defragmentation, non-volatile memory (NVM) page refresh, NVM erase, NVM write, generating a small buffer of random numbers using hardware true random number generation, security sensor check, memory integrity verification, code execution flow control, data compression, and data decompression.
[0031] In a second aspect, the technology described herein includes a digital security device having a processor and memory and programmed to perform the above-described method for improving performance while protecting the computerized digital security device against side channel attacks, fault injection attacks, and timing attacks.
[0032] In one embodiment, the instructions to non-linearize the execution of the first application include instructions to a processor: predicting an execution time for each identified asynchronous task; selecting at least one task from the asynchronous task queue, the at least one task being selected from the asynchronous task queue based on predicted execution times of tasks in the asynchronous task queue; The instruction may include instructions to:
[0033] In one embodiment, the instructions for non-linearizing the execution of the first application include instructions to a processor: identifying an execution location to add a desynchronization time; determining how much desynchronization time to add; The instructions to select at least one task may include instructions to select the at least one task such that a sum of predicted execution times of the selected at least one task is less than the determined desynchronization time to be added, and the instructions to non-linearize the execution of the first application may include instructions to the processor to: executing at least one dummy task for a time equal to the difference in execution time between the determined desynchronization time to be added and the sum of the predicted execution times of the at least one selected task; The instruction may include instructions to:
[0034] In one embodiment, the instructions for non-linearizing the execution of the first application may include instructions to cause the processor to shuffle the execution of the first application by selecting at least one task from an asynchronous task queue and executing the selected at least one task before continuing execution of the first application.
[0035] In one embodiment, the instructions for non-linearizing the execution of the first application may include instructions to cause the processor to desynchronize the execution of the first application by modifying the execution flow of the first application by selecting at least one task from an asynchronous task queue and executing the selected task before continuing execution of the first application.
[0036] In one embodiment, the instructions to non-linearize the execution of the first application include instructions to a processor: identifying at least first and second code branches, wherein execution times for the first and second code branches are unequal; Equalizing the execution times for the first and second code branches by selecting at least one task from the asynchronous task queue such that the predicted execution time of the selected at least one task balances the execution times of both code branches; This includes instructions to:
[0037] In one embodiment, the instructions for non-linearizing the execution of the first application include instructions to cause the processor to randomly select a task from an asynchronous task queue.
[0038] In one embodiment, the tasks added to the asynchronous task queue include tasks selected from tasks required by the first application, tasks required by the operating system of the computerized digital security device, and tasks required by applications other than the first application.
[0039] In one embodiment, the tasks added to the asynchronous task queue include tasks selected from the group consisting of: calculating very large prime numbers, memory defragmentation, non-volatile memory (NVM) page refresh, NVM erase, NVM write, generating a small buffer of random numbers using hardware true random number generation, security sensor check, memory integrity verification, code execution flow control, data compression, and data decompression.
[0040] In a further aspect, the technology described herein includes a non-transitory computer memory having stored thereon instructions that can cause a processor of a digital security device to perform the above-described method of improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks. [Brief explanation of the drawings]
[0041] [Figure 1]1 is an illustration of a network in which a user operates a digital security device to perform several of a variety of sensitive operations, such as encryption operations. [Figure 2] FIG. 1 is an illustration of a device that can be used to perform side channel analysis and fault injection attacks. [Figure 3] FIG. 1 is a high-level block diagram of an example digital security device. [Figure 4] It is composed of Figures 4A and 4B. [Figure 4A] 1 is a flowchart illustrating high-level steps in an embodiment of a countermeasure mechanism against side channel and fault injection attacks. [Figure 4B] 1 is a flowchart illustrating high-level steps in an embodiment of a countermeasure mechanism against side channel and fault injection attacks. [Figure 5] Here is a sample code section containing three asynchronous tasks. [Figure 6A] FIG. 1 is a schematic diagram of an asynchronous task queue. [Figure 6B] FIG. 1 is a schematic diagram of an asynchronous task queue. [Figure 6C] FIG. 1 is a schematic diagram of an asynchronous task queue. [Figure 7] FIG. 1 is a timeline diagram illustrating the execution timeline of an application that performs desynchronization. [Figure 8] FIG. 8 is a schematic illustration of the example from FIG. 7 in which the execution timeline is modified in accordance with the mechanisms described herein for utilizing asynchronous tasks to perform desynchronized operations. DETAILED DESCRIPTION OF THE INVENTION
[0042] In the following detailed description, reference is made to the accompanying drawings that show, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention. It should be understood that various embodiments of the invention, although different, are not necessarily mutually exclusive. For example, a particular feature, structure, or characteristic described herein in connection with one embodiment may be implemented in other embodiments without departing from the spirit and scope of the invention. In addition, it should be understood that the location and arrangement of individual elements within each disclosed embodiment may be modified without departing from the spirit and scope of the invention. Therefore, the following detailed description is not to be taken in a limiting sense, and the scope of the present invention is defined solely by the appended claims, along with the full range of equivalents to which the claims are entitled. In the drawings, like numerals refer to the same or similar functionality across the several views.
[0043] The following description includes references to various methods that are performed by a processor of an integrated circuit chip. As is common in the art, there may be phrases herein that indicate that these methods or method steps are performed by software instructions or software modules. Those skilled in the art should interpret such descriptions to mean that, in fact, the processor executes the methods, software instructions, and software modules.
[0044] The techniques described herein provide mechanisms to protect digital security devices against side-channel attacks and fault injection attacks by desynchronizing the execution of sensitive routines in an unpredictable manner with desynchronizing or padding code through the execution of tasks from a queue of tasks that can be executed asynchronously.
[0045] A sensitive operation is an operation that processes or uses a piece of sensitive information that should be protected from disclosure. Examples of sensitive information include private encryption keys, account numbers, PIN codes and passwords, biometric information, and data transferred in secure memory transfer operations. Encryption operations are typically sensitive operations. Account access through an account number, PIN, or password is also a sensitive operation, as it accesses or manipulates biometric information.
[0046] As used herein, an asynchronous task is a task performed by an electronic device that can be performed without being synchronized with the execution of another task. An asynchronous task can be any task that can be performed before or independently of the current operation of an active application process. For example, an asynchronous task can be an operating system function that is not a function of an executing application but is performed by the operating system periodically or based on certain conditions. Such operations include memory management functions, such as defragmentation and nonvolatile read and write memory (NVM) page refresh. Asynchronous tasks also include application program operations. For example, for cryptographic applications, these application program operations can include the calculation of large prime numbers and the generation of a buffer of true random numbers using a hardware true random number generator (TRNG).
[0047] FIG. 1 is an illustration of a network 111 in which a user 101 operates a digital security device 103 to perform any of a variety of secure operations, e.g., cryptographic operations. Digital security device 103 can be any of various types of tamper-resistant devices, such as a smart card, an electronic identification card, a passport, and a secure USB token. Digital security device 103 may be incorporated into a host device 105, such as a mobile communication device. Alternatively, digital security device 103′ may be connected to host device 105′ via terminal 107. In yet another alternative, digital security device 103″ may be wirelessly connected to host device 105″, e.g., via near field communication (NFC), Bluetooth, or WiFi.
[0048] In many cases, digital security device 103 is used to perform cryptographic services in connection with services provided by service provider 109 over network 111, e.g., the Internet. Such cryptographic services include providing cryptographic signatures, encryption, decryption, and authentication. Alternatively, digital security devices are used for other operations involving sensitive information, such as account access via personal identification numbers (PINs), passwords, or biometrics.
[0049] To perform sensitive operations, such as cryptographic operations, the digital security device 103 stores some sensitive information therein, such as an encryption key, a PIN, or a password.
[0050] In classical cryptography, the sender and receiver of a secret message each possess a key that can be used to encrypt and decrypt the message, respectively. The security of the cryptographic algorithm used depends on the degree of confidence that it is mathematically very difficult to decrypt the message without the correct key, and that it is mathematically very difficult to determine the encryption and decryption keys from the message. Thus, if a message is intercepted on its way to the receiver, the intercepting party cannot deduce the associated plaintext or the key used to encrypt and decrypt the message.
[0051] This security relies on the assumption that the execution of the algorithm itself does not provide information that can be used to determine the secret information used in performing the encryption operation, e.g., the decryption operation. If a message is intercepted between the sender and the intended recipient, it is reasonable to assume that the intercepting entity does not have access to the device being used to decrypt the message.
[0052] 1, however, digital security device 103, e.g., an encryption device, may be a mobile device that is somewhat prone to loss or theft, and thus may fall into the hands of someone who may wish to determine the sensitive information stored on digital security device 103. In such a case, an entity seeking to determine the sensitive information stored on digital security device 103 may in fact have access to digital security device 103, and thus be able to observe the digital security device as it performs sensitive operations, e.g., encryption operations.
[0053] When digital security device 103 can be observed while performing a sensitive operation, it is possible to measure various physical characteristics of digital security device 103 that change during the performance of the sensitive operation. For example, the power consumption, electromagnetic emissions, timing information, and even noise of digital security device 103 can be recorded and analyzed to determine sensitive information stored in digital security device 103. Collectively, such physical characteristics are referred to herein as side-channel data, and the use of such data to determine sensitive information, e.g., a cryptographic key, is referred to as side-channel analysis.
[0054] In another form of attack, a fault injection attack, the digital security device 103 may be made to suffer an operational failure condition, e.g., an out-of-range power supply voltage or a clocking error, to cause a processing error that an attacker can exploit to cause an operation to be performed in a way that can be used by the attacker to determine secret information stored in the digital security device 103.
[0055] FIG. 2 provides an example of equipment that can be used to perform side-channel analysis or to conduct a fault injection attack. Digital security device 103 can be inserted into reader 201. The reader can be connected to or include an electronic circuit having, for example, power supply 203, which supplies power to the security device, and resistor 205. The power consumption of digital security device 103 can be monitored on signal acquisition device 207, for example, an oscilloscope connected in parallel with resistor 205. Computer 209 is also connected to reader 201. Computer 209 can be used to alter sensitive information stored in the device under test, i.e., a device that can be manipulated by an attacker, to induce digital security device 103 to perform sensitive operations, such as decryption, digital signing, or authentication. Signal acquisition device 207 can also be connected to computer 209 so that a digitized power trace generated by signal acquisition device 207 can be transferred to computer 209 for analysis.
[0056] 2 can also be used to perform fault injection attacks against digital security device 103. In such a case, for example, the supply voltage applied to digital security device 103 can be changed at precise execution times identified through side-channel analysis to trigger a specific execution flow.
[0057] There are many different types of side-channel attacks. These include, but are not limited to, simple power analysis (SPA), differential power analysis (DPA), template attack (TA), correlation power analysis (CPA), mutual information analysis (MIA), and test vector leakage assessment (TVLA). Mark Randolph and William Diehl, *Power Side-Channel Attack Analysis: A Review of 20 Years of Study for the Layman*, Cryptography 2020, 4, 15; doi:10.3390 / cryptography4020015. Randolph and Diehl provide a good introduction to the subject of side-channel analysis.
[0058] 3 is a high-level diagram of an example digital security device 103, including a processor 301, random access memory (RAM) 302, and non-volatile memory (NVM) 303, e.g., non-volatile random access memory (NVRAM). NVM 303 may be used to store programs in program memory 305 and data in data memory 307. The programs stored in program memory 305 provide instructions executable by processor 301. The programs may include an operating system 309, e.g., a virtual machine. The programs may also include applications 311 that perform at least one sensitive operation, e.g., a cryptographic operation. Data memory 307 contains sensitive information 313, e.g., encryption keys, passwords, and personal identification numbers.
[0059] According to one embodiment, the program memory 305 may also include at least one asynchronous task table 315 for storing information about application program tasks that can be executed asynchronously, i.e., independently of other program flows, and this table can be used to disrupt the execution timing of the application and thwart attacks based on execution timing analysis. The asynchronous task table 315 associated with a particular application 311 is advantageously stored together with the application 311 in the program memory 305. During runtime, the asynchronous task table 315 is used to construct a task queue 317 that is stored in RAM 302. The task manager function of the operating system 309 uses the task queue 317 to schedule tasks during the execution of the application 311 and other applications executing on the digital security device 103. For example, as discussed in more detail below in connection with FIG. 4, the asynchronous execution of such asynchronous tasks can be used to foil attacks by randomizing the execution timing of sensitive routines or to uniform different branches through sensitive routines.
[0060] 4 is a flowchart illustrating high-level steps in an embodiment of a mechanism for countering side-channel and fault injection attacks. The method illustrated in FIG. 4 provides a mechanism that provides defensive desynchronization of operations performed by applications having sensitive operations 311 while avoiding the performance of useless operations, thereby improving both the performance and security of the digital security device 103 with respect to side-channel attacks.
[0061] The mechanism shown in Figure 4 can be used as part of a countermeasure strategy that involves varying the execution times of different parts of an application. Such countermeasures include smart desynchronization, i.e., execution timing randomization, and uniform code branch execution. In smart desynchronization, the execution time of an operation or sequence of operations is randomized to avoid revealing the location of a particular operation or sequence of operations to an attacker. In uniform code branch execution, at least two code branches are made to execute with the same execution time to avoid revealing which of the at least two code branches is being executed.
[0062] In the first step, step 401, tasks are identified as tasks that can be executed asynchronously. This step can be performed by code analysis or by a programmer providing comments that flag a preprocessor that a particular section of code can be executed asynchronously.
[0063] Some tasks may be considered asynchronous in nature, such as memory defragmentation. Such tasks may be performed given specific conditions. For example, with respect to memory defragmentation, memory analysis may reveal a threshold level of fragmentation at which memory defragmentation is desirable, and a second threshold level at which memory defragmentation is necessary before application execution can proceed.
[0064] 5 is a sample code section 501 that includes three asynchronous tasks, Alpha 503, Beta 505, and Gamma 507, and several non-asynchronous tasks 509 and 511. Non-asynchronous tasks 509 and 511 must be executed in the correct sequence, whereas asynchronous tasks 503, 505, and 507 may be executed at any time during the execution of the application to which code section 501 belongs, or at any time before the results from such asynchronous tasks are needed by application 501.
[0065] Expected execution times for the tasks are determined in step 403. In one embodiment, the application developer assigns expected execution times to the various asynchronous tasks that the developer has identified as component tasks of the application 311. Application developer tools may provide mechanisms for predicting such execution times.
[0066] In one embodiment, the predicted execution time is used to assign a weight to the task in step 405. For example, the allowable range of weights may be from 1 to 10. A very fast task would be given a weight of 1, while a very complex task would be given a weight of 10.
[0067] For illustrative purposes, Table 1 shows some example tasks, their associated expected execution times, and their weights. - Very large prime number calculation, 10+ seconds, weight 10 - Memory defragmentation, 500+ ms, weight 8 - NVRAM page refresh, 10+ ms, weight 5 - Generate a small buffer of random numbers using a hardware true random number generator (TRNG), 5+ milliseconds, weight 3 - Small calculation routine execution, <1 ms, weight 1 Table 1: Example asynchronous tasks, their estimated execution times, and their weights
[0068] Therefore, a relationship such as that shown in Table 2 is assigned between the predicted execution time and the weight.
[0069] [Table 1]
[0070] Table 2 is merely an example. In alternative embodiments, the granularity of the association between execution time and weight may vary depending on the implementation.
[0071] During application execution 407, the application, in step 409, anticipates future needs for tasks that can be executed asynchronously and places such tasks in task queue 317. Task queue 317 is used by a task scheduler to schedule tasks to be executed, including asynchronous tasks.
[0072] Figure 6 is a more detailed diagram of asynchronous task queue 317 being processed by the steps of Figure 4. In the first stage shown in Figure 6A, asynchronous task queue 317a contains several asynchronous tasks available for execution when needed. In this example, these are tasks T1 through T7. Each of these tasks has a certain expected execution time, which in one embodiment can be converted into a weight. Note that 317a, 317b, and 317c are different states of the same asynchronous task queue 317.
[0073] If the application determines in step 405 that there is a future need for a task that can be executed asynchronously, then that task (e.g., task T8) is added to asynchronous task queue 317b in 411, as shown in FIG. 6B.
[0074] During the execution of the application, in step 413, the need for desynchronization may be determined. The reasons for such desynchronization are outside the scope of this document. However, as noted, adding delays to the execution of sensitive routines can be used to prevent attackers from conducting side-channel attacks, fault injection attacks, and timing attacks. Furthermore, countermeasures against timing attacks are based on balancing the execution times of different branches of sensitive routines. Therefore, countermeasures based on such techniques sometimes determine the need to introduce desynchronization by performing tasks that are unrelated or only slightly related to the execution of the sensitive routine being protected.
[0075] The first step in adding desynchronization is to determine how much execution time should be added at the point where such desynchronization is desired, step 415. For example, if one of two branches has an execution time that is a certain amount of time less than the other branch, the difference is the desired desynchronization time. Conversely, if a particular point in the code is to be desynchronized by adding a random amount of time, the desynchronization time added may be set to a random number.
[0076] Once the required desynchronization time has been determined, in step 419, one or more tasks having combined predicted execution times that fit the required desynchronization time are selected from the asynchronous task queue 317 and these asynchronous tasks are executed.
[0077] The selected task is then removed from the asynchronous task queue in step 421. The updated asynchronous task queue 317c after removal of the executed asynchronous task is shown in Figure 6C, where task T4 has been removed as an example.
[0078] Occasionally, an application may require execution of a task placed in the asynchronous task queue 317 before it is selected for desynchronization work. In such a case, the task is executed based on its execution required by the application, in step 423. After such a task is executed, it is removed from the asynchronous task queue, in step 425.
[0079] We now turn our attention to an example of the technology described hereinabove. FIG. 7 illustrates a conventional desynchronization mechanism as part of a countermeasure against attacks on digital security devices. In addition to computations not shown (shown as white space between blocks), this execution example consists of six tasks executed consecutively: two desynchronized tasks D1 and D2, and four tasks T1, T2, T3, and T4. Meanwhile, as seen in the example of FIG. 8, tasks T1-T4 can execute asynchronously with respect to other computations being executed. However, in the example of FIG. 7, this property is not utilized. Execution begins with desynchronized task D1 at approximately time=0 and ends with task T4 at time=28. The desynchronized blocks perform dummy computations. Therefore, desynchronized blocks D1 and D2 do not produce any useful computations and do not contribute to the results of the application being executed.
[0080] Now contrast the flow of Figure 8, which uses the asynchronous execution techniques described hereinabove, with the example of Figure 7. An initial decision is made that tasks T1 (weight W=2), T2 (weight W=5), and T3 (weight W=2) are to be placed in the asynchronous task queue.
[0081] At time T=3, the first desynchronized block (D1) executes. However, in contrast to the mechanism of FIG. 7, a task from the asynchronous task queue is selected that has a predicted execution time combined with the desired desynchronization time. The desired desynchronization time for D1 corresponds to a weight of 6. Therefore, two blocks whose sum of weights corresponds to an execution time of weight 6 are randomly selected from the asynchronous task queue—tasks T3 (W=3) and T2 (W=5) in this example. Note that this is not strictly linear. One task with weight 3 (3 ms≦PET<6 ms) and one with weight 5 (9 ms≦PET<20 ms) correspond to weight 6 (20 ms≦PET<50 ms).
[0082] After desynchronization, the executed task is removed. In the course of the continued execution of the application, it is predicted that a new task, T4, will be needed. Therefore, T4 is added to the asynchronous task queue.
[0083] Task T1, which has not yet been executed through the desynchronization process, is determined to be necessary for the execution of the application. Therefore, it is executed (at time T=19) and removed from the asynchronous task queue. At time T=22, a second desynchronization is performed. This time, the desynchronization time corresponds to weight W=4. Therefore, a task with weight equal to 4 is randomly selected from the asynchronous task queue, with T having a weight of W=4 in this example, and it is removed from the asynchronous task queue.
[0084] As can be observed from the examples illustrated in Figures 7 and 8, a mechanism for using tasks that are required by an application (or by an operating system) and that can be executed asynchronously to perform asynchronous operations improves the performance of the execution of applications by a digital security device. Furthermore, the execution of such operations, which are not simply designed to delay execution, such as dummy routines, is more difficult for an attacker to detect by performing a timing analysis of the application as it runs on the digital security device, thereby making the digital security device more secure for the purposes of storing sensitive information and performing sensitive operations.
[0085] From the above, it should be apparent that an efficient and secure mechanism for improving desynchronized operation on a digital security device has been provided.
[0086] While particular embodiments of the present invention have been described and illustrated, the invention is not limited to the specific forms and arrangements of parts so described and illustrated. The invention is limited only by the appended claims.
Claims
1. 1. A method for improving performance while protecting a computerized digital security device (103) against side channel attacks, fault injection attacks, and timing attacks, comprising: Identifying 401 an asynchronous task to be performed by a computerized digital security device; placing (411) the identified asynchronous task in an asynchronous task queue (317); Executing (407) a first application, selecting at least one task from an asynchronous task queue; Executing (423) at least one selected task; removing (425) the selected at least one task from the asynchronous task queue; and executing (407) the first application, including non-linearizing the execution of the first application by executing The method includes: predicting (403) an execution time for each identified asynchronous task; wherein the step of selecting at least one task from the asynchronous task queue includes basing the selection of the at least one task from the asynchronous task queue on an expected execution time of the task in the asynchronous task queue, and the method further comprises: identifying an execution location to add desynchronization time; determining 415 how much desynchronization time to add, determining (415), wherein the step of selecting at least one task includes selecting (419) at least one task such that a sum of predicted execution times of the selected at least one task is less than the determined desynchronization time to add; Executing (419) at least one dummy task for an execution time equal to the difference between the determined desynchronization time to be added and the sum of the predicted execution times of the at least one selected task; A method comprising:
2. 10. The method of improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks of claim 1, comprising shuffling execution of a first application by selecting at least one task from an asynchronous task queue and executing the selected at least one task before continuing execution of the first application.
3. 10. The method of improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks of claim 1, comprising: desynchronizing execution of a first application by modifying the execution flow of the first application by selecting at least one task from an asynchronous task queue and executing the selected task before continuing execution of the first application.
4. identifying at least first and second code branches, wherein execution times for the first and second code branches are unequal; Equalizing the execution times for the first and second code branches by selecting at least one task from the asynchronous task queue such that the predicted execution time of the selected at least one task balances the execution times of both code branches.
10. The method of claim 1 for improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks, comprising:
5. 10. The method for improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks of claim 1, wherein tasks are randomly selected from an asynchronous task queue.
6. 2. The method of improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks of claim 1, wherein the tasks placed in the asynchronous task queue include tasks selected from tasks required by a first application, tasks required by an operating system of the computerized digital security device, and tasks required by applications other than the first application.
7. 2. The method of improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks of claim 1, wherein the tasks placed in the asynchronous task queue include tasks selected from the group consisting of: calculating very large prime numbers, memory defragmentation, non-volatile memory (NVM) page refresh, NVM erase, NVM write, generating a small buffer of random numbers using hardware true random number generation, security sensor check, memory integrity verification, code execution flow control, data compression, and data decompression.
8. 1. A digital security device having improved performance while being protected against side channel attacks, fault injection attacks, and timing attacks, comprising: a processor; a memory coupled to the processor, the memory containing instructions executable by the processor, and Identifying an asynchronous task to be performed by a computerized digital security device; placing the identified asynchronous task in an asynchronous task queue; executing a first application, selecting at least one task from an asynchronous task queue; executing at least one selected task; removing the selected at least one task from the asynchronous task queue; To execute, to carry out, predicting an execution time for each identified asynchronous task; predicting, wherein the step of selecting at least one task from the asynchronous task queue includes basing the selection of the at least one task from the asynchronous task queue on a predicted execution time of the tasks in the asynchronous task queue; identifying an execution location to add desynchronization time; determining how much desynchronization time to add, determining that the step of selecting at least one task includes selecting (419) at least one task such that a sum of predicted execution times of the selected at least one task is less than the determined desynchronization time to add; executing at least one dummy task for an execution time equal to the difference between the determined desynchronization time to be added and the sum of the predicted execution times of the at least one selected task; 10. A digital security device comprising: instructions for non-linearizing execution of a first application by causing the first application to:
9. 9. A digital security device with improved performance while being protected against side channel attacks, fault injection attacks and timing attacks according to claim 8, programmed to perform the method according to any one of claims 1 to 7.
10. 1. A non-transitory memory comprising instructions for causing a processor of a digital security device to perform a method for improving performance while protecting a computerized digital security device against side channel attacks, fault injection attacks, and timing attacks, the non-transitory memory comprising instructions for causing the processor to: Identifying an asynchronous task to be performed by a computerized digital security device; placing the identified asynchronous task in an asynchronous task queue; executing a first application, selecting at least one task from an asynchronous task queue; executing at least one selected task; removing the selected at least one task from the asynchronous task queue; To execute, to carry out, predicting an execution time for each identified asynchronous task; predicting, wherein the step of selecting at least one task from the asynchronous task queue includes basing the selection of the at least one task from the asynchronous task queue on a predicted execution time of the tasks in the asynchronous task queue; identifying an execution location to add desynchronization time; determining how much desynchronization time to add, determining that the step of selecting at least one task includes selecting (419) at least one task such that a sum of predicted execution times of the selected at least one task is less than the determined desynchronization time to add; executing at least one dummy task for an execution time equal to the difference between the determined desynchronization time to be added and the sum of the predicted execution times of the at least one selected task; a non-transitory memory including instructions for non-linearizing execution of the first application by causing the first application to:
11. 11. The non-transitory memory of claim 10, comprising instructions for causing a processor of a digital security device to perform the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Conversion device, conversion method, conversion program, and obfuscation program
JP2020064461A
Method and apparatus for managing access requests from a plurality of devices using dual level queue locking scheme and a doubly-linked circular queue
US6321308B1
Computer and computer-control method
WO2013051067A1
Background architecture method and system for aggregation payment, computer device, and storage medium
WO2020134738A1