asp字符串加密解密函數(shù)
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
A_Key=split("96,44,63,80",",") '定義密鑰
'*********加密的過程********* Function EnCrypt(m) Dim strChar,iKeyChar,iStringChar,I k=0 for I = 1 to Len(m) iKeyChar =Cint(A_Key(k)) iStringChar = Asc(mid(m,I,1)) '獲取字符的ASCII碼值 iCryptChar = iKeyChar Xor iStringChar '進(jìn)行異或運(yùn)算 '對(duì)密鑰進(jìn)行移位運(yùn)算 If k<3 Then k=k+1 Else k=0 End If c = c & Chr(iCryptChar) next EnCrypt = c End Function '*********解密的過程********* Function DeCrypt(c) Dim strChar, iKeyChar, iStringChar, I k=0 for I = 1 to Len(c) iKeyChar =Cint(A_Key(k)) iStringChar = Asc(mid(c,I,1)) iDeCryptChar = iKeyChar Xor iStringChar '進(jìn)行異或運(yùn)算 '對(duì)密鑰進(jìn)行移位運(yùn)算 If k<3 Then k=k+1 Else k=0 End If strDecrypted = strDecrypted & Chr(iDeCryptChar) next DeCrypt = strDecrypted End Function 該文章在 2015/8/23 23:04:23 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |