US20120311239A1 - Data interleaving scheme for an external memory of a secure microcontroller - Google Patents
Data interleaving scheme for an external memory of a secure microcontroller Download PDFInfo
- Publication number
- US20120311239A1 US20120311239A1 US13/483,669 US201213483669A US2012311239A1 US 20120311239 A1 US20120311239 A1 US 20120311239A1 US 201213483669 A US201213483669 A US 201213483669A US 2012311239 A1 US2012311239 A1 US 2012311239A1
- Authority
- US
- United States
- Prior art keywords
- integrity
- words
- data
- word
- external memory
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000015654 memory Effects 0.000 title claims abstract description 182
- 238000000034 method Methods 0.000 claims abstract description 96
- 230000006870 function Effects 0.000 claims description 5
- 238000012545 processing Methods 0.000 claims description 3
- 230000001172 regenerating effect Effects 0.000 claims 1
- 230000000737 periodic effect Effects 0.000 abstract description 8
- 238000012986 modification Methods 0.000 description 8
- 230000004048 modification Effects 0.000 description 8
- 238000013506 data mapping Methods 0.000 description 7
- 239000000243 solution Substances 0.000 description 6
- 238000013507 mapping Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000013478 data encryption standard Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000002347 injection Methods 0.000 description 2
- 239000007924 injection Substances 0.000 description 2
- 238000010200 validation analysis Methods 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000001351 cycling effect Effects 0.000 description 1
- 238000013524 data verification Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 230000002285 radioactive effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0894—Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/14—Protection against unauthorised use of memory or access to memory
Definitions
- the present invention relates generally to a secure microcontroller using an external memory, and more particularly to methods, systems and devices for performing integrity check by interleaving payload data and integrity control data in an external memory interfaced with a secure microcontroller.
- a microcontroller is normally a single integrated circuit comprising a central processing unit (CPU) core, memory, and input/output (I/O) peripherals.
- a secure microcontroller is used for applications that involve trusted operations on valuable assets in an insecure environment where a thief or hacker may gain access to processor cores, memory devices or I/O peripherals that are used to communicate and process sensitive data.
- This sensitive data may include account numbers, access codes, personal identification number (PIN), cryptographic keys, financial transactions/balances, rights management, and metering (e.g., energy, units).
- PIN personal identification number
- this sensitive data may be programs or instructions employed to control the CPU core or the I/O peripherals.
- Various security features have been employed to avoid unauthorized access to these sensitive data. To date, the secure microcontroller has been applied in a wide range of security-critical applications such as electronic banking, commercial transactions, and pay-TV access control, or any application that requires the protection of proprietary software and methods.
- the sensitive data may be stored in an external memory of the secure microcontroller
- memory content confidentiality and integrity are two distinct threats that should be addressed.
- the first threat causes sensitive information disclosure (i.e., data confidentiality) where confidential data are revealed and weakness in a program is exposed.
- the second threat causes modification of application behavior (i.e., data integrity) which involves programs and data being modified in the external memory and results in a data integrity issue.
- the secure microcontroller is designed to offer a level of security to the sensitive data stored in the external memory. For instance, physical security may be established against probing by anti-tampering enclosure. However, this solution may be expensive and does not cover new attack methods based on fault injection from power supply glitch, light, synchronous or asynchronous laser, or radioactive particles.
- the security features may also comprise memory encryption where the sensitive data stored in the external memory are encrypted or decrypted using cryptographic keys in the secure microcontroller during the data exchanging process. The cryptographic keys are stored locally within the secure microcontroller. As a result, the physical security perimeter can be limited to the microcontroller while the external memory and their communication buses can remain exposed physically.
- encryption does not provide by itself sufficient integrity protection.
- EBC Electronic Code Book mode
- the corrupted cryptotext is decrypted to a plaintext, and due to actual data modification/corruption, the plaintext is associated with a different value than an expected value.
- the decryption algorithm itself does not flag any error, the resulting plaintext is still regarded as a legitimate value.
- the underlying data format can be used to identify data corruption, and for some data formats, this corruption may be difficult to identify.
- a typical example of insufficient data integrity in a microcontroller is a financial transaction where only the money amount is encrypted.
- a modified cryptotext would lead to a corrupted plaintext, potentially corresponding to an amount larger than the actual amount.
- Insufficient data integrity also occurs in protection of microcontroller instructions stored in the memory based on code encryption.
- a randomly modified cryptotext instruction would be decrypted into a modified plaintext instruction that does not match with the original plaintext instruction.
- This erroneous plaintext instruction can be considered as legitimate according to the particular microprocessor instructions set and its coverage of a plain space.
- MIPS 4KSd core instructions are 32-bit long. Only 56% of any 32-bit instructions are associated with valid core instructions, and remaining 44% 32-bit instructions are considered by the microcontroller as unlawful and rejected by issuing a microcontroller exception.
- a 64-bit encryption algorithm such as the Data Encryption Standard (DES)
- DES Data Encryption Standard
- the probability is approximately 30% for both of these two words to be legitimate core instructions.
- the probability is 70% to detect a cryptotext modification and an unlawful 32-bit instruction in a corrupted 64-bit DES system.
- Data integrity control is implemented for the sensitive data stored in the external memory to detect any willing or unwilling corruption between what was originally sent for storage and what is stored in the memory.
- Specific integrity check methods are used to generate integrity control data (i.e., a tag or signature) during a memory write operation, and validity of the stored data are verified by its consistency with the corresponding integrity control data during a memory read operation.
- Integrity control constitutes a sufficient protection against fault injection attacks, and integrity control modules may be embedded in the secure microcontroller to ensure a sufficient level of trust to stakeholders.
- integrity check methods may be employed.
- the simplest integrity check method is 1-bit even/odd parity check, wherein one integrity control bit is generated to maintain an even or odd parity among all the bits in the data.
- Alternative integrity check methods range from simple methods of cycling redundant check (CRC) or error correction/correcting code (ECC) to strong and proven methods, such as message authentication code (MAC).
- CRC cycling redundant check
- ECC error correction/correcting code
- MAC message authentication code
- simple integrity check methods are mostly sufficient to protect against unwilling corruption; however, strong and proven methods are mandatory for protection against willing or active corruption.
- a simple method e.g., ECC
- a secret element i.e., a cryptographic key
- Attackers are prevented from an easy modification since the secret element needs to be recovered first.
- FIG. 1 illustrates a secure microcontroller 102 interfacing with an encrypted memory 104 .
- the aforementioned data confidentiality and integrity concerns are considered in this microcontroller.
- the secure microcontroller 102 comprises a CPU core 106 , a memory controller 110 and buses for data, addresses and keys. Methods for integrity check, data encryption or data decryption are incorporated in the CPU core 102 .
- original data are encrypted in the CPU core 106 to payload data for storing in the memory 104 .
- payload data from the memory 104 are decrypted to original data in the CPU core 106 .
- Integrity control data are generated and commonly stored in an internal memory inside the CPU core 106 during a memory write operation, and extracted for data integrity check during a subsequent memory read operation.
- the integrity control data are commonly stored in a dedicated location using static memory addresses.
- This solution is applied in many prior art microcontrollers to store their respective integrity control data, e.g., the reference hash value in the U.S. Pat. No. 5,708,274 and the integrity check value in French Patent 1,885,709.
- This conventional solution may require intensive usage of internal memory, and therefore, may be an expensive solution, even though the data access rate is satisfactory.
- Various embodiments of the present invention relate to a secure microcontroller using an external memory, and more particularly to methods, systems and devices for performing integrity check by interleaving payload data and integrity control data in an external memory interfaced with a secure microcontroller.
- a plurality of data words and a plurality of logic addresses are generated in a microcontroller, and each data word is associated with a logic address.
- Each data word is used to generate a respective integrity word based on an integrity check method, while the associated logic address is translated to a first physical address for the data word and a second physical address for the integrity word in the external memory.
- the data words and the associated integrity words are interleaved in the external memory based on a data mapping method, and the physical addresses for the data and integrity words are dynamically determined.
- the external memory may be ROM, RAM or flash memory, and may have dedicated regions for the data words and the integrity words, respectively.
- each data word may be associated to an integrity sub-word, and several integrity sub-words form an integrity word having the same length with that of a data word. Therefore, associated data words alternate with this integrity word in a periodic scheme.
- the microcontroller using an external memory to store the data and integrity words is configured to generate two physical addresses in the external memory for each data word and associated integrity word.
- an embedded encryption and integrity protection block may comprise an address translator to implement a data mapping method, and an integrity control data generator to generate integrity words.
- the involved data words and integrity words are stored in the external memory.
- the embedded encryption and integrity protection block also comprises a plurality of function blocks for data encryption/decryption and temporary storage of integrity sub-words.
- FIG. (“FIG.”) 1 illustrates a secure microcontroller interfacing with an external memory where security and integrity concerns are considered.
- FIG. 2 illustrates an exemplary block diagram of a secure microcontroller system comprising a secure microcontroller interfacing with an external memory according to various embodiments of the invention.
- FIG. 3( a ) illustrates a method of generating and storing interleaving data word and integrity word in the external memory according to various embodiments of the invention.
- FIG. 3( b ) illustrates a method of extracting a data word and an integrity word from an external memory according to various embodiments of the invention.
- FIG. 4 illustrates an exemplary block diagram of the encryption and integrity protection block according to various embodiments of the invention.
- FIG. 5 illustrates an exemplary data interleaving scheme in the external memory according to various embodiments of the invention.
- FIG. 6 illustrates another exemplary data interleaving scheme in the external memory according to various embodiments of the invention.
- FIG. 7 illustrates an exemplary data interleaving scheme in the external memory according to various embodiments of the invention.
- FIG. 8 illustrates an exemplary method of mapping logic addresses of data in a data block to physical addresses in the external memory according to a data interleaving scheme according to various embodiments of the invention.
- the present invention relates generally to a secure microcontroller using an external memory, and more particularly to methods, systems and devices for performing integrity check by interleaving payload data and integrity control data in an external memory interfaced with a secure microcontroller.
- connections between components or between method steps in the figures are not restricted to connections that are effected directly. Instead, connections illustrated in the figures between components or method steps may be modified or otherwise changed through the addition thereto of intermediary components or method steps, without departing from the teachings of the present invention.
- FIG. 2 illustrates an exemplary block diagram 200 of a secure microcontroller system comprising a secure microcontroller 220 interfacing with an external memory according to various embodiments of the invention.
- the secure microcontroller 220 comprises a CPU core 206 , an encryption and integrity protection block 208 , a memory controller 210 , a key storage 212 and buses for data, addresses and keys.
- the encryption and integrity protection block 208 is used to implement address mapping, integrity data computation, integrity check, data encryption and data decryption.
- integrity control data are generated by the block 208 and subsequently stored in the encrypted and integrity protected memory 240 (i.e., external memory 240 ) so that internal memory space in the CPU core 206 does not need to be reserved for integrity control data.
- the encryption and integrity protection block 208 and the memory controller 210 are adjusted to generate and access physical addresses in the external memory not only for payload data but also for the corresponding integrity control data.
- integrity management e.g., ECC
- ECC integrity management
- the external memory 240 is partitioned to at least one plain content region 214 , and at least one encrypted content region 216 .
- the content stored in the encrypted content region 216 may comprise payload data and integrity control data.
- the payload data are encrypted programs or data associated with confidential information, e.g., user names, passwords, transactions etc.
- Each integrity control data is derived from the original data or encrypted data (i.e., payload data) according to a specific integrity check method which may be proprietary in some instances.
- Payload data and integrity control data are stored as payload data words (i.e., data words) and integrity control data words (i.e., integrity words) in the external memory 240 , respectively, and lengths of these words are associated with memory type and methods for encryption and integrity check.
- One convenient solution is to store the data words and the integrity control data words in their respective dedicated regions in the external memory 240 . Memories within specific address ranges are configured to store the data words and the integrity control data, respectively. As a result, a data word and its associated integrity word are stored at two memory cells that may be physically distant from each other and may even be located at two separate memory pages.
- the integrity words are interleaved with the data words in the external memory 240 according to a regular data interleaving scheme to improve performance.
- the regular data interleaving scheme simplifies data flow and avoids jump mechanism by retrieving the integrity words in dedicated integrity storage locations that are adjacent to associated data storage locations.
- the regular data interleaving scheme is preferred for paginated memories, such as SDRAM, wherein jumping among pages requires extra page switching time and degrades memory access rate significantly.
- a periodic scheme is employed wherein every few data words may be interleaved with an integrity word directly associated with these data words.
- the encryption and integrity protection block 208 performs an automatic remapping of the external memory 240 such that the CPU core 206 may fetch data and programs/instructions without identifying addresses for associated integrity words.
- the external memory 240 is allocated to store the payload data and the integrity control data dynamically.
- the external memory 240 may comprise more than one memory among RAM, ROM and flash memory.
- the secure microcontroller 220 interfaces to various memories in the external memory 240 without configuring dedicated data regions for each memory. As more than one memory is involved, address mapping for certain data interleaving schemes is implemented dynamically in the encryption and integrity protection block 208 .
- the CPU core 206 provides data and logic addresses to the encryption and integrity protection block 208 which further encrypts the data to payload data using an encryption method.
- the encryption method is based on the logic addresses and a key, and the key is fixed or randomly generated by the CPU core 206 and stored in the key storage 212 .
- the encryption method is directly based on a physical address translated from the logic address.
- Integrity control data are generated in the encryption and integrity protection block 208 using a predetermined integrity check method based on the data.
- at least one cryptographic key is used to generate the integrity control data.
- the block 208 In addition to encrypting the data and generating the corresponding integrity control data, the block 208 also translates the input logic addresses to two separate physical addresses, one for the payload data and the other for the integrity control data.
- the memory controller 210 identifies the physical addresses in the external memory 240 and stores the payload data and the integrity control data as specified by the physical addresses.
- a logic address is provided by the CPU core 206 to extract specific payload data from the external encrypted and integrity protected memory 240 .
- the encryption and integrity protection block 208 translates the logic address to recover two physical addresses for the payload data and the associated integrity control data, respectively.
- the method used in this address-recovery process is similar to the method used to translate the logic address when the data need to be stored during the memory write operation.
- the memory controller 210 enables the access to memory contents stored at the specified physical addresses, and the encryption and integrity protection block 208 is coupled to receive the payload data and the integrity control data from the encrypted and integrity protected memory 240 .
- a decryption method may be implemented to use the logic address and the key stored in the key storage 212 to recover the payload data while the associated integrity data are extracted from the memory 240 . Data recovered from the payload data are processed using the same integrity check method that is formerly used to generate the integrity control data.
- the integrity control data regenerated from the recovered data are consistent with the integrity control data extracted from the external memory 240 , then the recovered data are valid and subsequently provided to the CPU core 206 ; otherwise, an error is acknowledged and a dedicated hardware is employed to raise a CPU exception based on the security policy of the microcontroller.
- the CPU exception may be exploited to erase the sensitive data, trigger a non-maskable interruption, write a value in a flag register, reset the microcontroller, or run a dedicated code.
- Data interleaving enhances cost efficiency of the secure microcontroller.
- the integrity control data are stored in the internal memory, while in the present invention, this internal memory may be spared since at least a portion associated with the integrity control data is moved to the encrypted and integrity protected memory 240 located externally to the CPU core. The cost for the CPU core will be largely reduced due to availability of this secure integrity data storage in the external memory.
- FIG. 3( a ) illustrates a method 300 of generating and storing interleaving data and integrity words in the external memory 240 according to various embodiments of the invention.
- a data word and its logic address within a data block are received at step 302 .
- the data word is further encrypted based on a predetermined encryption method at step 304 , and an integrity word is generated from the data word based on a predetermined integrity check method at step 306 .
- the integrity word may also be generated from the encrypted data word (i.e., payload data).
- the logic address is mapped to two physical addresses in the external memory at step 310 , one physical address for the encrypted data word (i.e., payload data) and the other physical address for the integrity word (i.e., integrity control data).
- a data interleaving scheme may be incorporated in step 310 .
- the data word and the integrity word may be stored in the memories addressed by the two physical addressed, respectively, at step 312 .
- FIG. 3( b ) illustrates a method 350 of extracting a data word and an integrity word from an external memory 240 according to various embodiments of the invention.
- a logic address within a data block is received at step 352 for an interested data word.
- the logic address is used to identify two physical addresses for the data word and integrity word at step 354 according to a data interleaving scheme.
- the data word and integrity word are therefore extracted from the specified physical addresses at step 356 .
- the data word is decrypted at step 358 based on a decryption method reverse to an encryption method, and the decrypted data word is further used to generate a regenerated integrity word at step 360 using an integrity check method.
- the regenerated integrity word may also be generated from the encrypted data word.
- the extracted integrity word from the external memory is generated by the same integrity check method during a prior encryption process, and therefore, the consistency between the recovered integrity word and the regenerated integrity word is applicable at step 364 for data verification. If the consistency exists, the data word extracted from the external memory may be outputted; otherwise, an error flag should be output.
- FIG. 4 illustrates an exemplary block diagram 400 of the encryption and integrity protection block 208 according to various embodiments of the invention.
- the encryption and integrity protection block 400 comprises an address translator 402 , a data encryptor 404 , a data decryptor 406 , an integrity control data generator 412 , and an integrity validation block 414 .
- the aforementioned memory write and read processes are labeled in solid and dashed lines, respectively.
- a logic address is translated to two respective physical addresses for the payload data and the integrity control data in the address translator 402 during both memory write and memory read operations.
- incoming data are encrypted to payload data in the data encryptor 404 , while integrity control data are generated in the integrity control data generator 412 .
- the payload data are extracted from the external memory 240 , decrypted in the data decryptor 406 , and used to regenerate integrity control data in the integrity control data generator 412 .
- the integrity control data are further compared with the extracted integrity control data in the integrity validation block 414 . Decrypted data or an error flag is outputted regarding to valid or invalid payload data extracted from the external memory, respectively.
- Access integrity control data introduces delays to read and write operations of the payload data. Each time the payload data are read or written, the associated integrity control data is read from or written to the external memory. The memory access time can be largely degraded. Therefore, in certain embodiments, an integrity cache 416 may be used to enhance the memory access rate by temporarily storing the integrity control data during consecutive read or write operations.
- the integrity cache 416 is different from a CPU cache included in the CPU core.
- consecutive data words are associated with different integrity sub-words in one integrity control data word.
- An integrity control data word may be read in one memory read operation, and stored in the integrity cache 416 for use by several consecutive payload data read operations. A plurality of integrity control data sub-words may be combined using the integrity cache 416 and a combining block during consecutive memory write operations, and written into the external memory 240 within one memory write operation.
- Several methods may be employed to write into or read from the external memory of a secure microcontroller. These methods include a data mapping method, a data encryption method, and an integrity check method.
- the data encryption method may be reversed to provide the corresponding data decryption method.
- the data interleaving scheme is integrated in the data mapping method in the address translator 402 .
- the payload data and the integrity control data are interleaved according to a certain data interleaving scheme, and two physical addresses are translated from every logic address accordingly during the memory read and write operation.
- regular data interleaving schemes in which payload data and integrity control data are arranged in a periodic configuration.
- every payload data word is followed by a relevant integrity control data word.
- several payload data words forms a payload data block, and each payload data block is followed by one integrity control data word or block, which contains the integrity control data of all the payload data words included in the payload data block.
- the payload data and the relevant integrity control data may not be physically located together in the memory 240 .
- the data interleaving scheme directly determines the data-mapping method used by the address translator 402 to translate one logic address to two different physical addresses for the payload data and the integrity control data during the memory read and write operations.
- FIG. 5 illustrates an exemplary data interleaving scheme 500 in the external memory 240 according to various embodiments of the invention.
- Every payload data word i.e., data word, DW
- one integrity control data word i.e., integrity word, IW
- the lengths of the data words and the integrity control data words may be 16-, 22-, 54- or 128-bit as specified by the external memory specification.
- the length of the data words and the length of the integrity words are not equal, and may be less than the word length allowed by the external memory.
- Zeros or ones may be used to fill the unused bits.
- the unused bits may be the first few bits or the last few bits, and they may also be randomly mixed with the used bits as far as their locations are tracked by the memory controller 210 .
- Every few number of data words are interleaved with one integrity word of the same length in the external memory 240 .
- This integrity word consists of several integrity sub-words (ISW) that have an equal length.
- ISW is an integrity word related to a payload data word based on an integrity check method. Therefore, the number of the integrity sub-words is equal to the number of the data words.
- the data words stored in the external memory are i-bit wide, wherein i is an integer.
- the length of each ISW, ISW length is a fraction of the data word length i, and may be derived as:
- ISW length i n ( 1 )
- n is the number of data words and the number of integrity sub-words.
- the equation (1) is applicable to periodic data interleaving schemes in which the integrity sub-words have an equal length.
- FIG. 6 illustrates another exemplary periodic data interleaving scheme 600 in the memory 240 according to various embodiments of the invention. Every eight 128-bit data words are alternated with one 128-bit integrity control data word that consists of eight 16-bit integrity sub-words. Each of the eight 16-bit integrity sub-words is successively related with each of the eight 128-bit payload data words based on the integrity check method.
- a 128-bit integrity word IW 0 consists of eight 16-bit integrity sub-words ISW 0 -ISW 7 , and ISW 0 -ISW 7 correspond to eight successive data words DW 0 -DW 7 , respectively.
- the integrity sub-word ISW 0 which occupies the least significant 16 bits of IW 0 is related to the first data word DW 0
- the integrity sub-word ISW 7 which occupies the most significant 16 bits of IW 0 is related to the last data word DW 7 .
- the data interleaving scheme is consistent with equation (1), and the integers i and n are equal to 128 and 8, respectively.
- FIG. 7 illustrates an exemplary data interleaving scheme 700 in the external memory 240 according to various embodiments of the invention.
- the length for each integrity sub-word relevant to each data word is 1-bit.
- the data word length i and the number of ISW n are equal.
- the 1-bit integrity control word may be generated from even/odd parity check.
- the i-bit payload data words are successively related with 1-bit integrity control words based on a certain integrity check method.
- the first data word DW 0 is associated with ISW 0 which is the least significant bit of the i-bit integrity word, while the last data word DW i-1 is associated with ISW i-1 which is the most significant bit of the i-bit integrity word. Due to the ISW length of 1 bit, this embodiment is a limit case that may be represented by equation (1).
- FIG. 8 illustrates an exemplary method 800 of mapping logic addresses of data in a data block to physical addresses in the external memory 240 according to a certain data interleaving scheme according to various embodiments of the invention. Equations are required to convert the logic addresses to physical addresses.
- every eight 128-bit payload data words are interleaved with one 128-bit integrity control data word.
- An x-th payload data word within an incoming data block may be mapped to the y-th word within a resulting data block stored in the external memory. Both indexes of the incoming and resulting data start from 0.
- the relationship of the relative addresses x and y in the resulting data block may be represented as
- the relative addresses for the payload data and the integrity control data are generated in the address translator 402 , and further superimposed to a block address to identify their physical addresses in the external memory. Equations (2) and (3) are embedded in the data mapping method employed by the address translator 402 .
- One integrity word comprises a plurality of integrity sub-words (ISW) which occupy different bits of the IW.
- ISW integrity sub-words
- DW data word
- Integrity sub-words associated with successive data words form one integrity word and share a same physical address for the integrity word.
- the integrity word is extracted once, and stored in the integrity cache 416 . Integrity sub-words are extracted during successive read operations for various payload data.
- the encryption and integrity protection block 208 uses the integrity cache 416 to store ISWs temporarily for a memory write operation.
- the block 208 awaits a complete integrity word to be derived from successive payload data before the complete integrity word may be stored in the memory word specified by the physical address of the integrity word. This embodiment allows a short memory access time during write operations.
- the integrity word is extracted from the IW physical address, and the bits allocated to the present payload data word are overwritten with the ISW before the integrity word is stored back at the specified IW physical address in the external memory. Additional modules (e.g., integrity caches) and controls are integrated in the encryption and integrity protect block 208 to interleave data if a plurality of data words are associated with one word.
- the data interleaving scheme is implemented by hardware and appears transparent to software used by the secure microcontroller.
- the software normally uses logic addresses without a need to use extra registers for configuring a data zone (i.e., block) in the external memory.
- the logic addresses are configured to physical addresses in the address translator. Both data confidentiality and data integrity are enhanced due to programming the data interleaving scheme in the hardware.
- a physical address of an integrity control data word may be generated from a special method reliant on a key.
- a complex data interleaving scheme will enhance data confidentiality, and create more obstacles for attackers to discern payload data from integrity control data in an external memory.
- this complex data interleaving scheme provides a robust solution to protect a secure microcontrollers from a majority of tampering efforts.
- the methods used to implement complex data interleaving schemes are incorporated in the address translator 402 , and cost for design and hardware increases with complexity of the data interleaving schemes.
- a data interleaving scheme in an external memory is particularly useful to ensure data confidentiality and data integrity in a secure microcontroller.
- the interleaving data scheme is also applicable in conventional microcontrollers. These microcontrollers may need to save the cost of expensive CPU memories from storing the integrity control data.
- a data mapping method incorporated in the address translator may be used to implement the data interleaving scheme, and the memory controller may be routed to the external memory rather than the internal CPU memory.
- payload data means encrypted data that is associated with “data” that are provided by the CPU core 206 and stored in the memory 240 .
- payload data may be equivalent to “data” in the case that no encryption/decryption is involved in memory write or read operations.
- the phrases “payload data word” and “data word” in various places in the specifications are equivalent.
- the phrases “integrity control data word” and “integrity word” in various places in the specifications are also equivalent.
- usage of “data” is associated with not only data related to confidential information (e.g., user names, passwords, transactions, and etc.) but also programs, instructions and codes executed by the CPU core.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
Description
- The application claims the benefit of French Application Serial No. 11 54694, entitled “Data Interleaving Scheme for an External Memory of a Secure Microcontroller”, filed on May 30, 2011, the subject matter of which is incorporated herein by reference.
- A. Technical Field
- The present invention relates generally to a secure microcontroller using an external memory, and more particularly to methods, systems and devices for performing integrity check by interleaving payload data and integrity control data in an external memory interfaced with a secure microcontroller.
- B. Background of the Invention
- A microcontroller is normally a single integrated circuit comprising a central processing unit (CPU) core, memory, and input/output (I/O) peripherals. A secure microcontroller is used for applications that involve trusted operations on valuable assets in an insecure environment where a thief or hacker may gain access to processor cores, memory devices or I/O peripherals that are used to communicate and process sensitive data. This sensitive data may include account numbers, access codes, personal identification number (PIN), cryptographic keys, financial transactions/balances, rights management, and metering (e.g., energy, units). In particular, this sensitive data may be programs or instructions employed to control the CPU core or the I/O peripherals. Various security features have been employed to avoid unauthorized access to these sensitive data. To date, the secure microcontroller has been applied in a wide range of security-critical applications such as electronic banking, commercial transactions, and pay-TV access control, or any application that requires the protection of proprietary software and methods.
- Since the sensitive data may be stored in an external memory of the secure microcontroller, memory content confidentiality and integrity are two distinct threats that should be addressed. The first threat causes sensitive information disclosure (i.e., data confidentiality) where confidential data are revealed and weakness in a program is exposed. The second threat causes modification of application behavior (i.e., data integrity) which involves programs and data being modified in the external memory and results in a data integrity issue.
- The secure microcontroller is designed to offer a level of security to the sensitive data stored in the external memory. For instance, physical security may be established against probing by anti-tampering enclosure. However, this solution may be expensive and does not cover new attack methods based on fault injection from power supply glitch, light, synchronous or asynchronous laser, or radioactive particles. The security features may also comprise memory encryption where the sensitive data stored in the external memory are encrypted or decrypted using cryptographic keys in the secure microcontroller during the data exchanging process. The cryptographic keys are stored locally within the secure microcontroller. As a result, the physical security perimeter can be limited to the microcontroller while the external memory and their communication buses can remain exposed physically.
- It shall be noted that generally encryption does not provide by itself sufficient integrity protection. For instance, an encryption algorithm is used with Electronic Code Book mode (ECB), and no modification is detected on a corrupted cryptotext in the external memory. The corrupted cryptotext is decrypted to a plaintext, and due to actual data modification/corruption, the plaintext is associated with a different value than an expected value. However, since the decryption algorithm itself does not flag any error, the resulting plaintext is still regarded as a legitimate value. The underlying data format can be used to identify data corruption, and for some data formats, this corruption may be difficult to identify. A typical example of insufficient data integrity in a microcontroller is a financial transaction where only the money amount is encrypted. A modified cryptotext would lead to a corrupted plaintext, potentially corresponding to an amount larger than the actual amount.
- Insufficient data integrity also occurs in protection of microcontroller instructions stored in the memory based on code encryption. When the memory is tampered, a randomly modified cryptotext instruction would be decrypted into a modified plaintext instruction that does not match with the original plaintext instruction. This erroneous plaintext instruction can be considered as legitimate according to the particular microprocessor instructions set and its coverage of a plain space. For instance, MIPS 4KSd core instructions are 32-bit long. Only 56% of any 32-bit instructions are associated with valid core instructions, and remaining 44% 32-bit instructions are considered by the microcontroller as unlawful and rejected by issuing a microcontroller exception. In another case, a 64-bit encryption algorithm, such as the Data Encryption Standard (DES), is used to handle two 32-bit words at a time for encryption/decryption. When a 64-bit cryptotext instruction is modified, the corresponding decrypted plaintext includes two 32-bit words, and the probability is approximately 30% for both of these two words to be legitimate core instructions. As a result, the probability is 70% to detect a cryptotext modification and an unlawful 32-bit instruction in a corrupted 64-bit DES system.
- Data integrity control is implemented for the sensitive data stored in the external memory to detect any willing or unwilling corruption between what was originally sent for storage and what is stored in the memory. Specific integrity check methods are used to generate integrity control data (i.e., a tag or signature) during a memory write operation, and validity of the stored data are verified by its consistency with the corresponding integrity control data during a memory read operation. Integrity control constitutes a sufficient protection against fault injection attacks, and integrity control modules may be embedded in the secure microcontroller to ensure a sufficient level of trust to stakeholders.
- Several integrity check methods may be employed. The simplest integrity check method is 1-bit even/odd parity check, wherein one integrity control bit is generated to maintain an even or odd parity among all the bits in the data. Alternative integrity check methods range from simple methods of cycling redundant check (CRC) or error correction/correcting code (ECC) to strong and proven methods, such as message authentication code (MAC). Despite their low security resistance, simple integrity check methods are mostly sufficient to protect against unwilling corruption; however, strong and proven methods are mandatory for protection against willing or active corruption. A simple method (e.g., ECC) normally does not involve secret keys, so attackers may easily generate consistent integrity data while modifying the sensitive data. A secret element (i.e., a cryptographic key) may be incorporated in some strong and proven integrity check methods. Attackers are prevented from an easy modification since the secret element needs to be recovered first.
-
FIG. 1 illustrates asecure microcontroller 102 interfacing with anencrypted memory 104. The aforementioned data confidentiality and integrity concerns are considered in this microcontroller. Thesecure microcontroller 102 comprises aCPU core 106, amemory controller 110 and buses for data, addresses and keys. Methods for integrity check, data encryption or data decryption are incorporated in theCPU core 102. During a memory write operation, original data are encrypted in theCPU core 106 to payload data for storing in thememory 104. During a memory read operation, payload data from thememory 104 are decrypted to original data in theCPU core 106. - Integrity control data are generated and commonly stored in an internal memory inside the
CPU core 106 during a memory write operation, and extracted for data integrity check during a subsequent memory read operation. The integrity control data are commonly stored in a dedicated location using static memory addresses. This solution is applied in many prior art microcontrollers to store their respective integrity control data, e.g., the reference hash value in the U.S. Pat. No. 5,708,274 and the integrity check value in French Patent 1,885,709. This conventional solution may require intensive usage of internal memory, and therefore, may be an expensive solution, even though the data access rate is satisfactory. - Various embodiments of the present invention relate to a secure microcontroller using an external memory, and more particularly to methods, systems and devices for performing integrity check by interleaving payload data and integrity control data in an external memory interfaced with a secure microcontroller.
- A plurality of data words and a plurality of logic addresses are generated in a microcontroller, and each data word is associated with a logic address. Each data word is used to generate a respective integrity word based on an integrity check method, while the associated logic address is translated to a first physical address for the data word and a second physical address for the integrity word in the external memory. The data words and the associated integrity words are interleaved in the external memory based on a data mapping method, and the physical addresses for the data and integrity words are dynamically determined. The external memory may be ROM, RAM or flash memory, and may have dedicated regions for the data words and the integrity words, respectively.
- The data words and the integrity words are interleaved in a periodic scheme in the external memory. In particular, each data word may be associated to an integrity sub-word, and several integrity sub-words form an integrity word having the same length with that of a data word. Therefore, associated data words alternate with this integrity word in a periodic scheme.
- The microcontroller using an external memory to store the data and integrity words is configured to generate two physical addresses in the external memory for each data word and associated integrity word. In particular, an embedded encryption and integrity protection block may comprise an address translator to implement a data mapping method, and an integrity control data generator to generate integrity words. The involved data words and integrity words are stored in the external memory. For use in a secure microcontroller, the embedded encryption and integrity protection block also comprises a plurality of function blocks for data encryption/decryption and temporary storage of integrity sub-words.
- Certain features and advantages of the present invention have been generally described in this summary section; however, additional features, advantages, and embodiments are presented herein or will be apparent to one of ordinary skill in the art in view of the drawings, specification, and claims hereof. Accordingly, it should be understood that the scope of the invention shall not be limited by the particular embodiments disclosed in this summary section.
- Reference will be made to embodiments of the invention, examples of which may be illustrated in the accompanying figures. These figures are intended to be illustrative, not limiting. Although the invention is generally described in the context of these embodiments, it should be understood that it is not intended to limit the scope of the invention to these particular embodiments.
- FIG. (“FIG.”) 1 illustrates a secure microcontroller interfacing with an external memory where security and integrity concerns are considered.
-
FIG. 2 illustrates an exemplary block diagram of a secure microcontroller system comprising a secure microcontroller interfacing with an external memory according to various embodiments of the invention. -
FIG. 3( a) illustrates a method of generating and storing interleaving data word and integrity word in the external memory according to various embodiments of the invention. -
FIG. 3( b) illustrates a method of extracting a data word and an integrity word from an external memory according to various embodiments of the invention. -
FIG. 4 illustrates an exemplary block diagram of the encryption and integrity protection block according to various embodiments of the invention. -
FIG. 5 illustrates an exemplary data interleaving scheme in the external memory according to various embodiments of the invention. -
FIG. 6 illustrates another exemplary data interleaving scheme in the external memory according to various embodiments of the invention. -
FIG. 7 illustrates an exemplary data interleaving scheme in the external memory according to various embodiments of the invention. -
FIG. 8 illustrates an exemplary method of mapping logic addresses of data in a data block to physical addresses in the external memory according to a data interleaving scheme according to various embodiments of the invention. - The present invention relates generally to a secure microcontroller using an external memory, and more particularly to methods, systems and devices for performing integrity check by interleaving payload data and integrity control data in an external memory interfaced with a secure microcontroller.
- In the following description, for purposes of explanation, specific details are set forth in order to provide an understanding of the invention. It will be apparent, however, to one skilled in the art that the invention can be practiced without these details. One skilled in the art will recognize that embodiments of the present invention, described below, may be performed in a variety of ways and using a variety of structures. Those skilled in the art will also recognize additional modifications, applications, and embodiments are within the scope thereof, as are additional fields in which the invention may provide utility. Accordingly, the embodiments described below are illustrative of specific embodiments of the invention and are meant to avoid obscuring the invention.
- Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, characteristic, or function described in connection with the embodiment is included in at least one embodiment of the invention. The appearance of the phrase “in one embodiment,” “in an embodiment,” or the like in various places in the specification are not necessarily all referring to the same embodiment.
- Furthermore, connections between components or between method steps in the figures are not restricted to connections that are effected directly. Instead, connections illustrated in the figures between components or method steps may be modified or otherwise changed through the addition thereto of intermediary components or method steps, without departing from the teachings of the present invention.
-
FIG. 2 illustrates an exemplary block diagram 200 of a secure microcontroller system comprising asecure microcontroller 220 interfacing with an external memory according to various embodiments of the invention. Thesecure microcontroller 220 comprises aCPU core 206, an encryption andintegrity protection block 208, amemory controller 210, akey storage 212 and buses for data, addresses and keys. The encryption andintegrity protection block 208 is used to implement address mapping, integrity data computation, integrity check, data encryption and data decryption. In various embodiments of the present invention, integrity control data are generated by theblock 208 and subsequently stored in the encrypted and integrity protected memory 240 (i.e., external memory 240) so that internal memory space in theCPU core 206 does not need to be reserved for integrity control data. Accordingly, the encryption andintegrity protection block 208 and thememory controller 210 are adjusted to generate and access physical addresses in the external memory not only for payload data but also for the corresponding integrity control data. In various embodiments of the present invention, integrity management (e.g., ECC) is implemented in theblock 208 rather than in theexternal memory 240 although certain memories, such as NAND flash, may also provide integrity management. - The
external memory 240 is partitioned to at least oneplain content region 214, and at least oneencrypted content region 216. The content stored in theencrypted content region 216 may comprise payload data and integrity control data. The payload data are encrypted programs or data associated with confidential information, e.g., user names, passwords, transactions etc. Each integrity control data is derived from the original data or encrypted data (i.e., payload data) according to a specific integrity check method which may be proprietary in some instances. - Payload data and integrity control data are stored as payload data words (i.e., data words) and integrity control data words (i.e., integrity words) in the
external memory 240, respectively, and lengths of these words are associated with memory type and methods for encryption and integrity check. One convenient solution is to store the data words and the integrity control data words in their respective dedicated regions in theexternal memory 240. Memories within specific address ranges are configured to store the data words and the integrity control data, respectively. As a result, a data word and its associated integrity word are stored at two memory cells that may be physically distant from each other and may even be located at two separate memory pages. - In various embodiments of the present invention, the integrity words are interleaved with the data words in the
external memory 240 according to a regular data interleaving scheme to improve performance. The regular data interleaving scheme simplifies data flow and avoids jump mechanism by retrieving the integrity words in dedicated integrity storage locations that are adjacent to associated data storage locations. In particular, the regular data interleaving scheme is preferred for paginated memories, such as SDRAM, wherein jumping among pages requires extra page switching time and degrades memory access rate significantly. In one embodiment, a periodic scheme is employed wherein every few data words may be interleaved with an integrity word directly associated with these data words. In order to implement the regular data interleaving scheme, the encryption andintegrity protection block 208 performs an automatic remapping of theexternal memory 240 such that theCPU core 206 may fetch data and programs/instructions without identifying addresses for associated integrity words. - The
external memory 240 is allocated to store the payload data and the integrity control data dynamically. In certain embodiments, theexternal memory 240 may comprise more than one memory among RAM, ROM and flash memory. Thesecure microcontroller 220 interfaces to various memories in theexternal memory 240 without configuring dedicated data regions for each memory. As more than one memory is involved, address mapping for certain data interleaving schemes is implemented dynamically in the encryption andintegrity protection block 208. - In certain embodiments, during a memory write operation, the
CPU core 206 provides data and logic addresses to the encryption andintegrity protection block 208 which further encrypts the data to payload data using an encryption method. The encryption method is based on the logic addresses and a key, and the key is fixed or randomly generated by theCPU core 206 and stored in thekey storage 212. In one embodiment, the encryption method is directly based on a physical address translated from the logic address. Integrity control data are generated in the encryption andintegrity protection block 208 using a predetermined integrity check method based on the data. In certain embodiments, at least one cryptographic key is used to generate the integrity control data. In addition to encrypting the data and generating the corresponding integrity control data, theblock 208 also translates the input logic addresses to two separate physical addresses, one for the payload data and the other for the integrity control data. Thememory controller 210 identifies the physical addresses in theexternal memory 240 and stores the payload data and the integrity control data as specified by the physical addresses. - In certain embodiments, during a memory read operation, a logic address is provided by the
CPU core 206 to extract specific payload data from the external encrypted and integrity protectedmemory 240. The encryption andintegrity protection block 208 translates the logic address to recover two physical addresses for the payload data and the associated integrity control data, respectively. The method used in this address-recovery process is similar to the method used to translate the logic address when the data need to be stored during the memory write operation. - The
memory controller 210 enables the access to memory contents stored at the specified physical addresses, and the encryption andintegrity protection block 208 is coupled to receive the payload data and the integrity control data from the encrypted and integrity protectedmemory 240. A decryption method may be implemented to use the logic address and the key stored in thekey storage 212 to recover the payload data while the associated integrity data are extracted from thememory 240. Data recovered from the payload data are processed using the same integrity check method that is formerly used to generate the integrity control data. If the integrity control data regenerated from the recovered data are consistent with the integrity control data extracted from theexternal memory 240, then the recovered data are valid and subsequently provided to theCPU core 206; otherwise, an error is acknowledged and a dedicated hardware is employed to raise a CPU exception based on the security policy of the microcontroller. In various embodiments of the present invention, the CPU exception may be exploited to erase the sensitive data, trigger a non-maskable interruption, write a value in a flag register, reset the microcontroller, or run a dedicated code. - Data interleaving enhances cost efficiency of the secure microcontroller. In a conventional secure microcontroller, the integrity control data are stored in the internal memory, while in the present invention, this internal memory may be spared since at least a portion associated with the integrity control data is moved to the encrypted and integrity protected
memory 240 located externally to the CPU core. The cost for the CPU core will be largely reduced due to availability of this secure integrity data storage in the external memory. -
FIG. 3( a) illustrates amethod 300 of generating and storing interleaving data and integrity words in theexternal memory 240 according to various embodiments of the invention. A data word and its logic address within a data block are received atstep 302. The data word is further encrypted based on a predetermined encryption method atstep 304, and an integrity word is generated from the data word based on a predetermined integrity check method atstep 306. In one embodiment, the integrity word may also be generated from the encrypted data word (i.e., payload data). The logic address is mapped to two physical addresses in the external memory atstep 310, one physical address for the encrypted data word (i.e., payload data) and the other physical address for the integrity word (i.e., integrity control data). A data interleaving scheme may be incorporated instep 310. As a result, the data word and the integrity word may be stored in the memories addressed by the two physical addressed, respectively, atstep 312. -
FIG. 3( b) illustrates amethod 350 of extracting a data word and an integrity word from anexternal memory 240 according to various embodiments of the invention. A logic address within a data block is received atstep 352 for an interested data word. The logic address is used to identify two physical addresses for the data word and integrity word atstep 354 according to a data interleaving scheme. The data word and integrity word are therefore extracted from the specified physical addresses atstep 356. The data word is decrypted atstep 358 based on a decryption method reverse to an encryption method, and the decrypted data word is further used to generate a regenerated integrity word atstep 360 using an integrity check method. In one embodiment, the regenerated integrity word may also be generated from the encrypted data word. The extracted integrity word from the external memory is generated by the same integrity check method during a prior encryption process, and therefore, the consistency between the recovered integrity word and the regenerated integrity word is applicable atstep 364 for data verification. If the consistency exists, the data word extracted from the external memory may be outputted; otherwise, an error flag should be output. - Various structures are incorporated in the encryption and integrity protect
protection block 208 to implement critical functions of data encryption/decryption, integrity word generation, integrity check and address mapping.FIG. 4 illustrates an exemplary block diagram 400 of the encryption andintegrity protection block 208 according to various embodiments of the invention. The encryption andintegrity protection block 400 comprises anaddress translator 402, adata encryptor 404, adata decryptor 406, an integritycontrol data generator 412, and anintegrity validation block 414. The aforementioned memory write and read processes are labeled in solid and dashed lines, respectively. A logic address is translated to two respective physical addresses for the payload data and the integrity control data in theaddress translator 402 during both memory write and memory read operations. During a memory write operation, incoming data are encrypted to payload data in the data encryptor 404, while integrity control data are generated in the integritycontrol data generator 412. During a memory read operation, the payload data are extracted from theexternal memory 240, decrypted in the data decryptor 406, and used to regenerate integrity control data in the integritycontrol data generator 412. The integrity control data are further compared with the extracted integrity control data in theintegrity validation block 414. Decrypted data or an error flag is outputted regarding to valid or invalid payload data extracted from the external memory, respectively. - Access integrity control data introduces delays to read and write operations of the payload data. Each time the payload data are read or written, the associated integrity control data is read from or written to the external memory. The memory access time can be largely degraded. Therefore, in certain embodiments, an
integrity cache 416 may be used to enhance the memory access rate by temporarily storing the integrity control data during consecutive read or write operations. Theintegrity cache 416 is different from a CPU cache included in the CPU core. In various embodiments, consecutive data words are associated with different integrity sub-words in one integrity control data word. An integrity control data word may be read in one memory read operation, and stored in theintegrity cache 416 for use by several consecutive payload data read operations. A plurality of integrity control data sub-words may be combined using theintegrity cache 416 and a combining block during consecutive memory write operations, and written into theexternal memory 240 within one memory write operation. - Several methods may be employed to write into or read from the external memory of a secure microcontroller. These methods include a data mapping method, a data encryption method, and an integrity check method. The data encryption method may be reversed to provide the corresponding data decryption method. Particularly, in various embodiments of the present invention, the data interleaving scheme is integrated in the data mapping method in the
address translator 402. - In the encrypted and integrity protected
memory 240, the payload data and the integrity control data are interleaved according to a certain data interleaving scheme, and two physical addresses are translated from every logic address accordingly during the memory read and write operation. In particular, there are various embodiments of regular data interleaving schemes in which payload data and integrity control data are arranged in a periodic configuration. In one embodiment, every payload data word is followed by a relevant integrity control data word. In another embodiment, several payload data words forms a payload data block, and each payload data block is followed by one integrity control data word or block, which contains the integrity control data of all the payload data words included in the payload data block. The payload data and the relevant integrity control data may not be physically located together in thememory 240. The data interleaving scheme directly determines the data-mapping method used by theaddress translator 402 to translate one logic address to two different physical addresses for the payload data and the integrity control data during the memory read and write operations. -
FIG. 5 illustrates an exemplarydata interleaving scheme 500 in theexternal memory 240 according to various embodiments of the invention. Every payload data word (i.e., data word, DW) is directly followed by one integrity control data word (i.e., integrity word, IW) which is related with the precedent payload data word based on an integrity check method. For example, the lengths of the data words and the integrity control data words may be 16-, 22-, 54- or 128-bit as specified by the external memory specification. In certain embodiment, the length of the data words and the length of the integrity words are not equal, and may be less than the word length allowed by the external memory. Zeros or ones may be used to fill the unused bits. The unused bits may be the first few bits or the last few bits, and they may also be randomly mixed with the used bits as far as their locations are tracked by thememory controller 210. - In various embodiments of the present invention, every few number of data words are interleaved with one integrity word of the same length in the
external memory 240. This integrity word consists of several integrity sub-words (ISW) that have an equal length. Each ISW is an integrity word related to a payload data word based on an integrity check method. Therefore, the number of the integrity sub-words is equal to the number of the data words. The data words stored in the external memory are i-bit wide, wherein i is an integer. The length of each ISW, ISW length, is a fraction of the data word length i, and may be derived as: -
- where n is the number of data words and the number of integrity sub-words. The equation (1) is applicable to periodic data interleaving schemes in which the integrity sub-words have an equal length.
-
FIG. 6 illustrates another exemplary periodicdata interleaving scheme 600 in thememory 240 according to various embodiments of the invention. Every eight 128-bit data words are alternated with one 128-bit integrity control data word that consists of eight 16-bit integrity sub-words. Each of the eight 16-bit integrity sub-words is successively related with each of the eight 128-bit payload data words based on the integrity check method. In this embodiment, a 128-bit integrity word IW0 consists of eight 16-bit integrity sub-words ISW0-ISW7, and ISW0-ISW7 correspond to eight successive data words DW0-DW7, respectively. In particular, the integrity sub-word ISW0 which occupies the least significant 16 bits of IW0 is related to the first data word DW0, while the integrity sub-word ISW7 which occupies the most significant 16 bits of IW0 is related to the last data word DW7. In this embodiment, the data interleaving scheme is consistent with equation (1), and the integers i and n are equal to 128 and 8, respectively. -
FIG. 7 illustrates an exemplarydata interleaving scheme 700 in theexternal memory 240 according to various embodiments of the invention. The length for each integrity sub-word relevant to each data word is 1-bit. The data word length i and the number of ISW n are equal. The 1-bit integrity control word may be generated from even/odd parity check. The i-bit payload data words are successively related with 1-bit integrity control words based on a certain integrity check method. The first data word DW0 is associated with ISW0 which is the least significant bit of the i-bit integrity word, while the last data word DWi-1 is associated with ISWi-1 which is the most significant bit of the i-bit integrity word. Due to the ISW length of 1 bit, this embodiment is a limit case that may be represented by equation (1). -
FIG. 8 illustrates anexemplary method 800 of mapping logic addresses of data in a data block to physical addresses in theexternal memory 240 according to a certain data interleaving scheme according to various embodiments of the invention. Equations are required to convert the logic addresses to physical addresses. In the embodiment illustrated inFIG. 5 , every eight 128-bit payload data words are interleaved with one 128-bit integrity control data word. An x-th payload data word within an incoming data block may be mapped to the y-th word within a resulting data block stored in the external memory. Both indexes of the incoming and resulting data start from 0. Based on the particular period data interleaving scheme, the relationship of the relative addresses x and y in the resulting data block may be represented as -
- where floor(x/8) is a rounded result from dividing x by 8, and mod(x,8) is a remainder. As a result, every eight payload data are interleaved with one integrity control data whose relative address AddIW in the resulting data block is
-
- The relative addresses for the payload data and the integrity control data are generated in the
address translator 402, and further superimposed to a block address to identify their physical addresses in the external memory. Equations (2) and (3) are embedded in the data mapping method employed by theaddress translator 402. - One integrity word (IW) comprises a plurality of integrity sub-words (ISW) which occupy different bits of the IW. As a data word (DW) is stored in the external memory, an ISW (i.e., a plurality of bits in the IW) is written into a corresponding memory word as well. Integrity sub-words associated with successive data words form one integrity word and share a same physical address for the integrity word. In one embodiment, the integrity word is extracted once, and stored in the
integrity cache 416. Integrity sub-words are extracted during successive read operations for various payload data. In one embodiment, the encryption andintegrity protection block 208 uses theintegrity cache 416 to store ISWs temporarily for a memory write operation. Theblock 208 awaits a complete integrity word to be derived from successive payload data before the complete integrity word may be stored in the memory word specified by the physical address of the integrity word. This embodiment allows a short memory access time during write operations. In another embodiment, the integrity word is extracted from the IW physical address, and the bits allocated to the present payload data word are overwritten with the ISW before the integrity word is stored back at the specified IW physical address in the external memory. Additional modules (e.g., integrity caches) and controls are integrated in the encryption and integrity protectblock 208 to interleave data if a plurality of data words are associated with one word. - The data interleaving scheme is implemented by hardware and appears transparent to software used by the secure microcontroller. The software normally uses logic addresses without a need to use extra registers for configuring a data zone (i.e., block) in the external memory. In the present invention, the logic addresses are configured to physical addresses in the address translator. Both data confidentiality and data integrity are enhanced due to programming the data interleaving scheme in the hardware.
- Although the periodic data interleaving scheme is preferred in some memories, e.g., SDRAM, those skilled in the art will recognize that more complex data interleaving scheme may be used. In one embodiment, a physical address of an integrity control data word may be generated from a special method reliant on a key. A complex data interleaving scheme will enhance data confidentiality, and create more obstacles for attackers to discern payload data from integrity control data in an external memory. In combination with data encryption methods, this complex data interleaving scheme provides a robust solution to protect a secure microcontrollers from a majority of tampering efforts. The methods used to implement complex data interleaving schemes are incorporated in the
address translator 402, and cost for design and hardware increases with complexity of the data interleaving schemes. - A data interleaving scheme in an external memory is particularly useful to ensure data confidentiality and data integrity in a secure microcontroller. However, one of ordinary skill in the art may realize the interleaving data scheme is also applicable in conventional microcontrollers. These microcontrollers may need to save the cost of expensive CPU memories from storing the integrity control data. A data mapping method incorporated in the address translator may be used to implement the data interleaving scheme, and the memory controller may be routed to the external memory rather than the internal CPU memory.
- For the above specification, reference to “payload data” means encrypted data that is associated with “data” that are provided by the
CPU core 206 and stored in thememory 240. However, “payload data” may be equivalent to “data” in the case that no encryption/decryption is involved in memory write or read operations. The phrases “payload data word” and “data word” in various places in the specifications are equivalent. The phrases “integrity control data word” and “integrity word” in various places in the specifications are also equivalent. In various embodiments of the present invention, usage of “data” is associated with not only data related to confidential information (e.g., user names, passwords, transactions, and etc.) but also programs, instructions and codes executed by the CPU core. - While the invention is susceptible to various modifications and alternative forms, specific examples thereof have been shown in the drawings and are herein described in detail. It should be understood, however, that the invention is not to be limited to the particular forms disclosed, but to the contrary, the invention is to cover all modifications, equivalents, and alternatives falling within the scope of the appended claims.
Claims (27)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
FR1154694 | 2011-05-30 | ||
FR1154694A FR2976147B1 (en) | 2011-05-30 | 2011-05-30 | DATA INTERLACEMENT DIAGRAM FOR AN EXTERNAL MEMORY OF A SECURE MICROCONTROLLER |
Publications (2)
Publication Number | Publication Date |
---|---|
US20120311239A1 true US20120311239A1 (en) | 2012-12-06 |
US10797857B2 US10797857B2 (en) | 2020-10-06 |
Family
ID=44785931
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/483,669 Active 2033-12-24 US10797857B2 (en) | 2011-05-30 | 2012-05-30 | Data interleaving scheme for an external memory of a secure microcontroller |
Country Status (3)
Country | Link |
---|---|
US (1) | US10797857B2 (en) |
CN (1) | CN102855161B (en) |
FR (1) | FR2976147B1 (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150358300A1 (en) * | 2014-06-05 | 2015-12-10 | Stmicroelectronics (Grenoble 2) Sas | Memory encryption method compatible with a memory interleaved system and corresponding system |
US9256551B2 (en) | 2013-08-09 | 2016-02-09 | Apple Inc. | Embedded encryption/secure memory management unit for peripheral interface controller |
US20170337141A1 (en) * | 2016-05-18 | 2017-11-23 | International Business Machines Corporation | System architecture for encrypting external memory |
US10594491B2 (en) * | 2015-12-24 | 2020-03-17 | Intel Corporation | Cryptographic system memory management |
US11841806B1 (en) * | 2018-11-15 | 2023-12-12 | Intel Corporation | System, apparatus and method for integrity protecting tenant workloads in a multi-tenant computing environment |
US12248405B2 (en) * | 2023-02-01 | 2025-03-11 | SiFive, Inc. | Address boundary functions for physical and localized addresses |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10223289B2 (en) * | 2015-07-07 | 2019-03-05 | Qualcomm Incorporated | Secure handling of memory caches and cached software module identities for a method to isolate software modules by means of controlled encryption key management |
CN106681941A (en) * | 2015-11-07 | 2017-05-17 | 上海复旦微电子集团股份有限公司 | Data write-in and data-out method of memory and device |
US11520709B2 (en) * | 2020-01-15 | 2022-12-06 | International Business Machines Corporation | Memory based encryption using an encryption key based on a physical address |
US11763008B2 (en) | 2020-01-15 | 2023-09-19 | International Business Machines Corporation | Encrypting data using an encryption path and a bypass path |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060074960A1 (en) * | 2004-09-20 | 2006-04-06 | Goldschmidt Marc A | Providing data integrity for data streams |
US20060080553A1 (en) * | 2004-10-08 | 2006-04-13 | International Business Machines Corporation | Secure memory caching structures for data, integrity and version values |
US20080301403A1 (en) * | 2007-05-29 | 2008-12-04 | Eskild T Arntzen | System for integrity protection for standard 2n-bit multiple sized memory devices |
US20090048978A1 (en) * | 1995-02-13 | 2009-02-19 | Ginter Karl L | Systems and methods for secure transaction management and electronic rights protection |
US20090100307A1 (en) * | 2004-08-30 | 2009-04-16 | Silicon Storage Technology, Inc. | Systems and methods for providing nonvolatile memory management in wireless phones |
US20100106954A1 (en) * | 2008-10-23 | 2010-04-29 | Robert Michael Muchsel | Multi-Layer Content Protecting Microcontroller |
US20100235633A1 (en) * | 2000-01-21 | 2010-09-16 | Sony Corporation | Authentication and encryption utilizing command indentifiers |
US8055970B1 (en) * | 2005-11-14 | 2011-11-08 | Raytheon Company | System and method for parallel processing of data integrity algorithms |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5332315A (en) | 1991-04-27 | 1994-07-26 | Gec Avery Limited | Apparatus and sensor unit for monitoring changes in a physical quantity with time |
US6708274B2 (en) * | 1998-04-30 | 2004-03-16 | Intel Corporation | Cryptographically protected paging subsystem |
US7266842B2 (en) * | 2002-04-18 | 2007-09-04 | International Business Machines Corporation | Control function implementing selective transparent data authentication within an integrated system |
US8830072B2 (en) | 2006-06-12 | 2014-09-09 | Intelleflex Corporation | RF systems and methods for providing visual, tactile, and electronic indicators of an alarm condition |
EP2026470A1 (en) * | 2007-08-17 | 2009-02-18 | Panasonic Corporation | Running cyclic redundancy check over coding segments |
JP2009301482A (en) | 2008-06-17 | 2009-12-24 | Totoku Electric Co Ltd | Radio tag and radio tag system |
EP2221750A1 (en) | 2009-02-10 | 2010-08-25 | EM Microelectronic-Marin SA | Chip card comprising a sensor and method for manufacturing such a chip card |
-
2011
- 2011-05-30 FR FR1154694A patent/FR2976147B1/en active Active
-
2012
- 2012-05-29 CN CN201210172262.7A patent/CN102855161B/en active Active
- 2012-05-30 US US13/483,669 patent/US10797857B2/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090048978A1 (en) * | 1995-02-13 | 2009-02-19 | Ginter Karl L | Systems and methods for secure transaction management and electronic rights protection |
US20100235633A1 (en) * | 2000-01-21 | 2010-09-16 | Sony Corporation | Authentication and encryption utilizing command indentifiers |
US20090100307A1 (en) * | 2004-08-30 | 2009-04-16 | Silicon Storage Technology, Inc. | Systems and methods for providing nonvolatile memory management in wireless phones |
US20060074960A1 (en) * | 2004-09-20 | 2006-04-06 | Goldschmidt Marc A | Providing data integrity for data streams |
US20060080553A1 (en) * | 2004-10-08 | 2006-04-13 | International Business Machines Corporation | Secure memory caching structures for data, integrity and version values |
US8055970B1 (en) * | 2005-11-14 | 2011-11-08 | Raytheon Company | System and method for parallel processing of data integrity algorithms |
US20080301403A1 (en) * | 2007-05-29 | 2008-12-04 | Eskild T Arntzen | System for integrity protection for standard 2n-bit multiple sized memory devices |
US20100106954A1 (en) * | 2008-10-23 | 2010-04-29 | Robert Michael Muchsel | Multi-Layer Content Protecting Microcontroller |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9256551B2 (en) | 2013-08-09 | 2016-02-09 | Apple Inc. | Embedded encryption/secure memory management unit for peripheral interface controller |
US20150358300A1 (en) * | 2014-06-05 | 2015-12-10 | Stmicroelectronics (Grenoble 2) Sas | Memory encryption method compatible with a memory interleaved system and corresponding system |
US9419952B2 (en) * | 2014-06-05 | 2016-08-16 | Stmicroelectronics (Grenoble 2) Sas | Memory encryption method compatible with a memory interleaved system and corresponding system |
US10594491B2 (en) * | 2015-12-24 | 2020-03-17 | Intel Corporation | Cryptographic system memory management |
US11196565B2 (en) * | 2015-12-24 | 2021-12-07 | Intel Corporation | Cryptographic system memory management |
US20220094553A1 (en) * | 2015-12-24 | 2022-03-24 | Intel Corporation | Cryptographic system memory management |
US12238221B2 (en) * | 2015-12-24 | 2025-02-25 | Intel Corporation | Cryptographic system memory management |
US20170337141A1 (en) * | 2016-05-18 | 2017-11-23 | International Business Machines Corporation | System architecture for encrypting external memory |
US10992453B2 (en) * | 2016-05-18 | 2021-04-27 | International Business Machines Corporation | System architecture for encrypting external memory |
US11841806B1 (en) * | 2018-11-15 | 2023-12-12 | Intel Corporation | System, apparatus and method for integrity protecting tenant workloads in a multi-tenant computing environment |
US12248405B2 (en) * | 2023-02-01 | 2025-03-11 | SiFive, Inc. | Address boundary functions for physical and localized addresses |
Also Published As
Publication number | Publication date |
---|---|
FR2976147A1 (en) | 2012-12-07 |
CN102855161A (en) | 2013-01-02 |
FR2976147B1 (en) | 2013-11-22 |
US10797857B2 (en) | 2020-10-06 |
CN102855161B (en) | 2018-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10797857B2 (en) | Data interleaving scheme for an external memory of a secure microcontroller | |
US10540297B2 (en) | Memory organization for security and reliability | |
US9537656B2 (en) | Systems and methods for managing cryptographic keys in a secure microcontroller | |
US8843767B2 (en) | Secure memory transaction unit | |
KR101577886B1 (en) | Method and apparatus for memory encryption with integrity check and protection against replay attacks | |
US8839001B2 (en) | Infinite key memory transaction unit | |
US11232194B2 (en) | Method for executing a binary code of a secure function with a microprocessor | |
US9152576B2 (en) | Mode-based secure microcontroller | |
US20080215955A1 (en) | Semiconductor storage device | |
KR20090014828A (en) | Flash memory system for encrypting error correction code and encryption method of flash memory system | |
US7774587B2 (en) | Dynamic redundancy checker against fault injection | |
US20100194609A1 (en) | Method and Device For Coding Data Words | |
US11818248B2 (en) | Encoder and decoder using physically unclonable functions | |
CN114153376A (en) | Safety flash memory controller | |
CN114237492B (en) | Non-volatile memory protection method and device | |
US12248409B2 (en) | Apparatus and method of controlling access to data stored in a non-trusted memory | |
JP2008204085A (en) | Semiconductor memory | |
US12260007B2 (en) | Secure flash controller | |
US12174939B2 (en) | Method for the execution of a binary code of a computer program by a microprocessor | |
US11677541B2 (en) | Method and device for secure code execution from external memory | |
US12088722B2 (en) | Method for executing a computer program by means of an electronic apparatus | |
JP2009080515A (en) | Method and apparatus for providing a secure load sequence |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: MAXIM INTEGRATED PRODUCTS, INC., CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:VINCENT BEBOUT;LHERMET, FRANK;LOISEL, YANN;AND OTHERS;REEL/FRAME:028289/0508 Effective date: 20120522 |
|
STCV | Information on status: appeal procedure |
Free format text: ON APPEAL -- AWAITING DECISION BY THE BOARD OF APPEALS |
|
STCV | Information on status: appeal procedure |
Free format text: BOARD OF APPEALS DECISION RENDERED |
|
STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1551); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 4 |