The present invention relates to a method for securely executing a security related process comprising Non Volatile Memory (NVM) programming, said method protecting the writing of information in a NVM memory, and more particularly preventing NVM programming detection by an attacker.
When a security related process comprising sensitive operations such as cryptographic operations is being executed, it may be required from time to time to write some data to a non-volatile memory (NVM). For example, most secure devices and algorithms rely on hardware security sensors or software countermeasures which monitor the execution environment or the behavior of the device or algorithm to be protected. When an abnormal behavior is detected, such devices or algorithm usually keep track of such a detection by updating a security counter value in a non-volatile memory (NVM).
A problem is that writing such a value in a NVM requires charging a NVM charge pump, which induces a spike of the current consumption of the device, as shown on
Consequently, there is a need for a method for securely executing a security related process comprising NVM programming and enabling to program the NVM without any visible impact on the device power consumption.
For this purpose and according to a first aspect, this invention therefore relates to a method for executing a security related process comprising at least a first operation and a subsequent programming operation of a memory area in a first memory row of a first memory of a system and using as input security data stored in a second memory of said system, wherein said first memory is a non-volatile memory and said system comprises a first memory charge pump, said method comprising, when the execution of said security related process is triggered:
By doing so, the charge pump is precharged and the row is open even before the execution of the first operations of the security related process starts. Then, when the programming operation is performed, it is performed much more quickly, without waiting for the charging of the pump and the opening of the first row, and it does not induce a current consumption spike that could be detected by an attacker.
The security data used for performing the first operations of the security related process may be copied from the first memory to the second memory before charging the first memory charge pump or opening the first memory row.
Such a copy operation ensures that this data remains available, in the second memory, while the charged state of the charge pump prevents any reading of the first memory.
In an embodiment wherein said system comprises a hardware security sensor or is configured for executing a software countermeasure, said programming operation of the method according to the first aspect may comprise writing, in said first memory, permanent security counters logging some abnormal behavior detected by said hardware security sensor or said software countermeasure.
Said second memory may be among a cache memory, a Random Access memory (RAM), a Non Volatile memory (NVM) or a Read Only memory (ROM).
Said first memory charge pump may be charged at a predetermined frequency such that it induces no visible spike of the current consumption of the system.
By doing so, no current consumption spike occurs because of the charging of the pump, even before the execution of the first operations.
According to a second aspect, this invention therefore relates also to a computer program product directly loadable into the memory of at least one computer, comprising software code instructions for performing the steps of the method according to the first aspect when said product is run on the computer.
According to a third aspect, this invention therefore relates also to a non-transitory computer readable medium storing executable computer code that when executed by an system comprising at least one processor, a first memory, a first memory charge pump and a second memory performs the method according to the first aspect.
According to a fourth aspect, this invention therefore relates also to an system comprising at least one processor, a first memory, a first memory charge pump and a second memory configured to perform the method according to the first aspect.
The following description and the annexed drawings set forth in detail certain illustrative aspects and are indicative of but a few of the various ways in which the principles of the embodiments may be employed. Other advantages and novel features will become apparent from the following detailed description when considered in conjunction with the drawings and the disclosed embodiments are intended to include all such aspects and their equivalents.
The invention aims at securing the execution of a security related process comprising a silent programing of a memory area of a non-volatile memory (NVM), called first memory, of a system.
The system 100 may further include a connector 106 connected to the processor.
The system 100 may also include input/output means 107 providing interfaces to the user of the system 100, such as one or more screens, loudspeakers, a mouse, tactile surfaces, a keyboard etc.
The system 100 further includes a first memory charge pump 108 operable to program memory areas of the first memory.
The invention takes place in the context of the execution of a security related process using as input security data stored in the first or second memory and performing at least a first operation. Such a security related process may for example be a cryptographic process generating a ciphered value or a signature, or an operation copying a secret key. Such security data may be sensitive data such as identity data or a secret key. It may also comprise the code to be executed to perform some operations of the security related process.
The security related process may comprise a write operation in a non-volatile memory as a routine operation, for example for updating a counter indicating a number of time a particular process or a key has been used. It may also comprise such a write operation as a counter measure when an attack is detected during the execution of the security related process. For example, if an attack is detected during the execution of this at least one operation, a NVM programming of a memory area is requested in order to update in the NVM a security counter value indicating a number of time an attack has been detected. In the following paragraphs, it is supposed that the memory area programmed by the NVM programming operation is located in a first memory row of the first memory.
The system may further comprise one or more hardware security sensors or it may be configured for executing a software countermeasure, such that these sensors or software countermeasure are able to detect an abnormal behavior likely to be the result of an attack. In such a case, the programming operation of the first memory may comprise writing, in the first memory, permanent security counters logging some abnormal behavior detected by said hardware security sensor or said software countermeasure.
As shown on
The main idea of the invention, in order to make such a programming of the first memory invisible to an attacker, is to anticipate the pump charging step and row opening step at the very beginning of the execution of the security related process. By doing so, the charging pump is already ready to program the first memory when such a programming is required and the programming step may be performed much more quickly, without inducing any power consumption spike.
The following paragraphs describe more precisely the steps of the method according to the invention, shown on
During a first step S1, the system may copy the security data from the first memory to the second memory. This operation is necessary when the security data are not already stored in the second memory, in order to keep the security data available after the charge pump of the first memory has been charged, which will be performed in the next step. Indeed, charging the charge pump makes it impossible to perform any reading operation in the first memory until the first memory programming is performed, the pump discharged and the row is closed. Copying the security data to the second memory guaranties that the processor will be available to read it when the data is needed as input for executing operations of the security related process. This first step is performed if needed as soon as the execution of the security related process is triggered.
In a second step S2, the system opens the first memory row of the first memory. At the end of this step, the system is ready to program a memory area of the first memory row despite no programming request has been issued yet.
In a third step S3, the system charges the first memory charge pump. This step may be performed either before or after the second step S2.
In a fourth step S4, the system performs the first operations of the security related process, based on the security data from the second memory. During this step, the security data, needed as input data to the first operations, may not be accessed in the first memory because the charge pump is in a charged state. Therefore, the processor of the system reads the security data in the second memory where it has been copied if needed during the first step described above. At the end of the first operations, a programming of the first memory may be requested, either by the first operations themselves, or because an abnormal behavior was detected during the execution of the first operations and because for example the update of a counter or a log in the first memory is needed.
In a fifth step S5 the programming operation of said memory area in said opened first memory row is performed using said charged charge pump.
The fifth step S5 may be skipped when no programming operation of the NVM is requested, for example when such a programming would be triggered by the detection of an attack but no attack has been detected.
In a sixth step S6 the first row may be closed.
The current consumption of the system resulting from these steps is shown on
In addition, the time between the issuance of the request to program the first memory, issued by the first operations or because an attack has been detected at some point during their execution, and the closing of the first row is much shorter. On
A spike in the current consumption may still be visible when the charge pump is charged, before the execution of the first operations. In order to reduce or avoid such a spike, the charge pump may be charged at a predetermined lower frequency, for example up to 8 times lower than usual.
According to a second aspect, this invention therefore relates also to a computer program product directly loadable into the memory of at least one computer, comprising software code instructions for performing the steps of the methods according to the first aspect when said product is run on the computer.
According to a third aspect, this invention therefore relates also to a non-transitory computer readable medium storing executable computer code that when executed by an system 100 above described performs the methods according to the first aspect.
According to a fourth aspect, this invention therefore relates also to an system 100 above described comprising a processor 101, a first memory 103, a first memory charge pump 108 and a second memory 104 configured to perform the methods according to the first aspect.
Number | Date | Country | Kind |
---|---|---|---|
19306678.4 | Dec 2019 | EP | regional |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/EP2020/086662 | 12/17/2020 | WO |