\Horde_Crypt_Blowfish_Mcrypt

Mcrypt driver for blowfish encryption.

Summary

Methods
Properties
Constants
supported()
__construct()
encrypt()
decrypt()
setIv()
$cipher
$iv
$key
No constants found
_pad()
_unpad()
No protected properties found
N/A
No private methods found
$_mcrypt
N/A

Properties

$cipher

$cipher : string

Cipher method.

Type

string

$iv

$iv : string

Initialization vector.

Type

string

$key

$key : string

Encryption key.

Type

string

$_mcrypt

$_mcrypt : resource

Mcrypt resource.

Type

resource

Methods

supported()

supported() : boolean

Is this driver supported on this system?

Returns

boolean —

True if supported.

__construct()

__construct(string  $cipher) 

Constructor.

Parameters

string $cipher

Either 'ecb' or 'cbc'.

encrypt()

encrypt(string  $text) : string

Encrypts a string.

Parameters

string $text

The string to encrypt.

Returns

string —

The ciphertext.

decrypt()

decrypt(string  $text) : string

Decrypts a string.

Parameters

string $text

The string to encrypt.

Returns

string —

The ciphertext.

setIv()

setIv(string  $iv = null) 

Sets the initialization vector (required for CBC mode).

Parameters

string $iv

Initialization vector.

_pad()

_pad(string  $text, boolean  $ignore = false) : string

Pad text to match blocksize length.

Parameters

string $text

Unpadded text.

boolean $ignore

Don't pad if already at blocksize length.

Returns

string —

Padded text.

_unpad()

_unpad(string  $text) : string

Unpad text from blocksize boundary.

Parameters

string $text

Padded text.

Returns

string —

Unpadded text.