Class Mcrypt

Summary

Fully Qualified Name: Zend\Crypt\Symmetric\Mcrypt
Implements: SymmetricInterface

Description

Symmetric encryption using the Mcrypt extension

NOTE: DO NOT USE only this class to encrypt data. This class doesn't provide authentication and integrity check over the data. PLEASE USE Zend\Crypt\BlockCipher instead!

Methods

Name Description Defined By
__construct() Constructor Mcrypt
decrypt() Decrypt Mcrypt
encrypt() Encrypt Mcrypt
getAlgorithm() Get the encryption algorithm Mcrypt
getBlockSize() Get the block size Mcrypt
getKey() Get the encryption key Mcrypt
getKeySize() Get the maximum key size for the selected cipher and mode of operation Mcrypt
getMode() Get the cipher mode Mcrypt
getOriginalSalt() Get the original salt value Mcrypt
getPadding() Get the padding object Mcrypt
getPaddingPluginManager() Returns the padding plugin manager. If it doesn't exist it's created. Mcrypt
getSalt() Get the salt (IV) according to the size requested by the algorithm Mcrypt
getSaltSize() Get the salt (IV) size Mcrypt
getSupportedAlgorithms() Get the supported algorithms Mcrypt
getSupportedModes() Get all supported encryption modes Mcrypt
setAlgorithm() Set the encryption algorithm (cipher) Mcrypt
setKey() Set the encryption key If the key is longer than maximum supported, it will be truncated by getKey(). Mcrypt
setMode() Set the cipher mode Mcrypt
setOptions() Set default options Mcrypt
setPadding() Set the padding object Mcrypt
setPaddingPluginManager() Set the padding plugin manager Mcrypt
setSalt() Set the salt (IV) Mcrypt

Method Details

__construct()

Constructor

Parameter Name Type Description
$options array|\Traversable

Returns:

decrypt()

Decrypt

Parameter Name Type Description
$data string

Returns: string

encrypt()

Encrypt

Parameter Name Type Description
$data string

Returns: string

getAlgorithm()

Get the encryption algorithm

Returns: string

getBlockSize()

Get the block size

Returns: int

getKey()

Get the encryption key

Returns: string

getKeySize()

Get the maximum key size for the selected cipher and mode of operation

Returns: int

getMode()

Get the cipher mode

Returns: string

getOriginalSalt()

Get the original salt value

Returns: string

getPadding()

Get the padding object

Returns: \Padding\PaddingInterface

getPaddingPluginManager()

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

Returns: \ContainerInterface

getSalt()

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

Returns: string

getSaltSize()

Get the salt (IV) size

Returns: int

getSupportedAlgorithms()

Get the supported algorithms

Returns: array

getSupportedModes()

Get all supported encryption modes

Returns: array

setAlgorithm()

Set the encryption algorithm (cipher)

Parameter Name Type Description
$algo string

Returns: \Mcrypt Provides a fluent interface

setKey()

Set the encryption key If the key is longer than maximum supported, it will be truncated by getKey().

Parameter Name Type Description
$key string

Returns: \Mcrypt Provides a fluent interface

setMode()

Set the cipher mode

Parameter Name Type Description
$mode string

Returns: \Mcrypt Provides a fluent interface

setOptions()

Set default options

Parameter Name Type Description
$options array

Returns: void

setPadding()

Set the padding object

Parameter Name Type Description
$padding \Padding\PaddingInterface

Returns: \Mcrypt Provides a fluent interface

setPaddingPluginManager()

Set the padding plugin manager

Parameter Name Type Description
$plugins string|\ContainerInterface

Returns: void

setSalt()

Set the salt (IV)

Parameter Name Type Description
$salt string

Returns: \Mcrypt Provides a fluent interface

Top