手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp字符串加密解密函数
asp字符串加密解密函数
摘要:

<%

A_Key=split("96,44,63,80",",")'定义密钥

'*********加密的过程*********

FunctionEnCrypt(m)

DimstrChar,iKeyChar,iStringChar,I

k=0

forI=1toLen(m)

iKeyChar=Cint(A_Key(k))

iStringChar=Asc(mid(m,I,1))'获取字符的ASCII码值

iCryptChar=iKeyCharXoriStringChar'进行异或运算

'对密钥进行移位运算

Ifk<3Then

k=k+1

Else

k=0

EndIf

c=c&Chr(iCryptChar)

next

EnCrypt=c

EndFunction

'*********解密的过程*********

FunctionDeCrypt(c)

DimstrChar,iKeyChar,iStringChar,I

k=0

forI=1toLen(c)

iKeyChar=Cint(A_Key(k))

iStringChar=Asc(mid(c,I,1))

iDeCryptChar=iKeyCharXoriStringChar'进行异或运算

'对密钥进行移位运算

Ifk<3Then

k=k+1

Else

k=0

EndIf

strDecrypted=strDecrypted&Chr(iDeCryptChar)

next

DeCrypt=strDecrypted

EndFunction

%>

【asp字符串加密解密函数】相关文章:

asp 字符串连接数据库方法

总是弹出visual studio 实时调试器 三种解决办法

asp无组件上传带真实进度条

asp的一个日期格式化函数

asp最常用的分页函数

一段在asp中加密与解密对应的函数

ASP 非法字符过滤函数

asp 中英文字符长度检测判断函数

另类的文件上传解决方案

收集asp的常用函数

精品推荐
分类导航