6

I am working on an embedded device running on Linux. This device communicates with a server and sends data to it using a certificate and a private key.

When we distribute the device, I am afraid that some evil people might steal that private key by hacking through the file system of the embedded device, and try to tamper with the data on our server.

Even if I encrypt that private key, since the running program needs to decrypt the key, they could still find the decrypting key somewhere on the file system.

Changing the permissions of the files would not be a solution as we must inherently distribute the device, and as such, anyone can have physical access to it.

I would be glad to hear any suggestion to protect the private key without preventing the running program from using it. Thank you.

Edit: We use Yocto running on Intel Edison.

  • 3
    Not a complete answer, but unix.stackexchange.com/questions/194134/… might provide some relevant links. (You'd need more than just securing the encryption key though; you need some form of secure boot too...) – Stephen Kitt Apr 15 '16 at 14:59
  • What platform is your embedded device based on? – Stephen Kitt Apr 15 '16 at 14:59
  • It is using the Yocto distribution running on Intel Edison – Olivier Apr 15 '16 at 15:01
5

If your hardware is not physically secure, nothing you do in software will give you physical security.

Don't bother encrypting unless you have a separate, secure location for the key. Full disk encryption on a computer is useful when someone types in the (password to derive the) key at boot time. Full disk encryption can also be done if the key is on a separate, physically protected storage area such as a TPM or smartcard.

As far as I can tell, the Intel Edison has no such separate storage area. Furthermore, an Edison board can be booted from an SD card or USB stick, so anyone who has physical access to a USB port can extract all the data from the eMMC.

It seems that USB boot relies on U-Boot, so it's possible that replacing the official U-Boot image by a custom one that disables USB would force booting from the OS on eMMC. I don't actually know whether that's a possibility, I just don't have enough information to refute it.

Even with a custom bootloader, the board can be reflashed through the USB connection. This overwrites part of the eMMC, but not the whole thing, at least if the flash is interrupted. No matter where you try to put the key on the eMMC, a careful attacker could avoid overwriting it.

If your server needs to trust the data from the device, the feature you're looking for is called “secure boot” (or “trusted boot” or “verified boot” or a few other names, terminology isn't standardized). With Intel processors, this is achieved through a TPM (but embedded boards rarely have a TPM). With ARM processors, this is achieved through TrustZone plus some manufacturer-dependent tools. Neither technology is proof against an adversary who can spend a large sum of money, but breaking them requires at the very least a soldering iron, not just a USB stick.

|improve this answer|||||

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.