473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DPAPI Examples

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.

May 16 '06 #1
2 2094
..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

May 16 '06 #2
Thanks for the information Tasos.

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

May 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: james | last post by:
I have crated DPAPI libraries and Serviced component running under a specific user. But when i call this serviced component to encrypt a specific username and password(input values) it gives...
1
by: Nicholas Then | last post by:
I have just written a COM object which ties into a roaming user profile so that I may use DPAPI on many machines and have the same encryption and decryption. When I install it on 2 of my servers...
0
by: Kalvin | last post by:
I am using the article on Microsoft's site to create a DPAPI library at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod21.asp On the API declarations I am...
1
by: Shaun | last post by:
Hi, I'm trying to implement encryption of connection string using DPAPI User Store. One of the objective is, after reading the connection string from Web.config file, my program has to know if...
2
by: Shaun Ram | last post by:
I am working on using DPAPI user profile store to encrypt a connection string in web.config file, using VB.NET 1. I have a situation here, I would not want the DPAPI User profile to be...
3
by: DazedAndConfused | last post by:
Can anyone point me to a good example of using DPAPI with VB .NET and SQL 2000?
0
by: pinki | last post by:
Hello I have problem with DPAPI in windows 98. I`m trying to use class SecureString (Framework 2.0.x) in my .net application. I get exception: "SecureString is only supported on Windows 2000...
3
by: michael sorens | last post by:
In the interests of increasing security, I came upon the DPAPI security library available from the GotDotNet user samples repository. What I want to do is create an applications that accesses a...
1
by: BigLuzer | last post by:
hi i am using the following setup: - .net 1.1 - 2 load-balanced iis servers - DPAPI machine store. - C# - i encrypted the connection string separately, one on each machine. the error i get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.