Encryption adapter for Zend\Crypt\BlockCipher

package Default

 Methods

Class constructor

__construct(string|array|\Traversable $options) 

Parameters

$options

stringarray\Traversable

Encryption Options

Exceptions

\Zend\Filter\Exception\RuntimeException
\Zend\Filter\Exception\InvalidArgumentException

Defined by Zend\Filter\FilterInterface

decrypt(string $value) : string

Decrypts $value with the defined settings

inherited_from \Zend\Filter\Encrypt\EncryptionAlgorithmInterface::decrypt()

Parameters

$value

string

Content to decrypt

Returns

stringThe decrypted content

Defined by Zend\Filter\FilterInterface

encrypt(string $value) : string

Encrypts $value with the defined settings

inherited_from \Zend\Filter\Encrypt\EncryptionAlgorithmInterface::encrypt()

Parameters

$value

string

The content to encrypt

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

stringThe encrypted content

Returns the compression

getCompression() : array

Returns

array

Returns the set encryption options

getEncryption() : array

Returns

array

Get the encryption key

getKey() : string

Returns

string

Returns the initialization vector

getVector() : string

Returns

string

Sets an internal compression for values to encrypt

setCompression(string|array $compression) : \Zend\Filter\Encrypt\BlockCipher
fluent This method is part of a fluent interface and will return the same instance

Parameters

$compression

stringarray

Returns

\Zend\Filter\Encrypt\BlockCipher

Sets new encryption options

setEncryption(string|array $options) : \Zend\Filter\Encrypt\BlockCipher
fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

stringarray

Encryption options

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Encrypt\BlockCipher

Set the encryption key

setKey(string $key) : \Zend\Filter\Encrypt\BlockCipher
fluent This method is part of a fluent interface and will return the same instance

Parameters

$key

string

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Encrypt\BlockCipher

Set the inizialization vector

setVector(string $vector) : \Zend\Filter\Encrypt\BlockCipher
fluent This method is part of a fluent interface and will return the same instance

Parameters

$vector

string

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Encrypt\BlockCipher

Returns the adapter name

toString() : string
inherited_from \Zend\Filter\Encrypt\EncryptionAlgorithmInterface::toString()

Returns

string

 Properties

 

BlockCipher

$blockCipher : \Zend\Filter\Encrypt\BlockCipher

Default

 

Internal compression

$compression : array

Default

 

Definitions for encryption array( 'key' => encryption key string 'key_iteration' => the number of iterations for the PBKDF2 key generation 'algorithm => cipher algorithm to use 'hash' => algorithm to use for the authentication 'vector' => initialization vector )

$encryption 

Default

array('key_iteration' => 5000, 'algorithm' => 'aes', 'hash' => 'sha256')