PHP Class Horde_Crypt_Blowfish, horde

Author: Matthew Fonda ([email protected])
Author: Michael Slusarz ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_crypt Horde_Crypt_Blowfish_Base Blowfish crypt driver.

Méthodes publiques

Méthode 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 méthode

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 méthode

public __get ( $name )

decrypt() public méthode

Decrypts a string.
public decrypt ( string $text ) : string
$text string The string to decrypt.
Résultat string The plaintext.

encrypt() public méthode

Encrypts a string.
public encrypt ( string $text ) : string
$text string The string to encrypt.
Résultat string The ciphertext.

setKey() public méthode

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_oe property

Blowfish crypt driver.
protected Horde_Crypt_Blowfish_Base $_crypt
Résultat Horde_Crypt_Blowfish_Base