Thread: How To Add MD5 Password Encryption To Server ++Rep!!!!

Results 1 to 4 of 4
  1. #1 How To Add MD5 Password Encryption To Server ++Rep!!!! 
    Banned

    Join Date
    Jul 2009
    Posts
    4,003
    Thanks given
    1,003
    Thanks received
    1,029
    Rep Power
    0
    Hello guys it is 4 AM and im looking how to add MD5 Encryption Asap! Rep++ Fpr Help ,please help me
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Jan 2008
    Posts
    2,345
    Thanks given
    20
    Thanks received
    575
    Rep Power
    1202
    Methods needed:

    Code:
      static String getString(byte[] bytes) {
        StringBuffer sb = new StringBuffer();
        for( int i=0; i<bytes.length; i++ ) {
          byte b = bytes[ i ];
          sb.append((int)(0x00FF&b));
          if(i+1 <bytes.length) {
            sb.append("-");
          }
        }
        return sb.toString();
      }
    
      static byte[] getBytes(String str) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        StringTokenizer st = new StringTokenizer(str, "-", false);
        while(st.hasMoreTokens()) {
          int i = Integer.parseInt(st.nextToken());
          bos.write((byte)i);
        }
        return bos.toByteArray();
      }
    
      static String md5(String source) {
        try {
          MessageDigest md = MessageDigest.getInstance("MD5");
          byte[] bytes = md.digest(source.getBytes());
          return getString(bytes);
        } catch(Exception e) {
            return null;
        }
      }
    Then in login:

    Code:
    playerPass = md5(playerPass);
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jul 2009
    Posts
    4,003
    Thanks given
    1,003
    Thanks received
    1,029
    Rep Power
    0
    Where exactly to add it? Make me a little tut il send u 5$ by paypal later?
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    Logically you should put it wherever your logging in method is (usually just named run())

    [Only registered and activated users can see links. ]

    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •