equal
deleted
inserted
replaced
805 /** |
805 /** |
806 * Wrapper for decryption. |
806 * Wrapper for decryption. |
807 * @param string $text the encrypted text |
807 * @param string $text the encrypted text |
808 * @param string $key the raw binary key used to encrypt the text |
808 * @param string $key the raw binary key used to encrypt the text |
809 * @param int $input_encoding the encoding used for the encrypted string. Can be ENC_BINARY, ENC_HEX, or ENC_BASE64. |
809 * @param int $input_encoding the encoding used for the encrypted string. Can be ENC_BINARY, ENC_HEX, or ENC_BASE64. |
|
810 * @param bool $no_cache If true, will not cache the decrypted string on disk. |
810 * @return string |
811 * @return string |
811 */ |
812 */ |
812 |
813 |
813 function decrypt($text, $key, $input_encoding = ENC_HEX) |
814 function decrypt($text, $key, $input_encoding = ENC_HEX, $no_cache = false) |
814 { |
815 { |
815 if ( $text == '' ) |
816 if ( $text == '' ) |
816 return ''; |
817 return ''; |
817 |
818 |
818 switch($input_encoding) |
819 switch($input_encoding) |
869 if ( !isset($this->decrypt_cache[$key_bin]) ) |
870 if ( !isset($this->decrypt_cache[$key_bin]) ) |
870 $this->decrypt_cache[$key_bin] = array(); |
871 $this->decrypt_cache[$key_bin] = array(); |
871 |
872 |
872 $this->decrypt_cache[$key_bin][$text_bin] = $dypt; |
873 $this->decrypt_cache[$key_bin][$text_bin] = $dypt; |
873 |
874 |
874 aes_decrypt_cache_store($text_bin, $dypt, $key_bin); |
875 if ( !$no_cache ) |
|
876 aes_decrypt_cache_store($text_bin, $dypt, $key_bin); |
875 |
877 |
876 return $dypt; |
878 return $dypt; |
877 } |
879 } |
878 |
880 |
879 /** |
881 /** |