1875. Class

1875.1. Zend\Crypt\Symmetric\Mcrypt

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 ZendCryptBlockCipher instead!

1875.1.1. Methods

1875.1.1.1. __construct

__construct()

Constructor

Parameters:array|Traversable
Throws ExceptionRuntimeException:
 
Throws ExceptionInvalidArgumentException:
 

1875.1.1.2. setDefaultOptions

setDefaultOptions()

Set default options

Parameters:array
Return type:void

1875.1.1.3. getPaddingPluginManager

getPaddingPluginManager()

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

Return type:PaddingPluginManager

1875.1.1.4. setPaddingPluginManager

setPaddingPluginManager()

Set the padding plugin manager

Parameters:string|PaddingPluginManager
Throws ExceptionInvalidArgumentException:
 
Return type:void

1875.1.1.5. getKeySize

getKeySize()

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

Return type:integer

1875.1.1.6. setKey

setKey()

Set the encryption key

Parameters:string
Throws ExceptionInvalidArgumentException:
 
Return type:Mcrypt

1875.1.1.7. getKey

getKey()

Get the encryption key

Return type:string

1875.1.1.8. setAlgorithm

setAlgorithm()

Set the encryption algorithm (cipher)

Parameters:string
Throws ExceptionInvalidArgumentException:
 
Return type:Mcrypt

1875.1.1.9. getAlgorithm

getAlgorithm()

Get the encryption algorithm

Return type:string

1875.1.1.10. setPadding

setPadding()

Set the padding object

Parameters:PaddingPaddingInterface
Return type:Mcrypt

1875.1.1.11. getPadding

getPadding()

Get the padding object

Return type:PaddingPaddingInterface

1875.1.1.12. encrypt

encrypt()

Encrypt

Parameters:string
Throws ExceptionInvalidArgumentException:
 
Return type:string

1875.1.1.13. decrypt

decrypt()

Decrypt

Parameters:string
Throws ExceptionInvalidArgumentException:
 
Return type:string

1875.1.1.14. getSaltSize

getSaltSize()

Get the salt (IV) size

Return type:integer

1875.1.1.15. getSupportedAlgorithms

getSupportedAlgorithms()

Get the supported algorithms

Return type:array

1875.1.1.16. setSalt

setSalt()

Set the salt (IV)

Parameters:string
Throws ExceptionInvalidArgumentException:
 
Return type:Mcrypt

1875.1.1.17. getSalt

getSalt()

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

Return type:string

1875.1.1.18. getOriginalSalt

getOriginalSalt()

Get the original salt value

Return type:string

1875.1.1.19. setMode

setMode()

Set the cipher mode

Parameters:string
Throws ExceptionInvalidArgumentException:
 
Return type:Mcrypt

1875.1.1.20. getMode

getMode()

Get the cipher mode

Return type:string

1875.1.1.21. getSupportedModes

getSupportedModes()

Get all supported encryption modes

Return type:array

1875.1.1.22. getBlockSize

getBlockSize()

Get the block size

Return type:integer

1875.1.2. Constants

1875.1.2.1. DEFAULT_PADDING