[Cryptography] How to lock registers with GCC?

Guus Sliepen guus at sliepen.org
Fri May 9 04:23:12 EDT 2014


On Fri, May 09, 2014 at 01:56:40AM +0200, tpb-crypto at laposte.net wrote:

> While making an encryption routine I stumbled upon the possibility of using a register to keep the key, while erasing it from memory.

This would only work if you could convince all programs and the operating
system itself to not use that register by changing the platform ABI. Otherwise,
whenever your application calls a library routine or a context switch happens,
that register will be saved on the stack and will thus end up in memory after
all.

-- 
Met vriendelijke groet / with kind regards,
      Guus Sliepen <guus at sliepen.org>


More information about the cryptography mailing list