DPAPI Examples

P

PurpleServerMonkey

At the moment I'm writing a network aware application in C# .Net 2.0
and I'd like to ask the group for advice on how I should store the
username and password for the connection.

The application is a WinForms based application for Windows XP systems
that works like a POP mail client in that the client software has to
store a username and password for later use. Obviously I don't want to
store that information inside the application or in plaintext anywhere
else on the system. So what's the best way to handle this?

I'm fairly new to C# but my first guess would be to use the new
built-in DPAPI support in the .Net 2.0 framework however I haven't been
able to find many examples of using these calls.

Any thoughts or links to examples would be appreciated.
 
T

Tasos Vogiatzoglou

..NET 2 has managed DPAPI API. You can find more information at
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref11/html/T_System_Security_Cryptography_ProtectedData.htm

The class is the ProtectData class with two static methods Protect and
Unprotect where you can encrypt/descrypt a binary array, so if you want
to encrypt a string you have to convert it to bytes throught
System.Text.Encoding object.

Regards,
Tasos
 
P

PurpleServerMonkey

Thanks for the information Tasos.

It was easier to use than I first thought, it's now working just fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top