Hi,
Finally, someone understands!
Wouldn't setting buffers to null characters when I am done with them
take care of this?
That's one consideration. But also avoid any functions that re-allocate
memory (realloc()). Use free-malloc in that case.
Take compiler optimization into accout. In some cases the compiler might
optimize out your zeroing code after finding out that the variable that you
are clearing is already dead.
Make sure (if you can) that the process cannot be debugged.
As others have said: make sure your processes memory space cannot be moved
to permanent storage due to swapping or hibernation for example.
Make sure that the whole information pass is secure. There's no reason
protecting the clear-text password in your code for example if it got copied
all around in the widget code you're using.
Never pass sensitive information to code that you don't trust. This means
shared libraries and even your own executable unless you made sure of it's
authenticity (use digital signatures).
Even after all of these you cannot do much if the OS or an OS component
tries to track your code. Or if someone hooks up a HW debugger. Or a logic
analizer to decode memory cycles. Or, or, or... There's no true security.
Only security that's good enough for not being worth while braking.