Filter/Encrypt/Mcrypt.php
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Filter
- Version
- $Id: Mcrypt.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Filter_Encrypt_Mcrypt
- Implements
- \Zend_Filter_Encrypt_Interface
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties


$_encryption = array('key' => 'ZendFramework', 'algorithm' => 'blowfish', 'algorithm_directory' => '', 'mode' => 'cbc', 'mode_directory' => '', 'vector' => null, 'salt' => false)
array('key' => 'ZendFramework', 'algorithm' => 'blowfish', 'algorithm_directory' => '', 'mode' => 'cbc', 'mode_directory' => '', 'vector' => null, 'salt' => false)
Details- Type
- n/a
Methods


__construct(string | array | \Zend_Config $options) : void
Class constructor
Name | Type | Description |
---|---|---|
$options | string | array | \Zend_Config | Cryption Options |


_closeCipher(resource $cipher) : \Zend_Filter_Encrypt_Mcrypt
Close a cipher
Name | Type | Description |
---|---|---|
$cipher | resource | Cipher to close |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Mcrypt |


_initCipher(resource $cipher) : resource
Initialises the cipher with the set key
Name | Type | Description |
---|---|---|
$cipher | resource |
Type | Description |
---|---|
resource |
Exception | Description |
---|---|


_openCipher() : resource
Open a cipher
Type | Description |
---|---|
resource | Returns the opened cipher |
Exception | Description |
---|---|
\Zend_Filter_Exception | When the cipher can not be opened |


decrypt(string $value) : string
Defined by Zend_Filter_Interface
Decrypts $value with the defined settings
Name | Type | Description |
---|---|---|
$value | string | Content to decrypt |
Type | Description |
---|---|
string | The decrypted content |


encrypt(string $value) : string
Defined by Zend_Filter_Interface
Encrypts $value with the defined settings
Name | Type | Description |
---|---|---|
$value | string | The content to encrypt |
Type | Description |
---|---|
string | The encrypted content |


setCompression(string | array $compression) : \Zend_Filter_Encrypt_Mcrypt
Sets a internal compression for values to encrypt
Name | Type | Description |
---|---|---|
$compression | string | array |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Mcrypt |


setEncryption(string | array $options) : \Zend_Filter_File_Encryption
Sets new encryption options
Name | Type | Description |
---|---|---|
$options | string | array | Encryption options |
Type | Description |
---|---|
\Zend_Filter_File_Encryption |


setVector(string $vector = null) : \Zend_Filter_Encrypt_Mcrypt
Sets the initialization vector
Name | Type | Description |
---|---|---|
$vector | string | (Optional) Vector to set |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Mcrypt |