Solved

is it safe to store password on asp server side script

Posted on 2013-01-30
5
395 Views
Last Modified: 2013-02-01
Hi,

I have a webpage that is a form which displays the results upon submission of form.

I use html forms along with asp script to connect to a webservice to query from.

The form also has got a password field which i submit along with form data and validate in the asp code itself.  This technique is able to hide the password from my users in the webpage-->view source  area since the server side code is never visible.

I wanted a simple and low maintenance security solution and all my users should be able to share the same password therefore i used this technique.

Now my question is: how secure is this technique?  is asp server side code a good place to hide important information?

Thanks.
0
Comment
Question by:neptuneit
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Surone1
Comment Utility
how secure is your website host? i have found several places that allowed other customers  read and sometimes even write access to all of the other customers documents on the webserver. i must admit it was free hosting, but still...
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
Comment Utility
It does not matter if you are using asp, php, python or whatever your serverside code of choice is.   Storing passwords is as safe as your webhost as somebody browsing your site can no access anything between the asp tags <% %> unless you do a response.write or have some type of error (this is why iis7 defaults to not showing errors).

Storing your passwords on the page is just about as safe as storing the passwords in the DB.  

However, things can get compromised and for that reason, sensitive items in the database are typically stored with either one or two way encryption depending on the data.  A password would be stored with a one way encryption like sha1 or md5(less secure).

Basically when a password is saved to the DB you use serverside code to encrypt it.  The code could be as easy as
<%
pass=request.form("password")
pass=sha1(pass) ' where you have the function sha1 loaded in your page
' even more secure is using secret keys or "salt"
pass=sha1(pass&"somepassword"&"anotherpassword"&adate&an_id)

%>
You can read up on this http://en.wikipedia.org/wiki/SHA-1  and use functions for encryption http://code.google.com/p/crypto-js/

But the short answer for your question, is go ahead and use simple passwords.  


<%
showPage=0
pass=request.form("password")
if pass="xyzabc123" then
  showPage=1
end if

if showPage<>1 then
    response.redirect("anotherpage.asp")
end if
%>

The only way somebody can see anything between the<%%> is if they get ftp access to your server and can download the page.  Oh, see security of ftp  http://en.wikipedia.org/wiki/File_Transfer_Protocol
0
 
LVL 1

Author Comment

by:neptuneit
Comment Utility
Thanks Padas for such detailed explanation.
0
 
LVL 1

Author Comment

by:neptuneit
Comment Utility
Hi,
for the problem described above, is it okay to leave the following IIS 7 setting as is?

'Enable Server Side Debugging === True'

are there any other setttings i should worry about?

Thanks.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
Turn that off as well as send errors to the browser unless the only way you can debug is seeing the actual errors.  Just turn it off when you are done.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

762 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