Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Remember password" option [C#]

Tags:

c#

passwords

save

i need to implement a "Remember password" option in my program, it works with client-server protocols that REQUIRE the entire password to be passed in the loggin process, not only Hashes, so i need to store the entire password locally. I searched all over the place but i found no conclusive answer or no answer at all. But since Email clients, Internet Browsers, IM clients do it, it shouldn't be impossible...

so, what's the best method?

Thanks

like image 888
Caian Avatar asked Jan 30 '26 03:01

Caian


2 Answers

1) Just dont do it. No matter how good your security not storing passwords is still better.

2) If you have to do it, consider windows secure storage

like image 125
JeffreyABecker Avatar answered Jan 31 '26 17:01

JeffreyABecker


I'd use the CredentialsUI. There's an article on MSDN explaining how to use it in .NET.

I'm fairly sure it's what's used by modern email clients, Internet Browsers etc. It provides an option to save your credentials, encrypted using DPAPI.

I've created a C# wrapper class that makes it easy to use from managed apps.

like image 41
Joe Avatar answered Jan 31 '26 17:01

Joe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!