PHP Class Horde_Crypt_Blowfish_Base, horde

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

Public Properties

Property Type Description
$cipher string Cipher method.
$iv string Initialization vector.
$key string Encryption key.

Public Methods

Method Description
__construct ( string $cipher ) Constructor.
decrypt ( string $text ) : string Decrypts a string.
encrypt ( string $text ) : string Encrypts a string.
setIv ( string $iv = null ) Sets the initialization vector (required for CBC mode).
supported ( ) : boolean Is this driver supported on this system?

Protected Methods

Method Description
_pad ( string $text, boolean $ignore = false ) : string Pad text to match blocksize length.
_unpad ( string $text ) : string Unpad text from blocksize boundary.

Method Details

__construct() public method

Constructor.
public __construct ( string $cipher )
$cipher string Either 'ecb' or 'cbc'.

_pad() protected method

Pad text to match blocksize length.
protected _pad ( string $text, boolean $ignore = false ) : string
$text string Unpadded text.
$ignore boolean Don't pad if already at blocksize length.
return string Padded text.

_unpad() protected method

Unpad text from blocksize boundary.
protected _unpad ( string $text ) : string
$text string Padded text.
return string Unpadded text.

decrypt() abstract public method

Decrypts a string.
abstract public decrypt ( string $text ) : string
$text string The string to encrypt.
return string The ciphertext.

encrypt() abstract public method

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

setIv() public method

Sets the initialization vector (required for CBC mode).
public setIv ( string $iv = null )
$iv string Initialization vector.

supported() public static method

Is this driver supported on this system?
public static supported ( ) : boolean
return boolean True if supported.

Property Details

$cipher public_oe property

Cipher method.
public string $cipher
return string

$iv public_oe property

Initialization vector.
public string $iv
return string

$key public_oe property

Encryption key.
public string $key
return string