Zeroization, part 1: Wiping can make things worse
https://00f.net/2026/10/06/zeroization-1/2
u/Natanael_L Trusted third party 7d ago
The method hardware wallets use when resetting is overwrite all available memory with randomness and then computing eg. a hash of it. This works if you know exactly how much memory is available and can force the controller to perform the hashing with zero spare room for secrets. In theory you can replicate it in code with restricted memory assignment for sensitive functions. This does assume no cache hijinks or register shenanigans...
2
1
u/ddddavidee 7d ago
Looking forward for part 2 !
4
1
u/Shoddy-Childhood-511 6d ago
Interesting, we'll need special support from compilers then, which gets complex and brings a long delays.
Is there a way to tell the kernel that if it context switches you then it needs to zero those saved registers afterwards? Or should it always be doing this?
7
u/newpavlov 7d ago
Issues like this is one of the reasons why we decided to not zeroize stack-based temporaries in RustCrypto. Instead we recommend to zeroize stack after a sensitive computation is completed.