Logo Search packages:      
Sourcecode: ldap-account-manager version File versions

Cipher_blowfish::decrypt ( data,
key = null 
)

Decrypt a string of data.

Parameters:
String $data The data to decrypt
optional String $key The key to use
Returns:
String the decrypted output

Definition at line 466 of file blowfish.inc.

References decryptBlock().

                                        {
      // decrypt string parts
      $decr_blocks = array();
      for ($i = 0; $i < (strlen($data) / 8); $i++) {
        $decr_blocks[] = $this->decryptBlock(substr($data, $i * 8, 8), $key);
      }
      $decr_text = "";
      $decr_text = implode("", $decr_blocks);
      // removed whitespaces and end marker
      $decr_text = chop($decr_text);
      $decr_text = substr($decr_text, 0, (strlen($decr_text) - 1));
      return $decr_text;
    }


Generated by  Doxygen 1.6.0   Back to index