After a user reported that the settings on their Krux device changed unexpectedly, and with the disclosure of threads like "Dark Skippy" I decided to invest time in protecting Krux from tampering.
My first objective was to investigate if it was possible to implement some type of tamper protection for Krux K210-based boards, such as secure boot. The K210 specifications mention firmware encryption and One-Time Programmable (OTP) memory, which could make secure boot viable, but there was no documentation on how to implement it.
The lack of documentation didn't stop us from exploring K210 features before, so I started a quick investigation.
My first finding was that I was not the first to explore these poorly documented characteristics of the K210. Wladimir van der Laan, while still the lead Bitcoin Core maintainer, conducted a deep investigation into the K210, also trying to determine how to use the chip's OTP memory.
Wladimir's OTP Layout Documentation
Wladimir was later followed by other researchers in the Netherlands, who used Ghidra—an open-source reverse-engineering tool developed by the NSA—to analyze the chip. However, they concluded that it was not possible to implement secure boot on the K210 because writing to its OTP memory was blocked by a written flag. They didn't know if the blocking flag was set by Sipeed, the manufacturer of the board used in tests, or by Canaan, the chip's manufacturer.
Reverse Engineering the K210 Report
Given that highly specialized engineers failed to use the K210's OTP memory, I gave up on the attempt to implement secure boot for Krux. However, I didn't give up on making it more secure. I decided to develop a tamper detection tool.
The Tamper Check Flash Hash (TC Flash Hash) feature verifies the integrity of the device's flash memory by generating a unique tamper indicator that relies on hash properties.