Possible Duplicates:
What are the security concerns I need to consider while coding?
What should a developer know before building a public web site?
If you're not able to or just plain aren't going to use SSL then you should:
- Not be transmitting sensitive information.
- Using SSL does not make your website totally secure (man-in-the-middle-attack).
If, however, you still insist on attempting to secure your website without SSL, or you just need some general website security tips:
Cipher form information using Javascript (XOR etc..) before submitting (keep honest people honest).
On your login page transmit an SHA (> 1) hash of your password in a hidden field and clear the password field using the onsubmit event of the form. Don't just send the password in plain text. Again use an sha (> 1) javascript hash.
Don't pass information around using the query string. If you insist on using the query string, use AES encryption with a per session key and initialization vector.
Don't populate html controls that store value/text pairs with plain text ID's. Things like AccountID/AccountName. Instead Populate them with (AES Encrypted ID)/AccountName. And for Pete's sake don't concatenate and display the ID and it's associated Name string.
Authenticate on each request. In other words, if the session is still valid then you should have a session variable to indicate if the user has been logged in or not. If not, redirect or transfer to the login page.
For each request, if javascript is not enabled and you need javascript, simply display a link to or redirect to a page that explains how to enable javascript in various browsers.
Create an error page that doesn't display a stack trace or any other information about the site. It simply has a smiley face and a friendly message on it. Redirect all errors to this page.
HTMLEncode all fields before storing them in a database or re-displaying the information.
If page requests or login attempts happen too fast, use captchas to verify that the user is human.
Separate the database server from the web server (i.e. don't run them on the same machine).
Store a hash of the salted password and the salt, instead of storing the plain text password.
Secure your database server (topic of another discussion).
Secure your web server (topic of another discussion).
Validate user input (GET and POST data) before making use of it. (Range check etc..)
Use parameterized queries instead of concatenating strings of SQL. This avoids having to properly escape the SQL string for the database in question.
Anymore website security tips?