2
$\begingroup$

I need some info/suggestions about the cryptographic algorithm that make me sure that the executed bios by the CPU is an authenticated bios. The check has to be performed by a FPGA.

I have SPI Flash that contains the bios code ( assembler code ), CPU and FPGA between CPU and SPI Flash.

The first idea was to authenticate the bios performing a HMAC authentication of the data stream between CPU and flash, but I saw that the stream is always different so impossible to authenticate ( the bios/CPU waits the wake up of the peripheral so perform each time different operations ).

The second idea is to encrypt the whole SPI flash and decrypt on fly with FPGA when the CPU request the data. I actually don't know if FPGA is enough fast to do this, but I'm sure I can't use an AES 128 because the FPGA isn't so fast to fetch 128 bit to decrypt only 32 bit ( during the bios execution there are a lot of memory jump and usually the fetched data are 32 bit for each CPU operation ).

$\endgroup$
  • $\begingroup$ FPGAs can outclass CPUs in performing crypto. $\endgroup$ – SEJPM Aug 24 '15 at 20:11
  • $\begingroup$ Of course it can, but fpga has to fetch data from SPI flash, decrypt on fly and provvide the plaintext to cpu. I don't need to outclass cpu. $\endgroup$ – haster8558 Aug 24 '15 at 20:17
2
$\begingroup$

Encryption does not imply authentication. With most unauthenticated encryption algorithms an attacker can cause at least random changes to the plaintext by modifying the ciphertext. Some algorithms are malleable, which means the attacker can even cause (some) changes they want.

Therefore, even if you could find a secure encryption algorithm that works quickly enough, it would not be enough to authenticate the BIOS. For that you need something like HMAC, which you mention. If you don't know the order the data is used in, and cannot afford to calculate a MAC over the whole data in advance, you could use several MACs for parts of the data. In that case you would also need to make sure the location of the data is authenticated (i.e. included in the "message" of the MAC) so an attacker cannot reorder the authenticated data blocks


Note that with symmetric keys the same key is used to both generate and check the MAC. That means the FPGA needs to know the key and an attacker with access to it would be able to use that key to forge another BIOS. To prevent that you would need to use asymmetric signatures, so that even if the attacker got the public key used to verify it, they couldn't forge new signatures. (They could still be able to replace the public key with their own, of course, which would allow then to sign whatever.)

$\endgroup$

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.