Abstract:
Disclosed is a method and apparatus to increase the security of an integrated circuit, the integrated circuit including at least one microprocessor, one or more security sensors to detect abnormal conditions of operation, and registers accessible by the microprocessor which store a state of a respective sensor. The microprocessor reads the contents of a register only at the end of a random period where the duration of the random period is determined by a number generated by a random number generator.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The invention relates to a method and a device used to improve the security of an integrated circuit which can be applied especially to Integrated Circuit (IC) cards for which protection must be provided against all attempts at fraudulent use. These are, for example, cards used in banking applications or cards used for controlling access to protected premises. For these applications, integrated circuits have at least one microprocessor and a volatile memory containing confidential information. The information should not be damaged or retrieved by fraudulent action. 
     2. Description of the Related Art 
     To this end, there are many security sensors designed to detect abnormal operating conditions in order to prohibit the operation of the integrated circuit. 
     Thus, among the sensors designed, there is a sensor to detect excessively low frequencies (an excessively low frequency makes it easier to spy on internal operations), a sensor to detect excessively high voltage or excessively low voltage (because an excessively high or excessively low voltage may degrade the contents of the memory cells that are read or written in), a sensor to detect excessively high or excessively low temperatures and a depassivation or light sensor. 
     The security sensors each deliver a binary signal whose state indicates a normal operation or an anomaly. These binary signals are used to secure the integrated circuit. 
     The binary signals may directly trigger a physical protection system, for example, the locking of the clock, enforced permanent initialization or other similar systems. 
     The binary signals may also be used in the context of a software protection system. A storage register is then associated with each of the sensors. The different registers are sampled by the microprocessor which decides to take account or not take account of the different alarms and, as the case may be, decides on the action to be undertaken: namely re-initialization, locking, destruction of confidential data, etc. 
     The registers are generally of a monostable type. The detection of an alarm makes them flip over and only a secured reinitialization procedure, managed by the microprocessor, can reset them to an initial state. 
     The sensors could be managed by means of program interruptions where the flipping over of a register of a sensor prompts a microprocessor interruption, with a corresponding program for the management of the interruption. In practice,however, the microprocessor interruption signals are not as numerous, and they are reserved for other uses. 
     It is therefore preferred to carry out a sequential operation of the sensors under software control. Such an operation makes it possible to set up degrees of security depending on the applications and also makes it possible to manage false alarms. 
     This sequential approach is more flexible since it makes it possible to avoid systematic locking operations. The state of the sensors is then controlled sequentially, during the performance of the different instructions in the software program. It has been noticed, however, that the sequential use of the states of the sensors could be subverted in a fraudulent manner. 
     Indeed, if a fraudulent individual is capable of determining the different instructions sequentially performed by the microprocessor, he or she could manage to determine the precise moment in the sequence when the state of one or more of the sensors is read. For a given operation (for example, turning on the voltage, waiting for an operator&#39;s instruction, performing reading operation or a programming or verification of an identification code), since these are sequential instructions, this moment is always the same. 
     All that would be needed then would be to ensure that there are normal conditions before or just when the state of the sensor is read, and to modify these conditions just afterwards. When the microprocessor reads the sensors, the corresponding conditions would appear to be normal. The microprocessor therefore continues normal performance. But in fact, the operating conditions are changed just afterwards and are no longer &#34;normal&#34;. 
     It has therefore been observed that the sequential use of the state of the sensors, which is admittedly more flexible than an operation by interruption, could nevertheless make it possible to bypass the checking of the security sensors. After the reading of the sensor or sensors, subsequent changes are not seen by the microprocessor so long as it does not perform a new check. Now, it is not possible to read these sensors continuously, for the progress of the programs would be excessively slowed down. Generally, a reading is done at initialization and at least once at an appropriate time for each subprogram, for example, just before a strategic operation. 
     An object of the invention is to secure the process of checking the security sensors. If it is possible to prevent the determining of the moment or moments when the sensors are read, then it will be far more difficult to manage to impose abnormal conditions on the integrated circuit without this being detected by the microprocessor. 
     SUMMARY OF THE INVENTION 
     The invention therefore relates to a method for increasing the security of an integrated circuit comprising at least one microprocessor and one or more security sensors to detect abnormal conditions of operation, registers accessible by the microprocessor being designed to each store a state of a respective sensor. 
     According to the invention, the method consists of, for at least one of the registers, when the microprocessor receives an instruction to read this register, the microprocessor implements this reading operation only at the end of a random period of time after receiving the instruction. Whenever the microprocessor has to read the register, it fixes a random value to initialize a counting loop and counts through the loop before implementing the reading operation. 
     The invention also relates to a device for the implementation of such a method, comprising a pseudo-random generator coupled to the microprocessor. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     Other features and advantages are specified in the following description, given by way of an indication that does not restrict the scope of the invention and with respect to the appended drawings, of which: 
     FIG. 1 is a functional block diagram of an integrated circuit used in relation to a device according to the present invention; and 
     FIG. 2 is a flow chart corresponding to a method according to the invention. 
    
    
     DETAILED DESCRIPTION 
     According to the invention, and as shown in FIG. 1, an integrated circuit comprises a microprocessor μP 1, a program memory ROM 3, a non-volatile memory 5, for example of the E 2  PROM type, and security sensors C1, C2, C3 to detect abnormal operating conditions. As shown in FIG. 1, C1 detects an excessively high temperature, C2 detects an excessively low frequency and C3 detects an excessively high supply voltage. It has been seen further above that other sensors in addition to these could be designed to detect a depassivation or excessively low temperature or voltage, etc. These sensors are commonly used and are well known to those skilled in the art. Their manufacture shall therefore not be given in detail. 
     These sensors C1, C2, C3 deliver a binary logic information element indicating normal operation or an alarm as the case may be. This information element is stored in a register that is read by the microprocessor 1. As shown in FIG. 1, registers R1, R2, R3 are associated with sensors C1, C2, C3, respectively. The registers R1, R2, R3 are accessible by the microprocessor 1. 
     According to the invention, the integrated circuit includes a pseudo-random generator GA 7 to provide a random value n upon a command issued by the microprocessor 1. The microprocessor 1, ROM 3, E 2  PROM 5, random number generator GA 7 and sensors C1, C2, C3 and associated registers are all commonly connected to an I/O bus 9. In order to provide fault-tolerance, a second I/O bus 11 is also provided in the event of a failure of I/O bus 9. The microprocessor 1 can therefore access the contents of the ROM 3, E 2  PROM 5 and receive a random number generated by GA 7. 
     When the microprocessor 1 performs a subprogram in response to an initialization signal or an external command and executes an internal instruction to test a sensor, the microprocessor 1 starts by asking for a value n from the pseudo-random generator GA 7 to initialize a counting loop. When the number n has been counted out (at the rate of the instruction cycle of the microprocessor), the microprocessor 1 reads the register of the sensor to process the value in the register according to a program for the management of anomalies. 
     If the integrated circuit has several sensors, the microprocessor may apply this method to all the sensors or only to some of them. The microprocessor 1 applies the method at least to the first sensor tested sequentially. In the example shown in FIG. 2 of a sequence for testing the sensors, this method is applied to the sensors C1 and C3 of FIG. 1, not to the sensor C2. 
     As shown in FIG. 2, at step ST1 the microprocessor 1 receives an instruction to test sensor C1. At a next step ST3, a random number n is generated. A number n of microprocessor clock cycles is counted. As shown in step ST5, the number n is decreased by one for each clock cycle. The value of n is checked at step ST7 and if the value is not zero, program flow returns to step ST5. If the value is zero, the register of sensor C1 is read at step ST9. As discussed above, the random delay does not need to be applied to the reading of each of the sensors. As also shown in FIG. 2, when an instruction is received requesting a reading of sensor C2, as at step ST11, the microprocessor immediately reads the value in the register associated with sensor C2 without waiting for a randomly determined period of time. In steps ST15-ST23, sensor C3 and the associated register are read in a manner similar to that disclosed above in regard to sensor C1 and steps ST1-ST9. 
     One of ordinary skill would see that step ST5 could also be performed as a counting up from zero to a time n. Counting up from zero to a time n and counting down from time n to zero are equivalent ways to measure a duration n. In addition, the duration has been described as n number of clock cycles. The number n could also represent other units of time such as seconds. The duration could then be measured by a real time clock or other equivalent means at the disposal of the microprocessor. This is all understood by one of ordinary skill in the art. 
     In this way, a random period is introduced into the sequential program. This makes it difficult to determine the time when the sensors are read. However, the duration of the program is lengthened. 
     It is therefore necessary, depending on the degree of security sought, to assess the delay that can be accepted in the performance of the program. For example, it is possible to determine a range of the random number as a function of the nature of the sensor to be tested. If maximum security is desired, the method of the invention is applied to all the sensors of the integrated circuit. 
     Having thus described at least one illustrative embodiment of the invention, various alterations, modifications, and improvements will readily occur to those skilled in the art. Such alterations, modifications, and improvements are intended to be within the spirit and scope of the invention. Accordingly, the foregoing description is by way of example only and is not intended as limiting. The invention is limited only as defined in the following claims and the equivalents thereto.