Horde_Crypt_Blowfish_Openssl
extends Horde_Crypt_Blowfish_Base
in package
Openssl driver for blowfish encryption.
Tags
Table of Contents
- $cipher : string
- Cipher method.
- $iv : string
- Initialization vector.
- $key : string
- Encryption key.
- __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
Methods
__construct()
Constructor.
public
__construct(string $cipher) : mixed
Parameters
- $cipher : string
-
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([string $iv = null ]) : mixed
Parameters
- $iv : string = 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.