19 ms·
The point of SecureString is to ensure that sensitive information gets removed from RAM in a timely manner. It's just a wrapper around some native memory that g
by gwbas1c 8y ago
The point of SecureString is to ensure that sensitive information gets removed from RAM in a timely manner. It's just a wrapper around some native memory that gets zeroed when the SecureString object is disposed.
Otherwise, when you use standard C# strings, you don't know when the garbage collector will collect them.
(Granted, you could do similar things with pinning a char[] to a char* and zeroing it before you end the pin, but who wants to jump through those hoops?)
- saagarjha 8y agoBut what I want to pass a SecureString to someone? Doesn't a copy have to take place in that case?