title: the method of encryption password in mybb database
body: <p>guys can someone tel me the mybb use what method to encrypt password in database?
  because i have problem with this code every time i use user and password (correct user and pass) i have error : "incorrect user and password"</p>
  
  <p>i put for you 3part of my code that i need help on this(i think i have a problem on class Login ):</p>
  
  <p>thank you for help.</p>
  
  <pre><code>class DB
  {
      var $connection;
      var $started;
  
      function start()
      {
          global $MySQL_Host, $MySQL_User, $MySQL_Pass, $MySQL_DB;
  
          $this-&gt;connection = mysql_connect( $MySQL_Host, $MySQL_User,     $MySQL_Pass );
          mysql_select_db( $MySQL_DB, $this-&gt;connection );
      }
  
      function query( $query )
      {
          $result = mysql_query( $query, $this-&gt;connection );
  
          if( $result )
          {
              return mysql_fetch_full_result_array( $result );
          }
          else
          {
              return $result;
          }
      }
  
      function end()
      {
          mysql_close( $this-&gt;connection );
      }
  
      function isStarted()
      {
          return $started;
      }
  }
  
  function mysql_fetch_full_result_array( $result )
  {
      $table_result = array();
      $r = 0;
  
      if( $result === true )
      {
          return $result;
      }
  
      if( mysql_num_rows( $result ) == 0 )
      {
          return $result;
      }
  
      while( $row = mysql_fetch_assoc( $result ) )
      {
          $arr_row = array();
          $c = 0;
  
          while ( $c &lt; mysql_num_fields( $result ) )
          {       
              $col = mysql_fetch_field( $result, $c );   
              $arr_row[ $col -&gt; name ] = $row[ $col -&gt; name ];           
              $c++;
          }   
  
          $table_result[ $r ] = $arr_row;
          $r++;
      }   
  
      return $table_result;
  }
  
  
  class Login
  {
  
      function CheckLogin( $username, $password )
      {
          $db = new DB();
          $db-&gt;start();
  
          $query = "SELECT uid, password, email FROM mybb_users WHERE username='".$username."' AND password='".md5(md5($salt).md5($password))."';";
  
          $result = $db-&gt;query( $query );
  
          $db-&gt;end();
  
          if( $result == false )
              return false;
   //             fwrite($fh, $result);
   //             fclose($fh);
  
  
          if( md5(md5($salt).md5($password)) == $result[ 0 ][ 'password' ] )
          {
              return array( 'uid' =&gt; $result[ 0 ][ 'uid' ],
                            'mail' =&gt; $result[ 0 ][ 'email' ],
                            'user' =&gt; $username
                          );
          }
      }
  }
  </code></pre>