Closed micah686 closed 7 years ago
In regards to your comment the main benefit of secure string is actually the encrpytion, so .Net Core remains 'insecure' to me personally.
The reason why i haven't accepted this PR is because i'm undecided if i want to do half-arsed in-project warnings. There won't always be a console (And in fact, more times then not there shouldn't be a console), and i'm definitely not importanting any sort of UI stuff just to make an annoying warning.
Wouldn't it be cleaner to just use a Debug.WriteLine() to warn the programmer? That way, any programmer should see the error, but a user wouldn't, since it would be on a Release build.
If i do decide to figure out how to publish to nuget, it'll be a Release binary, where Debug.* doesn't appear.
.NET core seems to have a better implementation of SecureString though. https://github.com/dotnet/coreclr/blob/e74cdcb1ed6021eaf03eea5ee7f6ba3c6b403daf/src/mscorlib/corefx/System/Security/SecureString.Unix.cs#L11 Unix can do 2 out of the three SecureString mechanisms, but it can't encrypt the data while not in use. This really shouldn't matter too much anyway, since the API still needs plaintext passwords.