Groups > Asp .Net > Getting started with ASP.NET > Re: Sensitive Info in Code Behind Files, how to protect?




Sensitive Info in Code Behind Files, how to protect?

Sensitive Info in Code Behind Files, how to protect?
Thu, 3 Apr 2008 13:47:49 +0000
Hi everyone, I am trying to find information on how to protect sensitive
information like supplied logins and passwords in my code behind files.  I know
how to encrypt connection strings in the web.config file.  But how do I protect
login/passwords in my code behind files?  If anyone has info or can point me to
an article I would appreciate it.

 

Thanks
Post Reply
Re: Sensitive Info in Code Behind Files, how to protect?
Thu, 3 Apr 2008 14:00:06 +0000
My question to you is:
Why are you putting this information in your codebehind files?
You should (AT LEAST) put any sensitive data with connectionstrings in the
web.config file, using encryption, as you suggested.

(How do you publish the files (just copy them to the webserver, or compile)?)
Post Reply
Re: Sensitive Info in Code Behind Files, how to protect?
Thu, 3 Apr 2008 14:06:21 +0000
The reason I am doing it this way currently is, this is my first job as a
programmer, and this is what we learned in school.   I never learned to do it
any other way in school.  But I do recognize that it's not a good practice, so I
am trying to rectify that.

Right now it's not too big of a deal as I have only produced apps for Intranet
use.  Yes I just copy the files to the webserver.  ANy help or links you have
would be very helpful augustwind.

 

Thanks
Post Reply
Re: Sensitive Info in Code Behind Files, how to protect?
Thu, 3 Apr 2008 14:19:54 +0000
check this:

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

http://msdn2.microsoft.com/en-us/library/ms998310.aspx
Post Reply
Re: Sensitive Info in Code Behind Files, how to protect?
Thu, 3 Apr 2008 14:31:17 +0000
The main thing is to store your connectionstring information in your web.config,
if, for nothing else, since you use your connectionstrings multiple times in
your applications (usually), when anything changes in the string, you only need
to change it in one place.

Your first stop should be here (in the Tips & Tricks section of
ASPNet101.com:
http://www.aspnet101.com/aspnet101/tips.aspx?id1
Post Reply
about | contact