相關(guān)資訊
本類常用軟件
-
福建農(nóng)村信用社手機銀行客戶端下載下載量:584204
-
Windows優(yōu)化大師下載量:416896
-
90美女秀(視頻聊天軟件)下載量:366961
-
廣西農(nóng)村信用社手機銀行客戶端下載下載量:365699
-
快播手機版下載量:325855
這篇文章跟大家一起分享的是教你升級MD5.ASP,打造完全動態(tài)不重復的加密代碼,希望對大家有所幫助。
做一個完全動態(tài)的密碼,讓相同的密碼生成不同的結(jié)果
密碼aaa經(jīng)過第一次運算后結(jié)果為:
jlce1d65ec3b91556234879c9db8f6da1123
第二次:
hjmnbe0d01cc1fbd3e18ae7431fa52fb3ce4
第三次:
grttb05901915e121d83ebefad7e809ef1b0
... ...
當然,亦可還原比較
以下我根據(jù)動網(wǎng)MD5函數(shù)修改后的代碼,
'=======================================
'word 要加密的字符串
'返回加密后的 word
'例:response.write Md6("aaa")'=======================================
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 加密后的原字符串
'返回比較后的結(jié)果,如果相等返回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
密碼aaa經(jīng)過第一次運算后結(jié)果為:
jlce1d65ec3b91556234879c9db8f6da1123
第二次:
hjmnbe0d01cc1fbd3e18ae7431fa52fb3ce4
第三次:
grttb05901915e121d83ebefad7e809ef1b0
... ...
當然,亦可還原比較
以下我根據(jù)動網(wǎng)MD5函數(shù)修改后的代碼,
'=======================================
'word 要加密的字符串
'返回加密后的 word
'例:response.write Md6("aaa")'=======================================
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 加密后的原字符串
'返回比較后的結(jié)果,如果相等返回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
熱門評論
最新評論