Class Openssl

Summary

Fully Qualified Name: Laminas\Crypt\Symmetric\Openssl
Implements: SymmetricInterface

Description

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 Laminas\Crypt\BlockCipher instead!

Methods

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

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

getAad()

Get the Additional Authentication Data

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 key size for the selected cipher

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.

Creates one if none is present.

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 for the selected algorithm

Returns: array

getTag()

Get the authentication tag

Returns: string

getTagSize()

Get the tag size for CCM and GCM mode

Returns: int

isAuthEncAvailable()

Return true if authenticated encryption is available

Returns: bool

setAad()

Set Additional Authentication Data

Parameter Name Type Description
$aad string

Returns: self

setAlgorithm()

Set the encryption algorithm (cipher)

Parameter Name Type Description
$algo string

Returns: \Openssl 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: \Openssl Provides a fluent interface

setMode()

Set the cipher mode

Parameter Name Type Description
$mode string

Returns: \Openssl 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: \Openssl 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: \Openssl Provides a fluent interface

setTagSize()

Set the tag size for CCM and GCM mode

Parameter Name Type Description
$size int

Returns: self

Top