tags:

views:

253

answers:

4

Hi, 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

A: 

.NET provides the so-called 'Isolated Storage' feature, where you can store such data. In this MSDN article also references are given how the isolated storage can be encrypted to secure the stored data.

Sebastian P.R. Gingter
Isolated storage is not suitable for this. It's easily discoverable by anyone or anything (excluding silverlight/click once/partially trusted .net applications). You may as well store in "My documents"
blowdart
+3  A: 

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

JeffreyABecker
Point 1 is a /bit/ like saying "Don't take your keys out of your house in case you lose them"
Lee
Actually, I agree 100% with point 1. Once you know how easy it is to bypass all of the measures mentioned as answers to this question, you'll realize the wisdom of that point.
David Stratton
I'm very well aware of it, but there's a connivence/security trade off. I wouldn't store my banking passwords, but I would store my IM passwords.
Lee
But, if i secure the data with DPAPI it will be available to all processes running in my Loggon right? Can Windows return the data only to a specific process (through app's hash verification or something)?
Caian
A: 

Here is a related question. http://stackoverflow.com/questions/442923/windows-equivalent-of-os-x-keychain

Your app has to get the passwort in cleartext at some time. You can only make it harder for the attackers. It is a security/effort tradeoff.

David R
+2  A: 

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.

Joe