Solved

Passwords in web.config

Posted on 2006-06-26
3
975 Views
Last Modified: 2006-11-18
I have been able to run though this example and get it working: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000006.asp

However, what parts should i keep and delete in the web.config?  Also, how does the code change when accessing it?

Currently all i am trying to encrypt is

      <smtp deliveryMethod="Network" from="this@that.com" >
        <network defaultCredentials="false" host="there.this.that" userName="them" password="dunno"  />
      </smtp>

Later when i put in a database i will need to do that connection string aswell.  Currently I only need the <network.. to be encrypted.  I have tried this example and it seems to put the new encrypted text in connection strings.  Do i leave them in there or do i move it to smpt?  Also, is there anywhere in the web.config that let's the program know what parts the encryption is for and what type of encryption it is using?

Thanks, this is kind of baffling me, but it seems like a 'do it once' and u'll know it forever type of thing.


0
Comment
Question by:UnexplainedWays
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
GENTP earned 500 total points
Comment Utility
I used this tutorial to understand the concepts, then simply encoded the connection string in the web.config as an appsettings key. I also encrypt the passwords in the DB, but that isn't really related to your question.

http://aspnet.4guysfromrolla.com/articles/082703-1.aspx

I think that by doing it right in the web.config, then going to a db, you aren't really saving yourself any time. I'd recommend just diving straight into doing it on the DB.

G
0
 
LVL 12

Author Comment

by:UnexplainedWays
Comment Utility
"I'd recommend just diving straight into doing it on the DB."

The smtp network will always be in the web.config, the connection string to the database will be added later to the config file.
0
 
LVL 12

Author Comment

by:UnexplainedWays
Comment Utility
I just had a look at your link, and that's more for people logging in to you website and what they are allowed to do, the xml i provided is used to send emails via smtp.  When you create a new smpt() it goes into your web.config and pulls out this information, so it's easy to tweak in there.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now