public function encrypt($string)
  {
    $string = trim($string);
    $encryp = "";
    $length = strlen($string);
    $string .= str_repeat(chr(0), (8-($length%8))%8);

    for($i = 0; $i < $length; $i += 8)
    {
      list(,$xl,$xr) = unpack("N2", substr($string, $i, 8));
      $this->encipher($xl, $xr);
      $encryp .= pack("N2", $xl, $xr);
    }

    return base64_encode($encryp);
  }
public function encrypt($string)
  {
    $string = trim($string);
    $encryp = "";
    $length = strlen($string);
    $string .= str_repeat(chr(0), (8-($length%8))%8);

    for($i = 0; $i < $length; $i += 8)
    {
      list(,$xl,$xr) = unpack("N2", substr($string, $i, 8));
      $this->encipher($xl, $xr);
      $encryp .= pack("N2", $xl, $xr);
    }

    return base64_encode($encryp);
  }
public function encrypt ( $ string ) { $ string = trim ( $ string ) ; $ encryp = "" ; $ length = strlen ( $ string ) ; $ string .= str_repeat ( chr ( 0 ) , ( 8 - ( $ length % 8 ) ) % 8 ) ; for ( $ i = 0 ; $ i < $ length ; $ i += 8 ) { list ( , $ xl , $ xr ) = unpack ( "N2" , substr ( $ string , $ i , 8 ) ) ; $ this -> encipher ( $ xl , $ xr ) ; $ encryp .= pack ( "N2" , $ xl , $ xr ) ; } return base64_encode ( $ encryp ) ; }
Encrypts a given string.

@param string $string
@return string
Encrypts a given string .