注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 raymond关于番茄花园事件..
 帮助

一种增强的md5加密算法


2008-06-04 16:26:48
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一种增强的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的技术专栏” 博客,谢绝转载!





    文章评论
 
 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: