Ryzom Account Management System  1.0
Public Member Functions | Static Private Member Functions | Private Attributes
MyCrypt Class Reference

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

__construct ( cryptinfo)

constructor.

loads the config array with the given argument.

Parameters:
$cryptinfoan array containing the info needed to encrypt & decrypt.(enc_method & hash_method & key)

Member Function Documentation

static check_methods ( enc,
hash 
) [static, private]

checks if the encryption and hash methods are supported

Parameters:
$encthe encryption method.
$hashthe hash method.
Exceptions:
Exceptionin case a method is not supported.
decrypt ( edata)

decrypts by using the given enc_method and hash_method.

Parameters:
$edatathe encrypted string that we want to decrypt
Returns:
the decrypted string.
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

Parameters:
$datathe 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:
$keythe key to be hashed
$methodthe metho of hashing to be used
$iv_sizethe size of the initialization vector.
Returns:
return the hashed key up till the size of the iv_size param.

Field Documentation

$config [private]

array that should contain the enc_method & hash_method & key


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables