Jump to content


Losing last 1 or 2 characters in md5 encrypted passwords.

  • Please log in to reply
4 replies to this topic

#1 civalo

  • New Members
  • Pip
  • Newbie
  • 1 posts
  • LocationPortland, OR

Posted 19 February 2003 - 03:29 AM

I have a membership database created using mysql that is based on the tutorial on this site. Everything seems to be right, however, mysql is dropping the last 1 or 2 characters of the encrypted passwords.

At first i figured that the VarChar field was not large enough set at 30, and felt kinda dense...lol....so i set it to 50....still dropping them.....

then i figured it was my script, but it drops them even if entered directly in Mysql......

Any suggestions would be helpful.....if you like...the site is at

Thanks in advance.

#2 benW

  • Members
  • PipPip
  • Member
  • 12 posts
  • LocationWaukesha WI

Posted 01 March 2003 - 01:44 AM

Try using BLOB or TEXT instead of VARCHAR

<?php str_replace("ASP", "PHP", $str); ?>

#3 sohaibshaheen

  • Members
  • PipPip
  • Member
  • 23 posts
  • LocationPakistan

Posted 29 August 2010 - 04:17 AM

Md5 string is 128 bits long....    >:(
Follow me on twitter @sohaibshaheen


#4 Pikachu2000

  • Staff Alumni
  • I hate everything.
  • 11,384 posts
  • LocationFuture Independent Republic of Texas
  • Age:106

Posted 29 August 2010 - 04:23 PM

Try using BLOB or TEXT instead of VARCHAR                   

It's a 32 character hexidecimal string. Store it as CHAR(32), if you must use MD5. You'd be better off using something stronger, with a salt, though.

"Java" is to "Javascript" about the same as "fun" is to "funeral".

Why $_SERVER['PHP_SELF'] is bad. || Why ORDER BY RAND() is bad || Every problem can be solved with rm -rf *

Random Quote: "

Remember, you're unique. Just like everybody else!

#5 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 30 August 2010 - 02:36 PM

Try using BLOB or TEXT instead of VARCHAR                   

That's a terrible idea -- performance hell.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users