⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_aes.asp

📁 前几天刚下的一个ASP的AES源码 输入keySize密钥长度(128、192、256),Src明文字符串
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include virtual="aes.asp"-->
<%
dim aes, s, key, Result, CipherText, KeySize, sKeySize
set aes = new aes_class
s = Request.Form("plainText")
key = Request.Form("password")
KeySize = Request.Form("KeySize")
select case KeySize
	case 256 sKeySize = "<input type=""radio"" name=""KeySize"" value=""128"">128位(16字符密码)  <input type=""radio"" name=""KeySize"" value=""192"">192位(24字符密码)  <input name=""KeySize"" type=""radio"" value=""256"" checked>256位(32字符密码)"
	case 192 sKeySize = "<input type=""radio"" name=""KeySize"" value=""128"">128位(16字符密码)  <input type=""radio"" name=""KeySize"" value=""192"" checked>192位(24字符密码)  <input name=""KeySize"" type=""radio"" value=""256"">256位(32字符密码)"
	case else
		sKeySize = "<input type=""radio"" name=""KeySize"" value=""128"" checked>128位(16字符密码)  <input type=""radio"" name=""KeySize"" value=""192"">192位(24字符密码)  <input name=""KeySize"" type=""radio"" value=""256"" >256位(32字符密码)"
end select
CipherText = aes.CipherStrToHexStr(KeySize, s, key)
Result = aes.InvCipherHexStrToStr(KeySize, CipherText, key)
if isnull(s) or s = "" then 
	CipherText = ""
	Result = ""
end if
's = "我是明文,都能看到吧"
'key = "ABCDEFGHIJKLMNOPQRSTUVWX"
'keysize = 192
'Response.Write("<BR>明文<BR>")
'Response.Write(S)
'Response.Write("<BR>密文<BR>")
'Response.Write(aes.CipherStrToHexStr (keysize, s, key))
'Response.Write("<BR>解密字符串<BR>")
'Response.Write(aes.InvCipherHexStrToStr(keysize, aes.CipherStrToHexStr (keysize, s, key), key))
'Response.Write("<BR>解密十六进制字符串<BR>")
'Response.Write(aes.InvCipherHexStrToHexStr(keysize, aes.CipherStrToHexStr (keysize, s, key), key))
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>AES加密/解密测试</title>
</head>

<body>
<form name="form_aes" method="post" action="">
<table width="842" border="0">
  <tr>
    <td width="200" align="right">明文:</td>
    <td width="535"><textarea name="plainText" cols="80" rows="5" id="plainText"><%=s%></textarea></td>
    <td width="93">&nbsp;</td>
  </tr>
  <tr>
    <td width="200" align="right">密码:</td>
    <td><input name="password" type="password" id="password" size="80" maxlength="32" value="<%=key%>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">密码明文:</td>
    <td><input name="password1" type="text" id="password1" size="80" maxlength="32" value="<%=key%>" readonly></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">密钥强度:</td>
    <td><%=sKeySize%></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="200" align="right">密文:</td>
    <td><textarea name="CipherText" cols="80" rows="5" id="CipherText" readonly><%=CipherText%></textarea></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="200" align="right">解密结果:</td>
    <td><textarea name="Result" cols="80" rows="5" id="Result" readonly><%=Result%></textarea></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="Submit" value="提交"></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -