Class BlockCipher

Summary

Fully Qualified Name: Zend\Crypt\BlockCipher

Description

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

Methods

Name Description Defined By
__construct() Constructor BlockCipher
decrypt() Decrypt BlockCipher
encrypt() Encrypt then authenticate using HMAC BlockCipher
factory() Factory BlockCipher
getBinaryOutput() Get the value of binary output BlockCipher
getCipher() Get symmetric cipher BlockCipher
getCipherAlgorithm() Get the cipher algorithm BlockCipher
getCipherSupportedAlgorithms() Get the supported algorithms of the symmetric cipher BlockCipher
getHashAlgorithm() Get the hash algorithm for HMAC authentication BlockCipher
getKey() Get the key BlockCipher
getKeyIteration() Get the number of iterations for Pbkdf2 BlockCipher
getOriginalSalt() Get the original salt value BlockCipher
getPbkdf2HashAlgorithm() Get the Pbkdf2 hash algorithm BlockCipher
getSalt() Get the salt (IV) according to the size requested by the algorithm BlockCipher
getSymmetricPluginManager() Returns the symmetric cipher plugin manager. If it doesn't exist it's created. BlockCipher
setBinaryOutput() Enable/disable the binary output BlockCipher
setCipher() Set the symmetric cipher BlockCipher
setCipherAlgorithm() Set algorithm of the symmetric cipher BlockCipher
setHashAlgorithm() Set the hash algorithm for HMAC authentication BlockCipher
setKey() Set the encryption/decryption key BlockCipher
setKeyIteration() Set the number of iterations for Pbkdf2 BlockCipher
setPbkdf2HashAlgorithm() Set the hash algorithm for the Pbkdf2 BlockCipher
setSalt() Set the salt (IV) BlockCipher
setSymmetricPluginManager() Set the symmetric cipher plugin manager BlockCipher

Method Details

__construct()

Constructor

Parameter Name Type Description
$cipher \SymmetricInterface

Returns:

decrypt()

Decrypt

Parameter Name Type Description
$data string

Returns: string|bool

encrypt()

Encrypt then authenticate using HMAC

Parameter Name Type Description
$data string

Returns: string

factory()

Factory

Parameter Name Type Description
$adapter string
$options array

Returns: \BlockCipher

getBinaryOutput()

Get the value of binary output

Returns: bool

getCipher()

Get symmetric cipher

Returns: \SymmetricInterface

getCipherAlgorithm()

Get the cipher algorithm

Returns: string|bool

getCipherSupportedAlgorithms()

Get the supported algorithms of the symmetric cipher

Returns: array

getHashAlgorithm()

Get the hash algorithm for HMAC authentication

Returns: string

getKey()

Get the key

Returns: string

getKeyIteration()

Get the number of iterations for Pbkdf2

Returns: int

getOriginalSalt()

Get the original salt value

Returns: string

getPbkdf2HashAlgorithm()

Get the Pbkdf2 hash algorithm

Returns: string

getSalt()

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

Returns: string

getSymmetricPluginManager()

Returns the symmetric cipher plugin manager. If it doesn't exist it's created.

Returns: \ContainerInterface

setBinaryOutput()

Enable/disable the binary output

Parameter Name Type Description
$value bool

Returns: \BlockCipher Provides a fluent interface

setCipher()

Set the symmetric cipher

Parameter Name Type Description
$cipher \SymmetricInterface

Returns: \BlockCipher Provides a fluent interface

setCipherAlgorithm()

Set algorithm of the symmetric cipher

Parameter Name Type Description
$algo string

Returns: \BlockCipher Provides a fluent interface

setHashAlgorithm()

Set the hash algorithm for HMAC authentication

Parameter Name Type Description
$hash string

Returns: \BlockCipher Provides a fluent interface

setKey()

Set the encryption/decryption key

Parameter Name Type Description
$key string

Returns: \BlockCipher Provides a fluent interface

setKeyIteration()

Set the number of iterations for Pbkdf2

Parameter Name Type Description
$num int

Returns: \BlockCipher Provides a fluent interface

setPbkdf2HashAlgorithm()

Set the hash algorithm for the Pbkdf2

Parameter Name Type Description
$hash string

Returns: \BlockCipher Provides a fluent interface

setSalt()

Set the salt (IV)

Parameter Name Type Description
$salt string

Returns: \BlockCipher Provides a fluent interface

setSymmetricPluginManager()

Set the symmetric cipher plugin manager

Parameter Name Type Description
$plugins string|\SymmetricPluginManager

Returns:

Top