@@ 1408-1414 (lines=7) @@ | ||
1405 | /** |
|
1406 | * @param string $value |
|
1407 | */ |
|
1408 | function encode($value) { |
|
1409 | $text = $value; |
|
1410 | $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); |
|
1411 | $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
|
1412 | $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->CI->config->item('private_key'), $text, MCRYPT_MODE_ECB, $iv); |
|
1413 | return trim($this->encode_params($crypttext)); |
|
1414 | } |
|
1415 | ||
1416 | function decode_params($string) { |
|
1417 | $data = str_replace(array('-', '$'), array('+', '/'), $string); |
|
@@ 1425-1431 (lines=7) @@ | ||
1422 | return base64_decode($data); |
|
1423 | } |
|
1424 | ||
1425 | function decode($value) { |
|
1426 | $crypttext = $this->decode_params($value); |
|
1427 | $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); |
|
1428 | $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
|
1429 | $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->CI->config->item('private_key'), $crypttext, MCRYPT_MODE_ECB, $iv); |
|
1430 | return trim($decrypttext); |
|
1431 | } |
|
1432 | ||
1433 | /****** |
|
1434 | Recording enable/disable dropdown |