How to ensure password security when extracting a Securestring in C# WPF

Asked

Viewed 30 times

0

I was reading about Securestring and what she can offer. However, I am in a scenario where I have a Passwordbox and I want to extract the password of this component, encode it in hash and then compare it with another encoded password contained in a database, to then perform a simple login system.

I read that using the Password property is not a good idea, because once we manipulate it, we are subject to having this password stolen, since the data of a string exists in memory.

Considering that a string is an object present in managed memory, how can I ensure the safe extraction of a password from a Securestring, also generating as few copies as possible in memory? Or that’s not a good idea either?

  • I don’t know if I understand the question, what do you want to know, unless you want something impossible. what did you read to SecureString? What can you say to improve your understanding of what you want? Do you want to know if you can do something 100% safe?

  • That, or at least the safest way possible

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.