AES masking on CW - a few questions

Hi,

I was looking through the CW folders, and under \chipwhisperer\hardware\victims\firmware\crypto I came across Higher-Order-Masked-AES-128 and masked-bit-sliced-aes-128. I’m wondering:

  1. The masked-bit-sliced-aes-128 folder is empty, are there any plans to add this to regular CW attack tutorials?

  2. Based on Higher-Order-Masked-AES-128, how do I need to go about to use this for a CW target attack? (or is it unfinished in the sense that it would require more coding?)

  3. This question is more about learning how to incorporate external code into the CW framework in an easy way to evaluate attacks on other algorithms. I found this online for Byte-Masked-AES: https://github.com/Secure-Embedded-Systems/Masked-AES-Implementation/tree/master/Byte-Masked-AES Since I’ve never done this before, I was wondering if someone could guide me as to how to incorporate this code into the already existing CW framework to test it out

Thanks!

Hi,

Those folders are actually submodules. If you run git submodule update --init /path/to/submodule, those folders should get populated.

For just a few files like that, I’d recommend:

  1. Make a copy of simpleserial-base
  2. Add the .c. and .h files for the new code to the new simpleserial-base folder
  3. Edit the makefile in the new simpleserial-base folder to add the .c. file to SRC
  4. Use whatever functions you need in simpleserial-base.c

Alex

Hi,

Thank you, I’ll try that out. While on the topic, I’ve been looking through various c files to try and get a better understanding of what’s going on “under the hood”, and in “aes-independant.c”, there seems to be some options that offer masking, e.g. MASKEDAES and ANSSI_CM4. However, I can’t seem to find any instructions of how to use these. I tried the obvious one of defining CRYPTO_TARGET = ‘MASKEDAES’, but that didn’t work out. I was therefore wondering if you could please guide me to where I can read about how to use these functions. Also, are there any associated papers related to these masking techniques where they are explained in more detail?

Thanks!

Hi,

I think you need to build with CRYPTO_OPTIONS=ANSSI as well. Also, I think the submodule for that masked aes implementation got removed at some point. It should be readded soon.

There should be lots of papers out there about masked aes implementations. I can’t really help you there though as I don’t know much about masking.

Alex