Encrypt using a symmetric cipher then authenticate using HMAC (SHA-256)

 Methods

Constructor

__construct(\Zend\Crypt\Symmetric\SymmetricInterface $cipher) 

Decrypt

decrypt(string $data) : string | bool

Parameters

$data

string

Exceptions

\Zend\Crypt\Exception\InvalidArgumentException

Returns

stringbool

Encrypt then authenticate using HMAC

encrypt(string $data) : string

Parameters

$data

string

Exceptions

\Zend\Crypt\Exception\InvalidArgumentException

Returns

string

Factory.

factory(string $adapter, array $options) : \Zend\Crypt\BlockCipher

Parameters

$adapter

string

$options

array

Returns

Get the value of binary output

getBinaryOutput() : bool

Returns

bool

Get the cipher algorithm

getCipherAlgorithm() : string | bool

Returns

stringbool

Get the supported algorithms of the symmetric cipher

getCipherSupportedAlgorithms() : array

Returns

array

Get the hash algorithm for HMAC authentication

getHashAlgorithm() : string

Returns

string

Get the key

getKey() : string

Returns

string

Get the number of iterations for Pbkdf2

getKeyIteration() : integer

Returns

integer

Get the original salt value

getOriginalSalt() : string

Returns

string

Get the salt (IV) according to the size requested by the algorithm

getSalt() : string

Returns

string

Returns the symmetric cipher plugin manager.

getSymmetricPluginManager() : \Zend\Crypt\SymmetricPluginManager

If it doesn't exist it's created.

Returns

Enable/disable the binary output

setBinaryOutput(bool $value) : \Zend\Crypt\BlockCipher

Parameters

$value

bool

Returns

Set the symmetric cipher

setCipher(\Zend\Crypt\Symmetric\SymmetricInterface $cipher) : \Zend\Crypt\BlockCipher

Set algorithm of the symmetric cipher

setCipherAlgorithm(string $algo) : \Zend\Crypt\BlockCipher

Parameters

$algo

string

Exceptions

\Zend\Crypt\Exception\InvalidArgumentException

Returns

Set the hash algorithm for HMAC authentication

setHashAlgorithm(string $hash) : \Zend\Crypt\BlockCipher

Parameters

$hash

string

Exceptions

\Zend\Crypt\Exception\InvalidArgumentException

Returns

Set the encryption/decryption key

setKey(string $key) : \Zend\Crypt\BlockCipher

Set the number of iterations for Pbkdf2

setKeyIteration(integer $num) : \Zend\Crypt\BlockCipher

Parameters

$num

integer

Returns

Set the salt (IV)

setSalt(string $salt) : \Zend\Crypt\BlockCipher

Parameters

$salt

string

Exceptions

\Zend\Crypt\Exception\InvalidArgumentException

Returns

Set the symmetric cipher plugin manager

setSymmetricPluginManager(string | \Zend\Crypt\SymmetricPluginManager $plugins) 

 Properties

 

The output is binary?

$binaryOutput : bool

 

Symmetric cipher

$cipher : \Zend\Crypt\Symmetric\SymmetricInterface

 

Hash algorithm fot HMAC

$hash : string

 

Key

$key : string

 

Number of iterations for Pbkdf2

$keyIteration : string

 

Check if the salt has been set

$saltSetted : boolean

 

Symmetric cipher plugin manager

$symmetricPlugins : \Zend\Crypt\SymmetricPluginManager

 Constants

 

KEY_DERIV_HMAC

KEY_DERIV_HMAC