Private Function EncryptString(strString)Dim CharHexSet, intStringLen, strTemp, strRAW, i, intKey, intOffSetRandomize Timer(本文来源于图老师网站,更多请访问http://m.tulaoshi.com)intKey = Round((RND * 1000000) + 1000000) '##### Key BitsizeintOffSet = Round((RND * 1000000) + 1000000) '##### KeyOffSet BitsizeIf IsNull(strString) = False ThenstrRAW = strStringintStringLen = Len(strRAW)For i = 0 to intStringLen - 1strTemp = Left(strRAW, 1)strRAW = Right(strRAW, Len(strRAW) - 1)CharHexSet = CharHexSet & Hex(Asc(strTemp) * intKey)& Hex(intKey)NextEncryptString = CharHexSet & "|" & Hex(intOffSet + intKey) & "|" & Hex(intOffSet)ElseEncryptString = ""End IfEnd FunctionPrivate Function DecryptString(strCryptString)Dim strRAW, arHexCharSet, i, intKey, intOffSet, strRawKey, strHexCrypDatastrRawKey = Right(strCryptString, Len(strCryptString) - InStr(strCryptString, "|"))intOffSet = Right(strRawKey, Len(strRawKey) - InStr(strRawKey,"|"))intKey = HexConv(Left(strRawKey, InStr(strRawKey, "|") - 1)) - HexConv(intOffSet)strHexCrypData = Left(strCryptString, Len(strCryptString) - (Len(strRawKey) + 1))arHexCharSet = Split(strHexCrypData, Hex(intKey))For i=0 to UBound(arHexCharSet)strRAW = strRAW & Chr(HexConv(arHexCharSet(i))/intKey)NextDecryptString = strRAWEnd FunctionPrivate Function HexConv(hexVar)Dim hxx, hxx_var, multiply IF hexVar < "" THENhexVar = UCASE(hexVar)hexVar = StrReverse(hexVar)DIM hx()REDIM hx(LEN(hexVar))hxx = 0hxx_var = 0FOR hxx = 1 TO LEN(hexVar)IF multiply = "" THEN multiply = 1hx(hxx) = mid(hexVar,hxx,1)hxx_var = (get_hxno(hx(hxx)) * multiply) + hxx_varmultiply = (multiply * 16)NEXThexVar = hxx_varHexConv = hexVarEND IFEnd FunctionPrivate Function get_hxno(ghx)If ghx = "A" Thenghx = 10ElseIf ghx = "B" Thenghx = 11ElseIf ghx = "C" Thenghx = 12ElseIf ghx = "D" Thenghx = 13ElseIf ghx = "E" Thenghx = 14ElseIf ghx = "F" Thenghx = 15End Ifget_hxno = ghxEnd Function (本文来源于图老师网站,更多请访问http://m.tulaoshi.com)