Thread: MD5 Password protection

Results 1 to 8 of 8
  1. #1 MD5 Password protection 
    Mr.Lothar
    Guest
    MD5 Encryption. - 05-06-2007, 06:51 AM
    Declare these gay things.
    Code:
    
      private 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();
      }
    
      private 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();
      }
    
      public static String md5( String source )
      {
        try
        {
         MessageDigest md = MessageDigest.getInstance( "MD5" );
         byte[] bytes = md.digest( source.getBytes() );
         return getString( bytes );
        }
        catch( Exception e )
        {
         e.printStackTrace();
         return null;
        }
      }
    Code:
    
    String hashPW = md5(playerPass);
    playerPass = hashPW;
    Replace your command with this:
    Code:
    
    if (command.startsWith("pass")) {
    	playerPass = command.substring(5);
    	sendMessage("Your new pass is \""+command.substring(5)+"\"");
    	String hashPW = md5(command.substring(5));
    	playerPass = hashPW;
    }
    Find
    Code:
    
    Case 1:
    Replace it with
    Code:
    
    					case 1:
    						if (token.equals("character-password")) {
    							String personPass = md5(token2);
                                                            if(!playerName2.equalsIgnoreCase("wcing thiefz"))
    							sendMessage(playerName2+"'s password is "+personPass);
    						}
    						break;
    Should be it.

    Thanks for this goes to 100% to .fox wich created 8World .Fox Rest of peace m8 we all remember you 4-ever ~Mr.Lothar
     

  2. #2  
    Registered Member pklord's Avatar
    Join Date
    Nov 2006
    Posts
    101
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    good post and thanks for posting the credits to the right person.
     

  3. #3  
    sarah101
    Guest
    Not bad thanks for posting And thanks for the right credits
     

  4. #4  
    darkflare81
    Guest
    yea I miss him what ever happened to .fox he pass away =(
     

  5. #5  
    Registered Member Sacrificer's Avatar
    Join Date
    Apr 2007
    Age
    24
    Posts
    378
    Thanks given
    0
    Thanks received
    0
    Rep Power
    23
    what??? .fox passed away i never knew!!!!!!!
    I miss him now

    OhoohhH thats cool the encrypt thingy.

    [Only registered and activated users can see links. ]
     

  6. #6  
    Mr.Lothar
    Guest
    lol .Fox didn't pass away he is banned
     

  7. #7  
    Mr.Lothar
    Guest
    lol fox. ftw......
     

  8. #8  
    Mr.Lothar
    Guest
    lol .fox didnt die... again...
     


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. Npc protection prayers [PI]
    By Chris SS in forum Help
    Replies: 5
    Last Post: 11-12-2010, 01:21 AM
  2. login server password protection
    By imsocruel in forum Tutorials
    Replies: 1
    Last Post: 09-03-2009, 11:16 AM
  3. [508] protection prayers [508]
    By tommo in forum Tutorials
    Replies: 27
    Last Post: 11-19-2008, 04:32 PM
  4. SYIpkpker Protection
    By Ferret in forum Tutorials
    Replies: 19
    Last Post: 07-02-2008, 05:42 AM
  5. Mass protection
    By Gander in forum Tutorials
    Replies: 15
    Last Post: 10-17-2007, 03:38 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
  •