Solved

is it safe to store password on asp server side script

Posted on 2013-01-30
5
401 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
ID: 38835474
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
ID: 38835552
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
ID: 38835957
Thanks Padas for such detailed explanation.
0
 
LVL 1

Author Comment

by:neptuneit
ID: 38844405
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
ID: 38844473
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

679 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