473,395 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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



Jul 17 '05 #1
2 1580
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" <ph********@f-in-stupid.co.uk> wrote in message
news:Vk**********************@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


Jul 17 '05 #2
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" <ph********@f-in-stupid.co.uk> wrote in message
news:JZ**********************@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" <ph********@f-in-stupid.co.uk> wrote in message
news:Vk**********************@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



Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Daneliuk | last post by:
OK, I've Googled for this and cannot seem to quite find what I need. So, I turn to the Gentle Geniuses here for help. Here is what I need to do from within a script: Given a username and a...
7
by: jrefactors | last post by:
I want to ask how password is stored and how to check the authentication? I have heard password is never encrypted and decrypted, but it is hashed. For example, consider a simple email logon...
2
by: Rod | last post by:
I have a requirement in which I need to allow the user to log into our ASP.NET application, but also be able to change their Windows password, if it is expired. I had thought that Windows...
3
by: Henry | last post by:
Hi, my asp.net application is accessing a mssql on another server. This works fine when I use this in my web.config file: <add key="dbkey"...
4
by: sunniyeow | last post by:
Hi, My question is regarding password protecting 2 different folders inside a single virtual directory using forms authentication method. Easier if I illustrate things out... - <authentication...
3
by: Prabu Subroto | last post by:
Dear my friends... I am using SuSE 9.1 and postgres 7.2.x . Each time if I want to connect to postgres with postgres I do like this: " patrixlinux@patrix:~> su Password:...
2
by: J | last post by:
Hello. I apologize if this isn't the appropriate group for this question but I was wondering if it's possible to allow regular windows domain users to change their passwords through an .asp page? ...
5
by: nick | last post by:
I need to create a simple asp.net application that use password protect some html pages. The html page provider doesn't know asp.net. And the host doesn't allow me to create user accounts. ...
9
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and...
5
by: =?Utf-8?B?Sm9l?= | last post by:
I need to store a password for use later in my web app and I would like to use FormsAuthentication.HashPasswordForStoringInConfigFile. The question is, once it's hashed and stored, do I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.