手机
当前位置:查字典教程网 >编程开发 >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 中英文字符长度检测判断函数

asp 字符串连接数据库方法

改进 ASP 的字符串处理性能

asp之字符串操作函数

asp的一个日期格式化函数

asp中对ip进行过滤限制函数

ASP 非法字符过滤函数

[asp]怎么添加验证码的解决方法

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

ASP常用的函数

精品推荐
分类导航