CW-Lite attacking XOR on PIC32MX


I’m trying to crack a simple XOR on a PIC32MX as a warm-up exercise.

What I have:

  • Test code with 32bit XOR with both values parsed from serial
  • Good trigger, also the XOR operation is surrounded with nops for better isolation.
  • The PIC32MX has internal regulation, I use extensive filtering on the 3v3 rail, I found overpowering the VCAP pin externally trough a shunt and measuring on the pin gives the least amount of noise.
  • If I test using the key as plain-text, then flip all the bits, i can clearly see the POI and have good repeatably.
  • Target is clocked from chipwisperer, ADC clock is x4

Now the problems:

  • Being a 32 bit system the Hamming weight has significantly more levels.
  • The SNR for a single bit is too poor.
  • The built in XOR cracking fails me.

Anybody has experience with PIC32MX devices? Should I just average thousands of traces for the same input and attack bit by bit? May differential probing help in this case?
Before i move on to other algorithms i want this XOR down.


A bit of update, i hope it will help others. Built in XOR attacking in the chipwisperer software works, despite being a 32bit controller.
The current setup looks like this: PIC normally powered with 3v3, with good filtering on the rails. The VCAPpin is connected trough a 0.5OHM shunt to also a fair amount of filtering. It is back-fed with 2V from an external power supply to disable the internal regulator. Voltage drop on the shunt is measured with a makeshift differential probe, based one the NEWAE differential probe.

The real problem was with the sampling phase relative to the signal. The sampling happened far from the location where the greatest signal change happened. I checked measuring the CW ADC-Clock and the signal on an oscilloscope. To fix this issue is added some delay in the target clock using CLC-s in a PIC(it was out of range for the internal phase adjust)

Conclusion: Keep an eye on the phase!