做一个完全动态的密码,让相同的密码生成不同的结果
密码aaa经过第一次运算后结果为:
jlce1d65ec3b91556234879c9db8f6da1123
第二次:
hjmnbe0d01cc1fbd3e18ae7431fa52fb3ce4
第三次:
grttb05901915e121d83ebefad7e809ef1b0
… …
当然,亦可还原比较
以下我根据动网md5函数修改后的代码,
=======================================
word 要加密的字符串
返回加密后的 word
例:response.write md6(“aaa”)
www.knowsky.com
=======================================
function md6(word)
dim random, randomnum, rerandom, reword
randomize
do while len(random) < 4
randomnum = chr(25 * rnd + 97 )
random = random & randomnum
loop
rerandom = md5(random)
reword = md5(word)
md6 = lcase(random & md5(rerandom + reword))
end function
=======================================
wrod 需要验证的字符串,oldword 加密后的原字符串
返回比较后的结果,如果相等返回true,反之false
例:pwd=“aaa“
old_pwd=“grttb05901915e121d83ebefad7e809ef1b0“
if md6back(pwd,old_pwd)=true then
… …
=======================================
function md6back(word, oldword)
dim random, randomnum, rerandom, reword
random = mid(oldword, 1, 4)
rerandom = md5(random)
reword = md5(word)
if oldword = random & md5(rerandom + reword) then
md6back = true
else
md6back = false
end if
end function