Basic encryption/decryption class.
More...
Public Member Functions |
| __construct ($cryptinfo) |
| constructor.
|
| encrypt ($data) |
| encrypts by using the given enc_method and hash_method.
|
| decrypt ($edata) |
| decrypts by using the given enc_method and hash_method.
|
Static Private Member Functions |
static | hashIV ($key, $method, $iv_size) |
| hashes the key by using a hash method specified.
|
static | check_methods ($enc, $hash) |
| checks if the encryption and hash methods are supported
|
Private Attributes |
| $config |
| array that should contain the enc_method & hash_method & key
|
Detailed Description
Basic encryption/decryption class.
We use this class atm for encrypting & decrypting the imap passwords.
Constructor & Destructor Documentation
constructor.
loads the config array with the given argument.
- Parameters:
-
$cryptinfo | an array containing the info needed to encrypt & decrypt.(enc_method & hash_method & key) |
Member Function Documentation
checks if the encryption and hash methods are supported
- Parameters:
-
$enc | the encryption method. |
$hash | the hash method. |
- Exceptions:
-
Exception | in case a method is not supported. |
decrypts by using the given enc_method and hash_method.
- Parameters:
-
$edata | the encrypted string that we want to decrypt |
- Returns:
- the decrypted string.
encrypts by using the given enc_method and hash_method.
It will first check if the methods are supported, if not it will throw an error, if so it will encrypt the $data
- Parameters:
-
$data | the string that we want to encrypt. |
- Returns:
- the encrypted string.
static hashIV |
( |
$ |
key, |
|
|
$ |
method, |
|
|
$ |
iv_size |
|
) |
| [static, private] |
hashes the key by using a hash method specified.
- Parameters:
-
$key | the key to be hashed |
$method | the metho of hashing to be used |
$iv_size | the size of the initialization vector. |
- Returns:
- return the hashed key up till the size of the iv_size param.
Field Documentation
array that should contain the enc_method & hash_method & key
The documentation for this class was generated from the following file:
- /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mycrypt.php