Breaking crp level 1 stm32f103

Nice!
I managed to dump what I needed to dump by now. I glitched out 2 blocks of plaintext firmware and was then able to perform an XOR keystream recovery using the plaintext and the update file contents and craft a custom update file with some guesswork on the CRC and a few other fields in the update file to dump the magic bootloader that performs the firmware decryption etc. Luckily the update file contents ween’t authenticated in any way. I got everything I need now :slight_smile:

I think I am going to revisit the glitching at some point though, because I am still mad at that erasure stuff. It almost feels like a countermeasure tbh, because it behaves so weirdly: Once it starts erasing itself, it doesn’t react on nRST anymore. It takes a while until it responds again at all. I tried detecting this behaviour and turned off its power in this case, but I was too slow and the flash already contained zeros all over the place. I suspect that the countermeasure starts flipping all bits in flash pages to zero, because that happens relatively fast and then starts erasing the pages. This is where I switched off its power.

I ran into all kinds of weirdnesses though, no matter if I used my own glitcher or the Chipwhisperer. I glitched and once I reached a certain block, no glitches would hit anymore. I left it run for hours and nothing happened. When I skipped to the next 256 byte block, it started glitching again. Then the erasures all the time, my own glitcher managed to cause glitches more often than the Chipwhisperer etc. There are just so many variables that make all this so hard to reproduce, it’s exhausting…

I think I am going to build myself a target board that allows for very quick power cycling of the target chip using a MOSFET so that I can kill it quickly like you do and just loose the first sector when the countermeasure trips. But all this is more of an academic interest by now.

regarding all the weirdness you see is reduced when I run the CW without enabling the glitch module. This will of course not give any output but it will increase the temp on the STM chip to where tings becomes more stable. I usually run in this mode like 5 min before I enable the glicher. I also try to keep a constant temp in the room and this usually also helps a bit.
When all temps looks stable I use the CW in scope mode to read out exactly where I need to set the glitch for so to fine tune the last parameter before running the glitcher.

But my office is pretty small so temp could drop when I leave the room so. Yes. That is a bit painful :slight_smile:
This is why I have to stay in my office until I hace read the first sector 2-3 times lol
After this I can leave it running over night and as usual only sector 0 is erased.

You can see on this image (cross) where I get the best result. offset ~558 ish.
This will also vary from chip to chip but the pattern is the same on all of them, only the offset changes a bit.

can you please share connections from stm32f1xx to chipwhisperer ?