0

Need to store the username and password for an outside application inside of a windows forms vb.net app. For initial testing, I just set the settings type to "Text", but want more security.

There are System.Security and Encryption types available, but not sure where to begin. Any suggestions on how to Add, Update, and Delete the values is appreciated. Seems to be much more involved than the plain text.

Although I want some level of security, this is not for any type of financial or medical application.

EDIT: Code Error System.Configuration.Configuration Type is not defined.

Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Dim configSection ConfigurationSection
configSection = config.ConnectionStrings
If Not (configSection Is Nothing) Then
    If Not (configSection.ElementInformation.IsLocked) Then
        configSection.SectionInformation.ProtectSection ("DataProtectionConfigurationProvider")
        configSection.SectionInformation.ForceSave = True
        config.Save(ConfigurationSaveMode.Full)
    End If
End If
2
  • define what you mean by "more security". What threats are you worried about? Commented Feb 6, 2010 at 23:09
  • The config file is plain text, so I don't want someone to see the user name and password for another application. Similar to encrypting connections strings. A general level of encyrption should do the job. @GregS - how does this change your answer? Commented Feb 8, 2010 at 13:11

2 Answers 2

0

.NET Framework Developer's Guide: Cryptographic services

Sign up to request clarification or add additional context in comments.

Comments

0

Decided to stick with the string type and just encrypt the values being saved. The answer to this was helpful: How to encrypt a string in .NET?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.