From 549ecc200e16789f5b0cde8b38b0c4a70759da1f Mon Sep 17 00:00:00 2001 From: asiekierka Date: Sat, 22 Dec 2012 17:38:49 +0100 Subject: added imgcaptcha files --- inc/ic-encrypt.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 inc/ic-encrypt.php (limited to 'inc/ic-encrypt.php') diff --git a/inc/ic-encrypt.php b/inc/ic-encrypt.php new file mode 100644 index 00000000..c0f499bd --- /dev/null +++ b/inc/ic-encrypt.php @@ -0,0 +1,39 @@ +skey, $text, MCRYPT_MODE_ECB, $iv); + return trim($this->safe_b64encode($crypttext)); + } + + public function decode($value){ + if(!$value){return false;} + $crypttext = $this->safe_b64decode($value); + $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); + $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); + $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->skey, $crypttext, MCRYPT_MODE_ECB, $iv); + return trim($decrypttext); + } +} +?> -- cgit v1.3