Sorry if this is an obvious solution, but searching has produced nothing for me.
I have a MySQL database with passwords encrypted using an MD5 hash. I then have java code that also encrypts using MD5 to check passwords that a user puts in.
This works fine for almost all passwords. However, if a password begins with a number, the hash does not work.
Here is an example, for the password '12345':
MySQL MD5 hash:
827ccb0eea8a706c4c34a16891f84e7b
Java MD5 hash:
827ccbeea8a706c4c34a16891f84e7b
Example for the password '1pass':
MySQL MD5 hash:
0a9f45cecbccaada43f6ca897743904d
Java MD5 hash:
a9f45cecbccaada43f6ca897743904d
The MySQL MD5 inserts a 0 somewhere, producing a string 1 extra character long.
Help?