Re: storing crypto key in CPU registers

steve Coleman <[email protected]>
Newsgroups gmane.comp.security.programming
Message-ID <[email protected]>
michel.d.lowe-at-verizon.com |securityFocus| wrote:

>Stuart,
>It would seem like a cool idea but I can think of a 
>
>couple of drawbacks. I'm not a kernel
>hacker or anything but it seems to me that unless your 
>
>security app is an actual part of
>the operating system kernel (easy if Linux, tough if Windows), 
>
>every time your operating
>system does a context switch your crypto key stored in a register would get
>dumped into
>RAM along with all the other pertinent info (gen'l purpose registers, stack
>pointer, etc.).
>  
>
Not to mention that stack overflow attacks would only have to do a 
'move/push register' rather than guessing at the runtime address of the 
key. Perhaps they might have to guess the register usage too, but the 
compiler used to compile the app forces certain constraints. No doubt it 
would have the side effect of speeding up the crypto stuff, but at what 
cost.

Maybe you could store a 'mask' in that register which is used to encrypt 
the key itself, before placing the key in memory. A randomized number 
generated on startup might allow a smaller register to be used for the 
mask than the key itself, and it would prevent any replay attack too.  
Just a thought.

Steve.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.