summaryrefslogtreecommitdiffstats
path: root/system/libraries/Encrypt.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-05-02 12:27:30 +0200
committerAndrey Andreev <narf@bofh.bg>2012-05-02 12:27:30 +0200
commit14aa3178e12f285bed006511902e50aaae69bada (patch)
treea33410e21a5de095070fc5cc6d14b2649954e0a7 /system/libraries/Encrypt.php
parent3ea6b1fd8fb0492d84c4879e039d11713c9f39a5 (diff)
parent963c96c5507ceb8b5c3de50d0ab959d21dcc8cd1 (diff)
Merge upstream branch
Diffstat (limited to 'system/libraries/Encrypt.php')
-rw-r--r--system/libraries/Encrypt.php60
1 files changed, 47 insertions, 13 deletions
diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php
index b29eb470e..17437c1ca 100644
--- a/system/libraries/Encrypt.php
+++ b/system/libraries/Encrypt.php
@@ -38,15 +38,47 @@
*/
class CI_Encrypt {
- public $encryption_key = '';
- protected $_hash_type = 'sha1';
- protected $_mcrypt_exists = FALSE;
+ /**
+ * Reference to the user's encryption key
+ *
+ * @var string
+ */
+ public $encryption_key = '';
+
+ /**
+ * Type of hash operation
+ *
+ * @var string
+ */
+ protected $_hash_type = 'sha1';
+
+ /**
+ * Flag for the existance of mcrypt
+ *
+ * @var bool
+ */
+ protected $_mcrypt_exists = FALSE;
+
+ /**
+ * Current cipher to be used with mcrypt
+ *
+ * @var string
+ */
protected $_mcrypt_cipher;
+
+ /**
+ * Method for encrypting/decrypting data
+ *
+ * @var int
+ */
protected $_mcrypt_mode;
+ /**
+ * Initialize Encryption class
+ */
public function __construct()
{
- $this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE;
+ $this->_mcrypt_exists = function_exists('mcrypt_encrypt');
log_message('debug', 'Encrypt Class Initialized');
}
@@ -349,8 +381,9 @@ class CI_Encrypt {
*
* Function description
*
- * @param type
- * @return type
+ * @param string $data
+ * @param string $key
+ * @return string
*/
protected function _remove_cipher_noise($data, $key)
{
@@ -382,8 +415,8 @@ class CI_Encrypt {
/**
* Set the Mcrypt Cipher
*
- * @param constant
- * @return string
+ * @param int
+ * @return object
*/
public function set_cipher($cipher)
{
@@ -396,8 +429,8 @@ class CI_Encrypt {
/**
* Set the Mcrypt Mode
*
- * @param constant
- * @return string
+ * @param int
+ * @return object
*/
public function set_mode($mode)
{
@@ -410,7 +443,7 @@ class CI_Encrypt {
/**
* Get Mcrypt cipher Value
*
- * @return string
+ * @return int
*/
protected function _get_cipher()
{
@@ -427,7 +460,7 @@ class CI_Encrypt {
/**
* Get Mcrypt Mode Value
*
- * @return string
+ * @return int
*/
protected function _get_mode()
{
@@ -464,7 +497,8 @@ class CI_Encrypt {
{
return ($this->_hash_type === 'sha1') ? sha1($str) : md5($str);
}
+
}
/* End of file Encrypt.php */
-/* Location: ./system/libraries/Encrypt.php */
+/* Location: ./system/libraries/Encrypt.php */ \ No newline at end of file