请各位大虾帮忙测试-->字符串简单加密解密
歪歪 2004-09-21 08:23:43 请各位大虾帮忙测试一下,是否成功,我好作进一步的处理
偶测试没有问题
:)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>加密/解密</title>
</head>
<body>
<%
soStr = request.Form("scrp")
'soStr = "abcdefghijklmnopqrstuvwxyz123456789如果有"
response.Write("<font color=red>原文:</font><br>"&soStr&"<hr><font color=red>密文:</font><br>")
aa=""
for s = 1 to len(soStr)
x = asc(mid(soStr,s,1))
if x < 0 or x > 255 then
y = x xor 010101
else
y = x xor 010
end if
aa = aa & chr(y)
response.write(chr(y))
next
response.write("<hr><font color=red>解文:</font><br>")
for k=1 to len(aa)
c = asc(mid(aa,k,1))
if c < 0 or c > 255 then
w = c xor 010101
else
w = c xor 010
end if
' w = c xor 010101
response.write(chr(w))
next
%>
<form name="form1" method="post" action="">
<textarea name="scrp" rows="12" cols="86"></textarea>
<input type="submit" name="Submit" value=" 处 理 ">
</form>
</body>
</html>