Results 1 to 4 of 4

Thread: [RESOLVED] [2.0][2005] Encrypting password in XML Config file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Location
    Bonny Scotland
    Posts
    141

    Resolved [RESOLVED] [2.0][2005] Encrypting password in XML Config file

    Hi,

    I'm looking to store a password which is used when connecting to a default ftp site via my app in an XML config file. I need to be able to retrieve this each time the program in loaded.

    I was wondering what the best way was to do this? I know that hashing encryption techniques are only one way and not suitable for the purpose. If using someting like a Symetric or Asymetric password i require a key which i presume would have to be hard coded into the application.

    Is there a better way of doing this or will the latter method i suggested be the advised solution?

    Many thanks in advance.

    Grant
    Last edited by MadCatVB; Jul 7th, 2006 at 04:19 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Encrypting password in XML Config file

    After 135 posts you really should know to specify your version. If you're using 2.0 then encryption support for config files is built-in.

    http://msdn.microsoft.com/library/de...AGHT000006.asp

    It's aimed at ASP.NET but it can be used for Windows Forms apps too. You just have to use the -pef switch when invoking aspnet_regiis. The bit about Web Farms is what you apply to your installations.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Location
    Bonny Scotland
    Posts
    141

    Re: [2.0][2005] Encrypting password in XML Config file

    Slight oversight on my part. consider my topic changed to include versions etc

    Thanks for the link. I'll look over it now.

    Cheers,
    Grant

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Location
    Bonny Scotland
    Posts
    141

    Re: [2.0][2005] Encrypting password in XML Config file

    Jmcilhinney,

    Thanks for that link, its got me heading in the correct direction. I've now read that and found a new link:

    http://msdn2.microsoft.com/en-us/library/89211k9b.aspx

    This link suggests using the Configuration class objects to change setting with in a config file.
    I forgot to mention in my first post that i am not using the app.config file to store these variables, but one that i have created my self 'DHFconfig.config'. What i can't seem to figure out from these links is if it is possible to encrypt information in a custom config file as apposed to the App.config or Machine.config file using the configuration code.

    Any further assistance would be greatly appreciated.

    Thanks,

    Grant

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width