Horde_Crypt_Blowfish_Mcrypt
extends Horde_Crypt_Blowfish_Base
in package
Mcrypt driver for blowfish encryption.
Tags
Table of Contents
- $cipher : string
- Cipher method.
- $iv : string
- Initialization vector.
- $key : string
- Encryption key.
- $_mcrypt : resource
- Mcrypt resource.
- __construct() : mixed
- Constructor.
- decrypt() : string
- Decrypts a string.
- encrypt() : string
- Encrypts a string.
- setIv() : mixed
- Sets the initialization vector (required for CBC mode).
- supported() : bool
- Is this driver supported on this system?
- _pad() : string
- Pad text to match blocksize length.
- _unpad() : string
- Unpad text from blocksize boundary.
Properties
$cipher
Cipher method.
public
string
$cipher
$iv
Initialization vector.
public
string
$iv
= \null
$key
Encryption key.
public
string
$key
$_mcrypt
Mcrypt resource.
private
resource
$_mcrypt
Methods
__construct()
Constructor.
public
__construct(mixed $cipher) : mixed
Parameters
- $cipher : mixed
-
Either 'ecb' or 'cbc'.
Return values
mixed —decrypt()
Decrypts a string.
public
decrypt(mixed $text) : string
Parameters
- $text : mixed
-
The string to encrypt.
Return values
string —The ciphertext.
encrypt()
Encrypts a string.
public
encrypt(mixed $text) : string
Parameters
- $text : mixed
-
The string to encrypt.
Return values
string —The ciphertext.
setIv()
Sets the initialization vector (required for CBC mode).
public
setIv([mixed $iv = null ]) : mixed
Parameters
- $iv : mixed = null
-
Initialization vector.
Return values
mixed —supported()
Is this driver supported on this system?
public
static supported() : bool
Return values
bool —True if supported.
_pad()
Pad text to match blocksize length.
protected
_pad(string $text[, bool $ignore = false ]) : string
Parameters
- $text : string
-
Unpadded text.
- $ignore : bool = false
-
Don't pad if already at blocksize length.
Return values
string —Padded text.
_unpad()
Unpad text from blocksize boundary.
protected
_unpad(string $text) : string
Parameters
- $text : string
-
Padded text.
Return values
string —Unpadded text.