|
@@ 209-215 (lines=7) @@
|
| 206 |
|
public function __construct($type, $params=NULL) {
|
| 207 |
|
srand();
|
| 208 |
|
switch ($type) {
|
| 209 |
|
case (self::TRIPLEDES_CBC):
|
| 210 |
|
$this->cryptParams['library'] = 'mcrypt';
|
| 211 |
|
$this->cryptParams['cipher'] = MCRYPT_TRIPLEDES;
|
| 212 |
|
$this->cryptParams['mode'] = MCRYPT_MODE_CBC;
|
| 213 |
|
$this->cryptParams['method'] = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc';
|
| 214 |
|
$this->cryptParams['keysize'] = 24;
|
| 215 |
|
break;
|
| 216 |
|
case (self::AES128_CBC):
|
| 217 |
|
$this->cryptParams['library'] = 'mcrypt';
|
| 218 |
|
$this->cryptParams['cipher'] = MCRYPT_RIJNDAEL_128;
|
|
@@ 216-222 (lines=7) @@
|
| 213 |
|
$this->cryptParams['method'] = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc';
|
| 214 |
|
$this->cryptParams['keysize'] = 24;
|
| 215 |
|
break;
|
| 216 |
|
case (self::AES128_CBC):
|
| 217 |
|
$this->cryptParams['library'] = 'mcrypt';
|
| 218 |
|
$this->cryptParams['cipher'] = MCRYPT_RIJNDAEL_128;
|
| 219 |
|
$this->cryptParams['mode'] = MCRYPT_MODE_CBC;
|
| 220 |
|
$this->cryptParams['method'] = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc';
|
| 221 |
|
$this->cryptParams['keysize'] = 16;
|
| 222 |
|
break;
|
| 223 |
|
case (self::AES192_CBC):
|
| 224 |
|
$this->cryptParams['library'] = 'mcrypt';
|
| 225 |
|
$this->cryptParams['cipher'] = MCRYPT_RIJNDAEL_128;
|
|
@@ 223-229 (lines=7) @@
|
| 220 |
|
$this->cryptParams['method'] = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc';
|
| 221 |
|
$this->cryptParams['keysize'] = 16;
|
| 222 |
|
break;
|
| 223 |
|
case (self::AES192_CBC):
|
| 224 |
|
$this->cryptParams['library'] = 'mcrypt';
|
| 225 |
|
$this->cryptParams['cipher'] = MCRYPT_RIJNDAEL_128;
|
| 226 |
|
$this->cryptParams['mode'] = MCRYPT_MODE_CBC;
|
| 227 |
|
$this->cryptParams['method'] = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc';
|
| 228 |
|
$this->cryptParams['keysize'] = 24;
|
| 229 |
|
break;
|
| 230 |
|
case (self::AES256_CBC):
|
| 231 |
|
$this->cryptParams['library'] = 'mcrypt';
|
| 232 |
|
$this->cryptParams['cipher'] = MCRYPT_RIJNDAEL_128;
|
|
@@ 230-236 (lines=7) @@
|
| 227 |
|
$this->cryptParams['method'] = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc';
|
| 228 |
|
$this->cryptParams['keysize'] = 24;
|
| 229 |
|
break;
|
| 230 |
|
case (self::AES256_CBC):
|
| 231 |
|
$this->cryptParams['library'] = 'mcrypt';
|
| 232 |
|
$this->cryptParams['cipher'] = MCRYPT_RIJNDAEL_128;
|
| 233 |
|
$this->cryptParams['mode'] = MCRYPT_MODE_CBC;
|
| 234 |
|
$this->cryptParams['method'] = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc';
|
| 235 |
|
$this->cryptParams['keysize'] = 32;
|
| 236 |
|
break;
|
| 237 |
|
case (self::RSA_1_5):
|
| 238 |
|
$this->cryptParams['library'] = 'openssl';
|
| 239 |
|
$this->cryptParams['padding'] = OPENSSL_PKCS1_PADDING;
|