Zend Framework
3.0
|
Symmetric encryption using the Mcrypt extension. More...
Public Member Functions | |
__construct ($options=[]) | |
Constructor. | |
setOptions ($options) | |
Set default options. | |
getKeySize () | |
Get the maximum key size for the selected cipher and mode of operation. | |
setKey ($key) | |
Set the encryption key If the key is longer than maximum supported, it will be truncated by getKey(). | |
getKey () | |
Get the encryption key. | |
setAlgorithm ($algo) | |
Set the encryption algorithm (cipher) | |
getAlgorithm () | |
Get the encryption algorithm. | |
setPadding (Padding\PaddingInterface $padding) | |
Set the padding object. | |
getPadding () | |
Get the padding object. | |
encrypt ($data) | |
Encrypt. | |
decrypt ($data) | |
Decrypt. | |
getSaltSize () | |
Get the salt (IV) size. | |
getSupportedAlgorithms () | |
Get the supported algorithms. | |
setSalt ($salt) | |
Set the salt (IV) | |
getSalt () | |
Get the salt (IV) according to the size requested by the algorithm. | |
getOriginalSalt () | |
Get the original salt value. | |
setMode ($mode) | |
Set the cipher mode. | |
getMode () | |
Get the cipher mode. | |
getSupportedModes () | |
Get all supported encryption modes. | |
getBlockSize () | |
Get the block size. | |
Static Public Member Functions | |
static | getPaddingPluginManager () |
Returns the padding plugin manager. | |
static | setPaddingPluginManager ($plugins) |
Set the padding plugin manager. | |
Public Attributes | |
const | DEFAULT_PADDING = 'pkcs7' |
Protected Member Functions | |
setDefaultOptions ($options=[]) | |
Set default options. | |
Protected Attributes | |
$key | |
$iv | |
$algo = 'aes' | |
$mode = 'cbc' | |
$padding | |
$supportedAlgos | |
$supportedModes | |
Static Protected Attributes | |
static | $paddingPlugins = null |
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 instead!
__construct | ( | $options = [] | ) |
Constructor.
array | Traversable | $options |
Exception\RuntimeException | |
Exception\InvalidArgumentException |
decrypt | ( | $data | ) |
Decrypt.
string | $data |
Exception\InvalidArgumentException |
Implements SymmetricInterface.
encrypt | ( | $data | ) |
Encrypt.
string | $data |
Exception\InvalidArgumentException |
Implements SymmetricInterface.
getAlgorithm | ( | ) |
getBlockSize | ( | ) |
getKey | ( | ) |
getKeySize | ( | ) |
Get the maximum key size for the selected cipher and mode of operation.
Implements SymmetricInterface.
getMode | ( | ) |
getOriginalSalt | ( | ) |
Get the original salt value.
getPadding | ( | ) |
Get the padding object.
|
static |
Returns the padding plugin manager.
If it doesn't exist it's created.
getSalt | ( | ) |
Get the salt (IV) according to the size requested by the algorithm.
Implements SymmetricInterface.
getSaltSize | ( | ) |
getSupportedAlgorithms | ( | ) |
getSupportedModes | ( | ) |
setAlgorithm | ( | $algo | ) |
Set the encryption algorithm (cipher)
string | $algo |
Exception\InvalidArgumentException |
Implements SymmetricInterface.
|
protected |
Set default options.
array | $options |
setKey | ( | $key | ) |
Set the encryption key If the key is longer than maximum supported, it will be truncated by getKey().
string | $key |
Exception\InvalidArgumentException |
Implements SymmetricInterface.
setMode | ( | $mode | ) |
Set the cipher mode.
string | $mode |
Exception\InvalidArgumentException |
Implements SymmetricInterface.
setOptions | ( | $options | ) |
setPadding | ( | Padding\PaddingInterface | $padding | ) |
|
static |
Set the padding plugin manager.
string | ContainerInterface | $plugins |
Exception\InvalidArgumentException |
setSalt | ( | $salt | ) |
Set the salt (IV)
string | $salt |
Exception\InvalidArgumentException |
Implements SymmetricInterface.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
const DEFAULT_PADDING = 'pkcs7' |