Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-26-2010, 10:10 PM   PM User | #1
iAmAFish
New to the CF scene

 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
iAmAFish is an unknown quantity at this point
security question

Hello everyone.

I am just experimenting with some dynamic web projects and i'm a little unsure about security precautions. I'm also really not quite sure where to ask these questions in this forum (so I apologise if this is not the correct place to ask, although since security is something that covers both server and client sides, it doesn't quite fit into either category). I have experience with databases and web front ends but security is something that I am quite new too.

A project that I am working on currently has a members area with a login. I won't be handling any sensitive data so it seems that encryption is not necessary, my plan is to have user name and password authentication (where i intend to hash passwords and transmit these where the server will reference again a users table in a database. (hashing simply to not transmit these as plain text). My concern comes with logging in as an administrator, I intend to have an administrator front end that gives a lot of privileges (such as being able to delete users). Since this is a little bit more sensitive, and hashing passwords is not very secure, Is encrypting the only way to establish a highly secure way to transmit data? I have been looking into using sessions more carefully (i.e. not allowing external sessionID's for one example) but I cannot think of any way to protect data transmission from a man in the middle that doesn't involve encryption (which I know nothing at all about in terms of setting up) any suggestions??
iAmAFish is offline   Reply With Quote
Old 11-11-2010, 08:49 AM   PM User | #2
divinequran
New Coder

 
Join Date: Dec 2008
Location: india
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
divinequran is an unknown quantity at this point
Hi,

The first thing is that you hash your password. Then you store in DB so that the admin too wont be able to decrypt the hash password. Actually you have done most to secure the details.

If you want more security then you can go a head with SSL.
divinequran is offline   Reply With Quote
Old 12-02-2010, 03:16 PM   PM User | #3
Lamped
Super Moderator


 
Join Date: Feb 2009
Location: England
Posts: 539
Thanks: 8
Thanked 63 Times in 54 Posts
Lamped will become famous soon enough
Relating to your main point about man-in-the-middle, the only way you can really protect against that is with SSL certificates and ensuring your login is over HTTPS only. You could use Javascript to encrypt the password before submitting the login form, but that's not very effective. If someone's going to the length of snooping on your connection, I'm sure they'll spend a couple of minutes going through the Javascript.

As for general security in a language agnostic way:

- Use sessions/cookies to store a key in the browser (sessions does this automagically in PHP), and store data on the server side. If it's a shared server and contains potentially sensitive data, do not save it in the default temporary directory. Check the referrer, user agent and possibly the IP (though I hear this is an issue for proxied ISPs like AOL?) against the session data as an extra check against copied cookies. Never use transparent session ID features like PHP's transid.

- Always sanitise your database inputs. Always. Every time. Without fail. Unless you can be absolutely certain you're putting an integer into the database field, run it through the database's sanitisation/escape function, or use prepared statements.

- Make sure your administrator password contains at least 1 symbol, number and is a minimum of 8 letters long.
__________________
lamped.co.uk :: Design, Development & Hosting
marcgray.co.uk :: Technical blog
Lamped is offline   Reply With Quote
Reply

Bookmarks

Tags
man in the middle, security

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:52 PM.


Advertisement
Log in to turn off these ads.