Ryzom Account Management System
|
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 |
Basic encryption/decryption class.
We use this class atm for encrypting & decrypting the imap passwords.
MyCrypt::__construct | ( | $ | cryptinfo | ) |
constructor.
loads the config array with the given argument.
$cryptinfo | an array containing the info needed to encrypt & decrypt.(enc_method & hash_method & key) |
static MyCrypt::check_methods | ( | $ | enc, |
$ | hash | ||
) | [static, private] |
checks if the encryption and hash methods are supported
$enc | the encryption method. |
$hash | the hash method. |
Exception | in case a method is not supported. |
MyCrypt::decrypt | ( | $ | edata | ) |
decrypts by using the given enc_method and hash_method.
$edata | the encrypted string that we want to decrypt |
MyCrypt::encrypt | ( | $ | data | ) |
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
$data | the string that we want to encrypt. |
static MyCrypt::hashIV | ( | $ | key, |
$ | method, | ||
$ | iv_size | ||
) | [static, private] |
hashes the key by using a hash method specified.
$key | the key to be hashed |
$method | the metho of hashing to be used |
$iv_size | the size of the initialization vector. |