On .net we use
SecureString class to keep our applications variables in memory, safely.
Microsoft says: Represents text that should be kept confidential. The text is encrypted for privacy when being used, and deleted from computer memory when no longer needed. This class cannot be inherited.
This class is in a library called
mscorlib.dll I have doubts about security. Can someone replace this library with a corrupted one? A malware can corrupt this class to bypass its security and after that it can dump memory and access my variables in plain text. Is it a possible attack? If so, how can I protect my software against this attack?