PHP Class Horde_Crypt_Blowfish, horde

Author: Matthew Fonda ([email protected])
Author: Michael Slusarz ([email protected])
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_crypt Horde_Crypt_Blowfish_Base Blowfish crypt driver.

Public Methods

Method Description
__construct ( string $key, array $opts = [] ) Constructor.
__get ( $name )
decrypt ( string $text ) : string Decrypts a string.
encrypt ( string $text ) : string Encrypts a string.
setKey ( string $key, string $iv = null ) Sets the secret key.

Method Details

__construct() public method

Constructor.
public __construct ( string $key, array $opts = [] )
$key string Encryption key.
$opts array Additional options: - cipher: (string) Either 'ecb' or 'cbc'. - ignore: (integer) A mask of drivers to ignore (IGNORE_* constants). - iv: (string) IV to use.

__get() public method

public __get ( $name )

decrypt() public method

Decrypts a string.
public decrypt ( string $text ) : string
$text string The string to decrypt.
return string The plaintext.

encrypt() public method

Encrypts a string.
public encrypt ( string $text ) : string
$text string The string to encrypt.
return string The ciphertext.

setKey() public method

The key must be non-zero, and less than or equal to MAXKEYSIZE characters (bytes) in length.
public setKey ( string $key, string $iv = null )
$key string Key must be non-empty and less than MAXKEYSIZE bytes in length.
$iv string The initialization vector to use. Only needed for 'cbc' cipher. If null, an IV is automatically generated.

Property Details

$_crypt protected property

Blowfish crypt driver.
protected Horde_Crypt_Blowfish_Base $_crypt
return Horde_Crypt_Blowfish_Base