加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

ASP字符串格式化函数EncryptText()

发布时间:2023-07-29 14:57:30 所属栏目:Asp教程 来源:
导读:<%

&#39;ASP 字符串加密函数EncryptText()

&#39;strEncryptionKey:加密key字符串,用以区别不同模块加密算法

&#39;strTextToEncrypt:欲加密字符串

Function EncryptText(ByVal strEncryptionKey, By
<%
 
'ASP 字符串加密函数EncryptText()
 
'strEncryptionKey:加密key字符串,用以区别不同模块加密算法
 
'strTextToEncrypt:欲加密字符串
 
Function EncryptText(ByVal strEncryptionKey, ByVal strTextToEncrypt)
 
    Dim outer, inner, Key, strTemp
 
    For outer = 1 To Len(strEncryptionKey)
 
        key = Asc(Mid(strEncryptionKey, outer, 1))
 
        For inner = 1 To Len(strTextToEncrypt)
 
            strTemp = strTemp & Chr(Asc(Mid(strTextToEncrypt, inner, 1)) Xor key)
 
            key = (key + Len(strEncryptionKey)) Mod 256
 
        Next
 
        strTextToEncrypt = strTemp
 
        strTemp = ""
 
    Next
 
    EncryptText = strTextToEncrypt
 
End Function
 
%>
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章