Security | dynamic | encryption | repeat
Make a completely dynamic password, so that the same password produces different results
Password AAA After the first operation the result is:
Jlce1d65ec3b91556234879c9db8f6da1123
Second time:
Hjmnbe0d01cc1fbd3e18ae7431fa52fb3ce4
Third time:
Grttb05901915e121d83ebefad7e809ef1b0
... ...
Of course, the comparison can be restored
The following I based on the dynamic network MD5 function modified code,
'=======================================
' Word to encrypt the string
' Returns the encrypted word
' Example: Response.Write Md6 ("AAA")
' Www.knowsky.com
'=======================================
Function Md6 (Word)
Dim Random, Randomnum, Rerandom, reword
Randomize
Do While Len (Random) < 4
Randomnum = CHR (* rnd + 97)
Random = Random & Randomnum
Loop
Rerandom = Md5 (Random)
Reword = Md5 (Word)
Md6 = LCase (Random & Md5 (Rerandom + reword))
End Function
' =======================================
' Wrod the string to be validated, Oldword the encrypted original string
' Returns the result of the comparison, if the equality returns TRUE, or False
' Example: 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