Password authentication question

This is a discussion on Password authentication question within the PHP Language forums, part of the PHP Programming Forums category; I am trying something very simple, to pass the contents of a form (just username and password) to execute a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2005
Phil Latio
 
Posts: n/a
Default Password authentication question

I am trying something very simple, to pass the contents of a form (just
username and password) to execute a query on MySQL table. The problem
appears to be the password field.

For example,
username: money
password: penny

If type in the password as penny, it won't authenticate.

I checked the contents of password field in the MySQL table and somehow it's
converted it to a hexdecimal number. I then tried cutting and pasting that
hexadecimal number into the password box and it suddenly works.

What is happening? I am also wondering how to execute a query so the
password penny will match the hexadecimal number so the query returns a
value. Here's the current one below:

$sql="SELECT * FROM user_table WHERE username='".$username."' and
password='".$password."'";

Cheers

Phil







Reply With Quote
  #2 (permalink)  
Old 02-27-2005
Phil Latio
 
Posts: n/a
Default Re: Password authentication question

Found this thread using Google groups which sort of explained what is
happening.
http://groups.google.co.uk/groups?hl...Dcomp.lang.php

The bit I can't figure out is how other very similar scripts use the
password fields but they don't get converted to hexadecimal in tables. In my
particular script, the password field is a varchar(25) so should be big
enough to cope.

Need to do some more reading but any pointers will be handy.

Cheers

Phil






"Phil Latio" <phil.latio@f-in-stupid.co.uk> wrote in message
news:VkaUd.3499074$f47.626982@news.easynews.com...
> I am trying something very simple, to pass the contents of a form (just
> username and password) to execute a query on MySQL table. The problem
> appears to be the password field.
>
> For example,
> username: money
> password: penny
>
> If type in the password as penny, it won't authenticate.
>
> I checked the contents of password field in the MySQL table and somehow

it's
> converted it to a hexdecimal number. I then tried cutting and pasting that
> hexadecimal number into the password box and it suddenly works.
>
> What is happening? I am also wondering how to execute a query so the
> password penny will match the hexadecimal number so the query returns a
> value. Here's the current one below:
>
> $sql="SELECT * FROM user_table WHERE username='".$username."' and
> password='".$password."'";
>
> Cheers
>
> Phil
>
>
>
>
>
>
>



Reply With Quote
  #3 (permalink)  
Old 02-27-2005
Phil Latio
 
Posts: n/a
Default Re: Password authentication question

Success. I realised it was the way I was adding users to the database that
was causing the encryption.. I took the below statement out of one of Julie
Meloni books.

$sql = "INSERT INTO $table_name (name, username, password)
VALUES(\"$name\",\"$username\",password(\"$passwor d\")) ";

Cheers

Phil

"Phil Latio" <phil.latio@f-in-stupid.co.uk> wrote in message
news:JZaUd.3220716$B07.507976@news.easynews.com...
> Found this thread using Google groups which sort of explained what is
> happening.
>

http://groups.google.co.uk/groups?hl...Dcomp.lang.php
>
> The bit I can't figure out is how other very similar scripts use the
> password fields but they don't get converted to hexadecimal in tables. In

my
> particular script, the password field is a varchar(25) so should be big
> enough to cope.
>
> Need to do some more reading but any pointers will be handy.
>
> Cheers
>
> Phil
>
>
>
>
>
>
> "Phil Latio" <phil.latio@f-in-stupid.co.uk> wrote in message
> news:VkaUd.3499074$f47.626982@news.easynews.com...
> > I am trying something very simple, to pass the contents of a form (just
> > username and password) to execute a query on MySQL table. The problem
> > appears to be the password field.
> >
> > For example,
> > username: money
> > password: penny
> >
> > If type in the password as penny, it won't authenticate.
> >
> > I checked the contents of password field in the MySQL table and somehow

> it's
> > converted it to a hexdecimal number. I then tried cutting and pasting

that
> > hexadecimal number into the password box and it suddenly works.
> >
> > What is happening? I am also wondering how to execute a query so the
> > password penny will match the hexadecimal number so the query returns a
> > value. Here's the current one below:
> >
> > $sql="SELECT * FROM user_table WHERE username='".$username."' and
> > password='".$password."'";
> >
> > Cheers
> >
> > Phil
> >
> >
> >
> >
> >
> >
> >

>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0