@@ 241-249 (lines=9) @@ | ||
238 | return $this->user_model->clean($username); |
|
239 | } |
|
240 | ||
241 | function encrypt($key, $encrypt_item) { |
|
242 | ||
243 | $iv = mcrypt_create_iv(IV_SIZE, MCRYPT_DEV_URANDOM); |
|
244 | $crypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $encrypt_item, MCRYPT_MODE_CBC, $iv); |
|
245 | $combo = $iv . $crypt; |
|
246 | $output = base64_encode($iv . $crypt); |
|
247 | ||
248 | return $output; |
|
249 | } |
|
250 | ||
251 | function ip_is_private($ip) { |
|
252 | $safe_ip = array( |
@@ 75-81 (lines=7) @@ | ||
72 | ||
73 | define('IV_SIZE', mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); |
|
74 | ||
75 | function encrypt ($key, $username) { |
|
76 | $iv = mcrypt_create_iv(IV_SIZE, MCRYPT_DEV_URANDOM); |
|
77 | $crypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $username, MCRYPT_MODE_CBC, $iv); |
|
78 | $combo = $iv . $crypt; |
|
79 | $output = base64_encode($iv . $crypt); |
|
80 | return $output; |
|
81 | } |
|
82 | ||
83 | $key = "dnqyypv8y6qcm8n38cvmsuqkevcvmhy2"; |
|
84 | $username = $u->getUserName(); |