3

I am developing Xamarin applications (iOS + Android + common .NET Standard projects).

I collect sensitive data (strings) and want to:

  1. store it as secure as possible (not in storage, just in memory for some process)
  2. clear it from memory when some conditions is met

At first SecureString looked perfect for me, but I found that:

We don't recommend that you use the SecureString class for new development. For more information, see SecureString shouldn't be used on GitHub.

https://learn.microsoft.com/en-us/dotnet/api/system.security.securestring?view=netstandard-2.0

So what is the best way to achieve that?

BBNN
  • 33
  • 5
  • You could check the link below. it would be helpful. https://stackoverflow.com/questions/55590869/how-to-protect-strings-without-securestring – Wendy Zang - MSFT Aug 10 '20 at 05:32
  • If you use Entry in XF as a password field, then the string is in memory and can be dumped. Setting null doesn't help, because strings are immutable. What is best practice here? Setting the entry = null and start a GC? – Saftpresse99 Jan 20 '22 at 13:06

0 Answers0