public function __construct($key, $strength = 256, $mode = 'cbc')
{
$this->keyString = $key;
switch ($strength) {
case 256:
default:
$this->cipherType = MCRYPT_RIJNDAEL_256;
break;
case 192:
$this->cipherType = MCRYPT_RIJNDAEL_192;
break;
case 128:
$this->cipherType = MCRYPT_RIJNDAEL_128;
break;
}
switch (strtoupper($mode)) {
case 'ECB':
$this->cipherMode = MCRYPT_MODE_ECB;
break;
case 'CBC':
$this->cipherMode = MCRYPT_MODE_CBC;
break;
}
}