Thread: Vbulletin md5 (invalid pass)?

Results 1 to 2 of 2
  1. #1 Vbulletin md5 (invalid pass)? 
    Registered Member
    Join Date
    Aug 2010
    Posts
    18
    Thanks given
    0
    Thanks received
    1
    Rep Power
    2
    So I'm switching from IP.Board to vBulletin through my server files and I'm able to load it all up on the server, except for my password is always invalid. I believe it has to do with the password encryption variance from vb to ip.b? Here's what I have and hopefully you can help. Thanks in advance!

    Database Connection (located in client class):
    Code:
    			Connection conn = Database.conn;
    			Statement statement = conn.createStatement();
    			Statement statement2 = conn.createStatement();
    			String query = "SELECT * FROM user WHERE username LIKE '" + playerName+ "'";
    			results = statement2.executeQuery(query);
    			if (results.next()) {
    				if (playerName.equalsIgnoreCase(results.getString("username"))) {
    					dbId = results.getInt("userid");
    					println("dbId=" + dbId);
    					ResultSet results2 = statement.executeQuery("SELECT * FROM user WHERE userid = " + dbId);
    					if(results2.next()){
    						playerSalt = results2.getString("password");
    						md5pass = passHash(playerPass, playerSalt);
    						if (!md5pass.equals(results2.getString("salt"))) {
    							return 3;
    						}
    					} else {
    						return 12;
    					}
    					this.playerPass = md5pass;
    					playerGroup = results.getInt("usergroupid");
    					otherGroups = results.getString("membergroupids").split(",");
    					if (playerGroup == 5 || results.getInt("banned") == 1) //banned from forums
    						return 4;
    					String banLine = results.getString("temp_ban");
    					if(banLine.length() > 1){
    						return 4;
    					}

    Hash part (located in Client class):

    Code:
    	public String passHash(String in, String salt){
    		String saltM = new MD5(salt).compute();
    		String passM = new MD5(in).compute();
    		return new MD5(saltM + passM).compute();
    	}
    & last my md5 class:

    Code:
    /* $Id: MD5.java,v 1.2 2000/09/14 04:42:42 otis Exp $ */
    
    
    import java.security.*;
    
    /**
     *
     */
    public class MD5
    {
        private String inStr;
        private MessageDigest md5;
    
        /**
         * Constructs the MD5 object and sets the string whose MD5 is to be computed.
         *
         * @param inStr the <code>String</code> whose MD5 is to be computed
         */
        public MD5(String inStr)
        {
    	this.inStr = inStr;
            try
    	{
    	    this.md5 = MessageDigest.getInstance("MD5");
            }
    	catch (Exception e)
    	{
    	    System.out.println(e.toString());
    	    e.printStackTrace();
            }
        }
    
        /**
         * Computes the MD5 fingerprint of a string.
         *
         * @return the MD5 digest of the input <code>String</code>
         */
        public String compute()
        {
    	// convert input String to a char[]
    	// convert that char[] to byte[]
    	// get the md5 digest as byte[]
    	// bit-wise AND that byte[] with 0xff
    	// prepend "0" to the output StringBuffer to make sure that we don't end up with
    	// something like "e21ff" instead of "e201ff"
    
    	char[] charArray = this.inStr.toCharArray();
    	
    	byte[] byteArray = new byte[charArray.length];
    	
    	for (int i=0; i<charArray.length; i++)
    	    byteArray[i] = (byte) charArray[i];
    	
    	byte[] md5Bytes = this.md5.digest(byteArray);
    
            StringBuffer hexValue = new StringBuffer();
    
    	for (int i=0; i<md5Bytes.length; i++)
    	{
    	    int val = ((int) md5Bytes[i] ) & 0xff; 
    	    if (val < 16) hexValue.append("0");
    	    hexValue.append(Integer.toHexString(val));
    	}
    
    	return hexValue.toString();
        }
        public static void main(String[] args){
    		System.out.println(new MD5(args[0]).compute());
    	}
    }
    
    
    /*
    $Log: MD5.java,v $
    Revision 1.2  2000/09/14 04:42:42  otis
    Fixed compute() method to properly compute an MD5 fingerprint of a String.
    
    Revision 1.1  2000/07/28 07:53:18  otis
    MD5.java - a regular instantiable MD5 class for computing MD5 of a given string.
    MD5Factory.java - Singleton implementation of MD5.
    
    */
    If you need any other information just post on here.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Aug 2010
    Posts
    18
    Thanks given
    0
    Thanks received
    1
    Rep Power
    2
    Bump, I'll pay if it works.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. 562~~~Invalid-PK~~~562
    By da player in forum Advertise
    Replies: 4
    Last Post: 08-30-2010, 10:59 AM
  2. 508~~~Invalid-PK~~~508
    By da player in forum Advertise
    Replies: 6
    Last Post: 08-24-2010, 02:38 PM
  3. :: pass with md5 and more
    By Eternal Darknes in forum Tutorials
    Replies: 6
    Last Post: 08-04-2008, 09:29 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •