From a myTextBox.Text to a mySecureString.

  • Thread starter Thread starter thomasnguyencom
  • Start date Start date
T

thomasnguyencom

What's the best way to handle this situation securely?

I'm currently manually converting the string to a SecureString, but
for some reason it looks ugly.

public SecureString ConvertToSecureString (string str)
{
SecureString secureString = new SecureString();
foreach (char c in str)
{
secureString.AppendChar(c);
}

return secureString;
}

Thanks,
-tom
 
Back
Top