1
$\begingroup$

I am working on an embedded device which send/receive data and stored them in ciphertext mode (encrypted mode ). Now what's best approach for storing Keys (I used ARM CORTEX M series MCU) ?

  1. Storing keys in the SRAM memory,in each booting sequence ,inject keys to the embedded MCU and store them in the SRAM memory. It is best way I think,then when MCU sense penetration (with tamper sensor or ...) it can erased SRAM quickly and reset itself. Disadvantage: if attacker success to pass tampers and access to device,how safe is SRAM memory (against code mining). I can't find any security ability for this memory in MCUs.

  2. Generate keys and stored them in the flash memory in programming MCU. MCU flash memory's support CRP (code read protection) which prevent from code mining and with assist of its internal AES engine and RNG (random number generation) engine we can make a random key and encrypt flash memory and stored that random key in the OTP (one time programmable memory -a 128 bit encrypted memory), then in code execution we decode flash memory with RNG key and access to initial key and codes. Disadvantage: Keys stored in a non volatile memory, tampers will be useless and attacker have a lot of time to mine keys.

  3. Stored key in the EEPROM memory,combination of 2 above approach, key stored in the non volatile memory but when tampers sense penetration EEPROM is erasable. I consider LPC18S57FBD208(cortex m3 with 1MB of flash memory, 180MHZ, 136KB SRAM, 16KB EEPROM and a TFT LCD controller which i need to drive a 7" TFT LCD and AES 128 bit crypto engine) for that is there any other better suggestion?

part 2: I am using a PCD (proximity coupling device or the card reader) like CLRC663 for reading RFID tags too. connection between PCD and MCU is based on SPI,Becouse of unsecure and un-encrypted connection between them ,each attacker can sniff the connection and achieve the keys used for reading and writing to the RFID tags. what is your suggestion for this?

$\endgroup$
  • $\begingroup$ Your second question seems unconnected and should, I think, be asked separately. Regarding the first, you are concerned with attackers who have physical access. Is there something to distinguish the legitimate user from an attacker, like could you use a password/similar as part of key derivation? $\endgroup$ – otus Nov 5 '15 at 6:35
1
$\begingroup$

An issue with storing a key in RAM is, there are attacks that involve erasing the flash to unlock the device and then using a debugger to copy the RAM contents. Problem with internal EEPROM is the same as RAM unless you can lock it. External EEPROM is worse, unless you encrypt that.

My druthers would be store the key in flash and then lock the lock the processor to disable debugging access. If possible use a separate key for each and every device. If you copy the key to ram, make sure it's gets over-written when done.

| improve this answer | |
$\endgroup$
  • $\begingroup$ also i read there are ways to disable code read protection fuses and extract flash's content.worth thing about it,is that FLASH is non-volatile memory and attacker has a lot of time to do this.is it possible to store a initial key in the OTP memory,then store original key in the SRAM,encode SRAM with initial code(maybe only blocks that store the original key) . is it reasonable ? $\endgroup$ – Mahmoud Hosseinipour Nov 5 '15 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.