Zend Framework
3.0
|
Symmetric encryption using the OpenSSL extension. More...
Public Member Functions | |
__construct ($options=[]) | |
Constructor. | |
setOptions ($options) | |
Set default options. | |
getKeySize () | |
Get the key size for the selected cipher. | |
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 for the selected algorithm. | |
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. | |
getOpensslAlgos () | |
Return the OpenSSL supported encryption algorithms. | |
Protected Attributes | |
$key | |
$iv | |
$algo = 'aes' | |
$mode = 'cbc' | |
$padding | |
$encryptionAlgos | |
$encryptionModes | |
$blockSizes | |
$keySizes | |
$opensslAlgos = [] | |
$supportedAlgos = [] | |
Static Protected Attributes | |
static | $paddingPlugins = null |
Symmetric encryption using the OpenSSL 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 | ( | ) |
getMode | ( | ) |
|
protected |
Return the OpenSSL supported encryption algorithms.
getOriginalSalt | ( | ) |
Get the original salt value.
getPadding | ( | ) |
Get the padding object.
|
static |
Returns the padding plugin manager.
Creates one if none is present.
getSalt | ( | ) |
Get the salt (IV) according to the size requested by the algorithm.
Implements SymmetricInterface.
getSaltSize | ( | ) |
getSupportedAlgorithms | ( | ) |
getSupportedModes | ( | ) |
Get all supported encryption modes for the selected algorithm.
Implements SymmetricInterface.
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 | ) |
Set the padding object.
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 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
const DEFAULT_PADDING = 'pkcs7' |