LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-06-2009, 02:17 PM   #1
simopal6
Member
 
Registered: Jun 2006
Location: Italy
Distribution: Slackware 13.1
Posts: 230

Rep: Reputation: 30
Transmission of passwords via HTML forms


Hi!
This is the (common and obvious) problem: how to securely send passwords via html forms, in case someone is sniffing your traffic?
Currently, in my web sites, I "encrypt" (md5) the password before submitting the form. Anyway, this does not seem to be a solution, because if you sniff the encrypted password, it is practically the same as sniffing the plain password, since you can HTTP POST it to the server and the result is the same as knowing the plain password.
So, I thought of doing this: instead of sending md5(password), I can send md5(password+session_id). Of course, this would mean that the user must accept the session cookie or anyway must transport the session id as a GET variable. My doubt is I don't know exactly how sessions and session ids work and are managed by php, so I'm not sure that it would be impossible to forge/copy a session id in order to use a previously sniffed encrypted password.
I would like to hear some comments/suggestions :-)
Thank you!
 
Old 10-06-2009, 04:13 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Just use HTTPS for sensitive transmissions.
 
Old 10-06-2009, 04:16 PM   #3
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
what is the purpose
does it need to be a secure service or just a simple lock out
for other people to get in?
 
Old 10-06-2009, 04:27 PM   #4
rdgreenlaw
Member
 
Registered: May 2007
Location: Newport, Maine, USA
Distribution: Debian 8.7
Posts: 73

Rep: Reputation: 18
Take a look at this site: http://www.zubrag.com/scripts/password-protect.php

It seems to have everything one would need to be able to password protect a php site. It allows for password only access and username and password combination access. Omitting the user name sets it up for password only. If you choose to enable cookies the username and password only need to be entered once when accessing the site, otherwise the user will be prompted each time the page is refreshed or another page is selected from the site. The documentation seems to be very clear, and the site that I am directing you to is a forum with questions and answers that will probably enable you to successfully set up the form. I would guess that since it uses PHP it is probably passing plain-text information over the network. To successfully setup a password protected system would require that the password be transmitted with an encryption key. SSL was designed specifically for this purpose.
 
Old 10-06-2009, 10:12 PM   #5
verdeboy2k
Member
 
Registered: Jan 2004
Location: /dev/random
Distribution: Gentoo amd64, CrunchBang amd64
Posts: 350

Rep: Reputation: 32
If you don't need actual security, having the server and some javascript generate some one-time-only nonce or salt would prevent people using the md5 hash to login.

If you need actual security, SSL is the way to go.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML Forms and fieldset shmuck Programming 1 02-27-2008 10:30 PM
LXer: Html Forms and PHP LXer Syndicated Linux News 0 01-09-2007 01:33 AM
Forms in HTML J_K9 Programming 5 06-30-2005 02:21 PM
HTML Forms belorion Programming 1 02-01-2005 11:41 PM
Breaking up html forms logicdisaster Programming 4 06-18-2004 12:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration