URGUNT help: setting up chipwhisperer with sasebo-w

Hello all!

I’m doing a research on side channel attacks and have sasebo-w board with smart card and a 6000s picoscope. I also have “chipwhisperer-0.12RC1” installed on my windows and FTDI drivers as well.
All sasebo-w modules are programmed including the FPGA and AVR. When using default sasebo-w files, everything is okay. I get the encrypted data and power traces as expected.
The bad part is that when I use chipwhisperer capture instead of default sasebo files, it cannot connect to the board! But with using example scripts(AES 128 sasebo-w with smart card) it doesn’t work beacuase i don’t have opanadc. when i change the scope to PicoScope with previous configurations, it connects to picoscope successfully and shows the waves, but it doesn’t connect to the board. The error given is

Traceback (most recent call last):
  File "C:\chipwhisperer-0.12RC1\software\chipwhisperer\capture\ChipWhispererCapture.py", line 730, in doConDisTarget
    self.target.con()
  File "C:\chipwhisperer-0.12RC1\software\chipwhisperer\capture\ChipWhispererCapture.py", line 192, in con
    self.driver.con()
  File "c:\chipwhisperer-0.12rc1\software\chipwhisperer\capture\targets\SmartCard.py", line 771, in con
    self.driver.con(self.oa)
  File "c:\chipwhisperer-0.12rc1\software\chipwhisperer\capture\targets\SmartCard.py", line 405, in con
    self.scard.con(oa)
  File "c:\chipwhisperer-0.12rc1\software\chipwhisperer\capture\targets\ChipWhispererTargets.py", line 469, in con
    data = self.oa.sendMessage(CODE_READ, ADDR_STATUS)
AttributeError: 'NoneType' object has no attribute 'sendMessage'

Do you have a clue what’s wrong? I guess chipwhisperer can communicate with sasebo-w board and picoscope without needing for openadc being used…

Thanks in advance

I also tried the following config:

[‘Glitch Explorer’, ‘Recordings’, ‘Notes’, ‘’]
[‘Key/Text Pattern’, ‘Fixed Encryption Key’, ‘2b 7e 15 16 28 ae d2 a6 ab f7 15 88 09 cf 4f 3c’]
[‘Key/Text Pattern’, ‘Fixed Plaintext Key’, ‘00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F’]
[‘Generic Settings’, ‘Scope Module’, ‘PicoScope’]
[‘Generic Settings’, ‘Target Module’, ‘Simple Serial’]
[‘Generic Settings’, ‘Trace Format’, ‘ChipWhisperer/Native’]
[‘PicoScope Interface’, ‘Scope Type’, ‘PS6000’]
[‘Serial Port Settings’, ‘Port’, [‘COM6’]]
[‘Serial Port Settings’, ‘Port’, ‘COM6’]
[‘Serial Port Settings’, ‘Refresh’, None]

and it gives error:

Traceback (most recent call last):
  File "C:\chipwhisperer-0.12RC1\software\chipwhisperer\capture\ChipWhispererCapture.py", line 768, in doConDis
    self.doConDisScope(True)
  File "C:\chipwhisperer-0.12RC1\software\chipwhisperer\capture\ChipWhispererCapture.py", line 757, in doConDisScope
    self.target.setOpenADC(self.scope.qtadc.ser)
AttributeError: 'PicoScopeInterface' object has no attribute 'qtadc'

But when I hit Target after it, it connects but all responses have length of zero!
I have tried this software for weeks but unfortunately I don’t know how to get a successful trace yet!

Hello,

I think the driver currently in the system doesn’t work with the original SASEBO-W code. Can you send me a link to the original working version you are using? It was supposed at one point, so can double-check if that is a simple thing to get working again…

-Colin

Hello Colin,
Thanks for your quick reply

Of course! This is the link to the original version of sasebo-w codes and this is the guide for it. If you know a solution which works with the original version I would be so glad and thankful :wink:
But where is the alternative codes which work with sasebo-w and picoscope (unfortunately no openadc) ?
Which codes should be programmed to the FPGA and the IC card that works with both sasebo-w and picoscope?
And after all which settings is suitable for this purpose in Chipwhisperer capture?

Thanks a lot for all your time and efforts
Sincerely

Hello,

I’m actually having trouble getting my SASEBO-W board working with the new computer for some reason, so taking longer than expected. But I can tell you what I planned on trying and maybe will give you a starting point.

There used to be a “serial” smartcard protocol, but I think I removed it as was somewhat outdated. I was hoping this would work with the SASEBO-W board, as the default setup in the guide you linked makes the board appear as a serial port. If I can get my SASEBO-W board working it might be a quick job to get that back in the software, and should give you the required functionality if so. I can’t promise though as I may have removed that module for another reason (i.e., wasn’t working with this board).

It may be a few days at least though before I get enough time to sort out why my board isn’t working on the new computer! Hopefully will have a better answer then…

Regards,

-Colin

Hello Colin,

It’s so nice of you helping us :wink:
Today I discovered when setting target of AESExplorer to SASEBOW Serial, the software can get the ATR successfully! Does that help?
I implied from your previous response that programming the FPGA with non-original sasebow files should work. If the idea of adding a simple module to chipwhisperer failed for some reason, do files from this link help?

Thanks a LOT

Hello,

Got it working - as I thought the code was 95% there already, as I had this working with the old software. It’s in the latest commit of GIT software. If you are using ChipWhisperer-Instant a “git pull” will be enough to give you this update.

With this working the steps are:

[list=]
[]Select “Smart Card” as target
[
]On the target tab, select “System Serial”
[]Select “SASEBO-W SmartCard OS” as protocol
[
]Hit “Refresh Button”
[]Select your COM port in the drop-down
[
]Hit “Connect”
[*]Check the ATR is correct
[/list]

Depending on your system, hitting “Refresh” might be enough. Otherwise you might need to check the com port is correct.

Use the monitor to check the input/output to the card, and just press “capture 1” to confirm it’s sending/receiving data.

With all that working, you can now connect your scope and it will also record power traces.

Let me know how it works!
sasebow_settings.png

Hello Colin,

That’s so great!!! That is exactly what I wanted!
I use files from this repository. Unfortunately it was the latest version! I’m not sure if I’m doing something wrong that I don’t see the “System Serial (SASEBO-W)” option in Reader Hardware when setting target to smartcard in the program, or the repository I’m using does not have the commits you mentioned! I checked out the whole project and reinstalled it but there was no success! I also checked Commits tab of github But didn’t find anything relative…
I promise this is the last question of this thread :mrgreen:

Regards

Oops… I forgot to have my script push updates to that repo, hold on a few mins here. The main repo is help on assembla.com/spaces/chipwhisperer , but the github one will be updated in about 10 mins automatically (restarted the script, takes a few mins to push everything through).

And don’t worry if there is more questions, I haven’t tested the code well so things might have broken :wink:

The github repo should be updated now!

For some more details - made a quick video demoing the setup, see https://youtu.be/TvwxgyRK2fo. Don’t have a lot of examples of using ChipWhisperer Software only, so made a nice demo…

Hello Colin,

Finally everything is solved!!!
Thanks so much for your PERFECT support :wink:

I don’t know how to thank you,
Wish you the best

Hello Colin,
Hope you are well,

As you mentioned in video, each trace of length 20000 and sample rate of 156MS/s would be a good start for attacking AES. This makes the capture time 20000/156M=0.128 miliseconds . As I measured from my picoscope trigger channel, it takes about 4 miliseconds for AES algorithm to finish. So the capture takes about 3.2% of all the AES running time.
How is that it’s working? I guess perhaps your answer would be that our leackage model only uses first round. But I think even the first round takes more!

Regards

Hello,

Yup - in this case the leakage model is only capturing the S-Boxs. So it’s even less than the first round… just the beginning part of the first round is all you need!

Regards,

-Colin