Fully Qualified Name: | Zend\Crypt\Symmetric\Openssl |
Implements: | SymmetricInterface |
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\Crypt\BlockCipher instead!
Name | Description | Defined By |
---|---|---|
__construct() | Constructor | Openssl |
decrypt() | Decrypt | Openssl |
encrypt() | Encrypt | Openssl |
getAad() | Get the Additional Authentication Data | Openssl |
getAlgorithm() | Get the encryption algorithm | Openssl |
getBlockSize() | Get the block size | Openssl |
getKey() | Get the encryption key | Openssl |
getKeySize() | Get the key size for the selected cipher | Openssl |
getMode() | Get the cipher mode | Openssl |
getOriginalSalt() | Get the original salt value | Openssl |
getPadding() | Get the padding object | Openssl |
getPaddingPluginManager() | Returns the padding plugin manager. | Openssl |
getSalt() | Get the salt (IV) according to the size requested by the algorithm | Openssl |
getSaltSize() | Get the salt (IV) size | Openssl |
getSupportedAlgorithms() | Get the supported algorithms | Openssl |
getSupportedModes() | Get all supported encryption modes for the selected algorithm | Openssl |
getTag() | Get the authentication tag | Openssl |
getTagSize() | Get the tag size for CCM and GCM mode | Openssl |
isAuthEncAvailable() | Return true if authenticated encryption is available | Openssl |
setAad() | Set Additional Authentication Data | Openssl |
setAlgorithm() | Set the encryption algorithm (cipher) | Openssl |
setKey() | Set the encryption key If the key is longer than maximum supported, it will be truncated by getKey(). | Openssl |
setMode() | Set the cipher mode | Openssl |
setOptions() | Set default options | Openssl |
setPadding() | Set the padding object | Openssl |
setPaddingPluginManager() | Set the padding plugin manager | Openssl |
setSalt() | Set the salt (IV) | Openssl |
setTagSize() | Set the tag size for CCM and GCM mode | Openssl |
Constructor
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable |
Returns:
Decrypt
Parameter Name | Type | Description |
---|---|---|
$data | string |
Returns: string
Encrypt
Parameter Name | Type | Description |
---|---|---|
$data | string |
Returns: string
Get the Additional Authentication Data
Returns: string
Get the encryption algorithm
Returns: string
Get the block size
Returns: int
Get the encryption key
Returns: string
Get the key size for the selected cipher
Returns: int
Get the cipher mode
Returns: string
Get the original salt value
Returns: string
Get the padding object
Returns: \Padding\PaddingInterface
Returns the padding plugin manager.
Creates one if none is present.
Returns: \ContainerInterface
Get the salt (IV) according to the size requested by the algorithm
Returns: string
Get the salt (IV) size
Returns: int
Get the supported algorithms
Returns: array
Get all supported encryption modes for the selected algorithm
Returns: array
Get the authentication tag
Returns: string
Get the tag size for CCM and GCM mode
Returns: int
Return true if authenticated encryption is available
Returns: bool
Set Additional Authentication Data
Parameter Name | Type | Description |
---|---|---|
$aad | string |
Returns: self
Set the encryption algorithm (cipher)
Parameter Name | Type | Description |
---|---|---|
$algo | string |
Returns: \Openssl Provides a fluent interface
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: \Openssl Provides a fluent interface
Set the cipher mode
Parameter Name | Type | Description |
---|---|---|
$mode | string |
Returns: \Openssl Provides a fluent interface
Set default options
Parameter Name | Type | Description |
---|---|---|
$options | array |
Returns: void
Set the padding object
Parameter Name | Type | Description |
---|---|---|
$padding | \Padding\PaddingInterface |
Returns: \Openssl Provides a fluent interface
Set the padding plugin manager
Parameter Name | Type | Description |
---|---|---|
$plugins | string|\ContainerInterface |
Returns: void
Set the salt (IV)
Parameter Name | Type | Description |
---|---|---|
$salt | string |
Returns: \Openssl Provides a fluent interface
Set the tag size for CCM and GCM mode
Parameter Name | Type | Description |
---|---|---|
$size | int |
Returns: self