最新消息: 新版网站上线了!!!

PHP加密函数


	//php加密函数
	public function encypt_text($text) {
		$key = "ShitAndFuck";
		$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
		$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
		$key = md5($key);
		$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_ECB);
		$base64encoded_ciphertext = base64_encode($ciphertext);
		return $base64encoded_ciphertext;
	}

转载请注明:谷谷点程序 » PHP加密函数