<%
'ASP 字符串加密函数EncryptText()
'strEncryptionKey:加密key字符串,用以区别不同模块加密算法
'strTextToEncrypt:欲加密字符串
Función EncryptText(ByVal strEncryptionKey, ByVal strTextToEncrypt)
Dim exterior, interior, clave, strTemp
Para exterior = 1 a Len (strEncryptionKey)
clave = Asc(Mid(strEncryptionKey, exterior, 1))
Para interior = 1 a Len (strTextToEncrypt)
strTemp = strTemp & Chr(Asc(Mid(strTextToEncrypt, interior, 1)) clave Xor)
clave = (clave + Len (strEncryptionKey)) Mod 256
Próximo
strTextToEncrypt = strTemp
strTemp = ""
Próximo
EncryptText = strTextToEncrypt
Función final
%>
在对密码安全性要求较高的程序中,建议不要采用该函数算法.