一种增强的md5加密算法
陈小兵
<!--#include file="md5.asp"-->
<%
Function GetRandomizeCode(digit)
Randomize
Dim m_strRandArray,m_intRandlen,m_strRandomize,i
m_strRandArray = Array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
m_intRandlen = digit ''定义随机码的长度
for i = 1 to m_intRandlen
m_strRandomize = m_strRandomize & m_strRandArray(Int((21*Rnd)))
next
GetRandomizeCode = lcase(m_strRandomize)
End Function
Function encrypt_password(beginnumber,number,password,md5_digit)
A=left(md5(password),beginnumber-1)
B=Right(md5(password),md5_digit-(beginnumber+number-1))
C=GetRandomizeCode(number)
D=A&C&B
encrypt_password=d
response.write "生成的随机数为:"&C&"<br>"
End Function
response.write "修改后的密码为encrypt_password(3,6,12345678,16):"&encrypt_password(3,6,12345678,16)&"<br>"
response.write "原密码为:"&md5(12345678)&"<br>"
%>
本文出自 “simeon技术专栏” 博客,谢绝转载!