function encrypted($data)
{
$key = "liumanaiqiaoqiaonicaibudao";
$key = strtoupper(md5($key));
$x = 0;
$len = strlen($data);
$l = strlen($key);
$char = "";
$str = "";
for ($i = 0; $i < $len; $i++)
{
if ($x == $l)
{
$x = 0;
}
$char .= substr($key, $x, 1);
$x++;
}
for ($i = 0; $i < $len; $i++)
{
$str .= substr("00" . (ord(substr($data, $i, 1)) + (ord(substr($char, $i, 1))) % 256), -3);
}
return $str;
}
function decrypt($data)
{
$key = "liumanaiqiaoqiaonicaibudao";
$key = strtoupper(md5($key));
$x = 0;
$len = strlen($data)/3;
$l = strlen($key);
$char = "";
$str = "";
for ($i = 0; $i < $len; $i++)
{
if ($x == $l)
{
$x = 0;
}
$char .= substr($key, $x, 1);
$x++;
}
for ($i = 0; $i < $len; $i++)
{
if (substr($data, $i*3, 3) < ord(substr($char, $i, 1)))
{
$str .= chr((substr($data, $i*3, 3) + 256) - ord(substr($char, $i, 1)));
}
else
{
$str .= chr(substr($data, $i*3, 3) - ord(substr($char, $i, 1)));
}
}
return $str;
}
Function 解密字符串(字符串)
解密字符串 = ""
临时字符串 = ""
秘钥 = "liumanaiqiaoqiaonicaibudao"
秘钥 = Plugin.Encrypt.Md5String(秘钥)
秘钥位置 = 1
字符串长度 = Len(字符串)/3
秘钥长度 = Len(秘钥)
For i = 1 To 字符串长度
If 秘钥位置 > 秘钥长度 Then
秘钥位置 = 1
End If
临时字符串 = 临时字符串 & Mid(秘钥,秘钥位置,1)
秘钥位置 = 秘钥位置 + 1
Next
For i = 0 To 字符串长度 - 1
If Mid(字符串, i*3 + 1, 3) < Asc(Mid(临时字符串, i + 1, 1)) Then
解密字符串 = 解密字符串 & Chr((Mid(字符串, i*3 + 1, 3) + 256) - Asc(Mid(临时字符串, i + 1, 1)))
Else
解密字符串 = 解密字符串 & Chr((Mid(字符串, i*3 + 1, 3)) - Asc(Mid(临时字符串, i + 1, 1)))
End If
Next
End Function
Function 加密字符串(字符串)
加密字符串 = ""
临时字符串 = ""
秘钥 = "liumanaiqiaoqiaonicaibudao"
秘钥 = Plugin.Encrypt.Md5String(秘钥)
秘钥位置 = 1
字符串长度 = Len(字符串)
秘钥长度 = Len(秘钥)
For i = 1 To 字符串长度
If 秘钥位置 > 秘钥长度 Then
秘钥位置 = 1
End If
临时字符串 = 临时字符串 & Mid(秘钥,秘钥位置,1)
秘钥位置 = 秘钥位置 + 1
Next
For i = 1 To 字符串长度
加密字符串 = 加密字符串 & Right("00" & (Asc(Mid(字符串,i,1)) + Asc(Mid(临时字符串,i,1)) Mod 256), 3)
Next
End Function