MyBB Community Forums

Full Version: Java Verify MyBB Password
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have tried to search for a solution for some time now, but I've failed to find any, so I'll make my own thread. First of all, I found the verify_password (http://paste.ee/p/fa9cH) method that MyBB uses to find out how the hashing of passwords is done.

The result is as I've found in other threads; md5(md5(salt) + md5(password)); (Yes I know that isn't proper code, but it suits the demonstration.) However this verification doesn't work in Java, but it works in php. I have not written the MD5 hash generator for Java my self, and I'm no Java developer, so I wouldn't know how to fix it.

Java MD5 Hash Generator:
public static String MD5(String text) 
 throws NoSuchAlgorithmException, UnsupportedEncodingException  {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
md5hash = md.digest();
return convertToHex(md5hash);
}
I've also tried this; http://stackoverflow.com/questions/41836...he-php-way, but it still doesn't work.
If anyone here have a solution for me, it would be greatly appreciated!

This is solved. Was a stupid error with the coded I used, forced the password to go lowercase.

Moderator can feel free to close this thread.