extra letters in md5?!

  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

ok,

I created a login code, works fine....

But, when i input the correct password it doesnt work. I have tried this without the database password being md5 and the input password.. they come out identical and it works fine.

When i md5 the password in sql and in the input on the form, the numbers and letters come out identical (because i echoed them just to check) but the input password comes out with extra letters and numbers:

Here they are:

gmforum
pass: df5864d4daadad6840b5
inputuser: gmforum
inputpass: df5864d4daadad6840b52a2dcfb08990


The password is meant to be: gmforum (this is a test login script, nothing special).

I tried them as i said before without the md5 encryption and it showed:

gmforum
pass: gmforum
inputuser: gmforum
inputpass: gmforum


And there was no error message just said "Welcome", but when md5 it would say "incorrect password".

I md5 my password like this to compare with the database:

PHP Code: [ Select ]
 
$user = $loginvars['user'];
 
$pass = md5($loginvars['pass']);
 
 
  1.  
  2. $user = $loginvars['user'];
  3.  
  4. $pass = md5($loginvars['pass']);
  5.  
  6.  


then i compare like this:

PHP Code: [ Select ]
 
if ( $sqluser == $user && $sqlpass == $pass ) {
 
$uerror = Welcome;
 
 
  1.  
  2. if ( $sqluser == $user && $sqlpass == $pass ) {
  3.  
  4. $uerror = Welcome;
  5.  
  6.  


im really confused, why is this happening?1
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Maybe in your mySQL database, you set that field so it could only be 20 chars long so when you made the password, it got limited to the first 20 characters or the md5'd password.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 80 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.