Re: secure login form
- From: Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@xxxxxxxxxxxxxxxx>
- Date: Thu, 05 Jun 2008 16:10:09 +0200
Harris Kosmidhs schreef:
Hello,
Hi,
while I'm developing sites for some time I never coded a login form with security in mind.
I was wondering what guidelines there are.
For my point of view I'm thinking of using md5 passwords (it's an one way function right?) in db. Is this a correct approach?
What is it you want to protect against excactly?
If you want the avoid the man-in-the-middle eavesdropping on you: Then you need https, as you described.
If you are afraid the username/password you store in your database is hacked somehow, then it can make sense to store them with an md5 hash, which is one-way encryption indeed.
So that means you, as admin of the database, cannot tell what the password is since you only see the md5 hash.
You can check of course if a provided password 'translates' to the stored md5.
Personally, I stopped storing my passwords with a md5 hash in database.
I figured that if somebody can enter my database at will, my site is hopelessly cracked beyound repair anyway. ;-)
Then, if I'm permitted by the server admin I want to use https. Is it as simple as puting the login form in the httpdocs of the https server an when login is successful then I just set a session variable? Will I then be able to read this from a page under http?
You have NO shared session between you http and https pages.
So if you need that, you must build that yourself somehow.
(You can propagate the sessionid from http to https via a form, and let the receiving script use that sessionid for its https session. But be carefull and always remember that your client can set ANY value for PHPSESSID easily). Always try to hack your own site with all the knowledge you have about its internals.
Besides that, you also might consider getting a security audit.
Thanks in advance.
Good luck.
Regards,
Erwin Moller
.
- Follow-Ups:
- Re: secure login form
- From: Harris Kosmidhs
- Re: secure login form
- From: Captain Paralytic
- Re: secure login form
- References:
- secure login form
- From: Harris Kosmidhs
- secure login form
- Prev by Date: create html from flat file
- Next by Date: Re: secure login form
- Previous by thread: secure login form
- Next by thread: Re: secure login form
- Index(es):
Relevant Pages
|