Method of protecting electronic circuit against eavesdropping by power analysis and electronic circuit using the same
10374791 ยท 2019-08-06
Assignee
Inventors
Cpc classification
G09C1/00
PHYSICS
H04L9/0618
ELECTRICITY
H04L9/003
ELECTRICITY
International classification
G06F1/12
PHYSICS
G09C1/00
PHYSICS
H04L9/06
ELECTRICITY
Abstract
An electronic circuit with protection against eavesdropping by power analysis is provided. The electronic circuit includes: a storage element for storing a set of bits; a logic unit for processing the stored set of bits and providing a next state set of bits after two or more cycles, wherein in a first cycle, some of the stored set of bits are provided to the logic unit correctly and some are replaced by random values and in a last cycle, all of the stored set of bits are provided to the logic unit correctly; and a random bit generator that generates a random bit for each bit of the stored set of bits to determine which bits of the stored set of bits are to be provided correctly and which bits are to be replaced in each cycle.
Claims
1. An electronic circuit with protection against eavesdropping by power analysis, comprising: a storage element, configured to store a set of bits; a random bit generator, configured to generate random bits corresponding to the stored set of bits respectively; a selector, coupled to the storage element and the random bit generator, configured to output at least one replaced bit by replacing at least one bit of the stored set of bits with a random value or an opposite value according to the random bits; a combinatorial logic unit, coupled to the selector, configured to perform logic calculations in at least two cycles and provide a next state set of bits after the at least two cycles to the storage element, wherein the combinatorial logic unit is configured to perform a first logic calculation on the output of the selector including the at least one replaced bit under a first distribution of power consumption in a first cycle, and is configured to perform a last logic calculation on all of the stored set of bits under a second distribution of power consumption in a last cycle, and wherein the combinatorial logic unit is configured to obtain some of the stored initial set of bits from the storage element in the first cycle and replacing the rest of the bits which have been replaced by the random values in the first cycle with the corresponding bits of the stored initial set of bits after the first cycle and before the last cycle.
2. The electronic circuit according to claim 1, wherein the electronic circuit is driven by two clock signals, and one of the clock signals is with half a frequency of the other, and the first distribution of power consumption is different from the second distribution of power consumption.
3. The electronic circuit according to claim 1, further comprising an intermediate storage unit associated with the storage element for storing the stored set of bits for use in the last cycle.
4. The electronic circuit according to claim 1, wherein the selector is controlled by the random bits to select between the random value provided by the random bit generator and a corresponding one bit of the stored set of bits.
5. The electronic circuit according to claim 1, wherein the stored set of bits are stored in the storage element in an encrypted form.
6. The electronic circuit according to claim 5, wherein the stored set of bits are decrypted when provided to the combinatorial logic unit.
7. The electronic circuit according to claim 1, wherein in a second cycle, the at least one replaced bit is further replaced with a correct value coming from the at least one bit of the stored set of bits and provided to the logic combinatorial unit.
8. The electronic circuit according to claim 1, wherein half of the stored set of bits are replaced by the random values provided by the random bit generator in the first cycle.
9. The electronic circuit according to claim 1, wherein a random number of the stored set of bits are replaced by the random values provided by the random bit generator in the first cycle.
10. The electronic circuit according to claim 1, wherein the at least one replaced bit that is randomly selected is set to be the opposite value of a corresponding one bit of the stored set of bits.
11. A method of protecting an electronic circuit against eavesdropping by power analysis, comprising: storing an initial set of bits corresponding to correct values to a storage element; generating, by a random bit generator, random bits corresponding to the stored initial set of bits respectively; replacing at least one bit of the stored initial set of bits with a random value or an opposite value according to the random bits by a selector; performing logical calculations in at least two cycles by a combinatorial logic unit, wherein, in a first cycle of the at least two cycles, performing a first logical calculation on an intermediate set of bits including the at least one replaced bit and a part of the stored initial set of bits under a first distribution of power consumption; and in a last cycle of the at least two cycles, performing a last logical calculation on all of the stored initial set of bits under a second distribution of power consumption to provide a next state set of bits; storing the next state set of bits to the storage element; and obtaining some of the stored initial set of bits from the storage element in the first cycle and replacing the rest of the bits which have been replaced by the random values in the first cycle with the corresponding bits of the stored initial set of bits after the first cycle and before the last cycle.
12. The method according to claim 11, wherein the electronic circuit is driven by two clock signals, and one of the clock signals is with half a frequency of the other.
13. The method according to claim 11, further comprising storing the initial stored set of bits for use in the last cycle to an intermediate storage unit associated with the storage element.
14. The method according to claim 11, wherein the first distribution of power consumption is different from the second distribution of power consumption.
15. The method according to claim 11, wherein the step of storing the initial set of bits further comprises encrypting the initial stored set of bits.
16. The method according to claim 15, wherein the step of in the last cycle of the at least two cycles, performing the last logical calculation on all of the stored initial set of bits further comprises decrypting the stored initial set of bits before performing the last logical calculation.
17. The method according to claim 11, wherein half of the stored initial set of bits are replaced by the random values provided by the random bit generator in the first cycle.
18. The method according to claim 11, wherein a random number of the stored initial set of bits are replaced by the random values provided by the random bit generator in the first cycle.
19. The method according to claim 11, wherein the at least one replaced bit that is randomly selected is set to be the opposite value of a corresponding one bit of the stored set of bits.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
DESCRIPTION OF THE EMBODIMENTS
(10) Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.
(11)
(12) In an exemplary embodiment of the disclosure, a general purpose computer 130 is programed to communicate with the cryptographic device 110, for example to provide instructions to the cryptographic device 110 and receive unencrypted transaction information. Optionally, during use, the cryptographic device 110 reads encrypted information e.g. from a smartcard 120 and provides unencrypted information to the computer 130 to perform a transaction. In an exemplary embodiment of the disclosure, the oscilloscope 140 monitors the power consumption of the cryptographic device 110 and provides a recorded signal 160 to the computer 130 for analysis. Optionally, based on the information from the cryptographic device 110 and/or the oscilloscope 140, the computer 130 can determine the cryptographic keys or other confidential information used in encrypting the information.
(13)
(14)
(15) In an exemplary embodiment of the disclosure, there are two locations that are vulnerable with respect to a power attack and may serve as potential leaks for the content of the logic circuit (e.g. 200 and 300). The first location is from the logic unit (e.g. 210, 310) during calculation of the next value/state, and the second location is when updating the storage, e.g. when storing the next value/state back into the storage element (e.g. 220, 320). In an exemplary embodiment of the disclosure, to prevent an eavesdropper from using power analysis to determine the current contents of the logic circuit, the calculation is split into two or more cycles.
(16)
(17) In an exemplary embodiment of the disclosure, the logic circuit 400 includes a random bit generator 440 that provides m random bits (R0, R1 . . . Ri . . . Rm) like the storage element 420. Optionally, a random bit Ri having a value of zero signifies that the bit stored in the flip flop Si is to be transferred to the logic unit 410 in a first cycle, whereas a random bit Ri having a value of one signifies that the bit stored in the flip flop Si is to be transferred to the logic unit 410 only in a second cycle. The random bits Ri randomly select 1 or more or of bits stored in the flip flops S0 to Sm to be processed by the combinatorial logic unit 410 in the first cycle and select the rest bits to be processed by the combinatorial logic unit 410 only in the second cycle. Optionally, the random bit generator 440 may provide a random bit sequence in which half of the bits are zero so that half of the bits are processed in the first cycle and then all of the bits are processed in the second cycle. This splits up the calculation processed by the combinatorial logic unit 410 into two cycles and protects the calculation from being deciphered by power analysis. In some embodiments of the disclosure, the calculation may be split into more than two cycles.
(18) In an exemplary embodiment of the disclosure, a selector Li (L0 and L1 are shown in
(19)
(20) In the first cycle, some of the bits stored in the flip flops Si are transferred from storage element 420 to the combinatorial logic unit 410 and some bits are replaced by random values (step 630). The random bits Ri determine which bits are transferred and which bits are replaced in the first cycle. In the second cycle, all of the bits are transferred from the storage element 420 to the combinatorial logic unit 410 (the random bits are replaced by the real bits) (step 640). Optionally, in the second cycle, fewer bits change from 0 to 1 consuming a lot of power in the combinatorial logic unit 410, since about half are already changed in the previous cycle. The result of the processing by the combinatorial logic unit 410 serve as the next state bits Ni (540) to be stored back into the storage element 420 (step 650).
(21) In an exemplary embodiment of the disclosure, a time line 560 shows a standard power usage by a logic circuit relative to a timeline 570 that shows the power consumption randomly split into two parts over the two cycles. Some of the bits are set correctly in the first cycle and some are only corrected in the second cycle.
(22)
(23)
(24) In an exemplary embodiment of the disclosure, the enhanced logic circuit 400 may be designed to support three or more cycles in a similar manner as described above, for example changing some of the bits to the correct values in the first cycle, changing some bits in the second cycle and changing some bits in a third cycle. Optionally, each cycle may introduce the same number of correct bits.
(25) It should further be appreciated that the above described methods and apparatus may be varied in many ways, including omitting or adding steps, changing the order of steps and the type of devices used. It should be appreciated that different features may be combined in different ways. In particular, not all the features shown above in a particular embodiment are necessary in every embodiment of the disclosure. Further combinations of the above features are also considered to be within the scope of some embodiments of the disclosure. It will also be appreciated by persons skilled in the art that the present disclosure is not limited to what has been particularly shown and described hereinabove.
(26) It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.