Documentation

Horde_Crypt_Blowfish_Base
in package

Abstract base driver class for blowfish encryption.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2012-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

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 abstract decrypt(string $text) : string
Parameters
$text : string

The string to encrypt.

Tags
throws
Horde_Crypt_Blowfish_Exception
Return values
string

The ciphertext.

encrypt()

Encrypts a string.

public abstract encrypt(string $text) : string
Parameters
$text : string

The string to encrypt.

Tags
throws
Horde_Crypt_Blowfish_Exception
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.

Search results