日期:2013-06-14  浏览次数:20846 次

#####  版权所有  转载请保留  谢谢合作  
#####  部分程序取自网络               
#####  作者:扬子                     
#####  Email: yangzinet@hotmail.com  
#####  QQ: 21112856
#####  WebSite: www.tingfo.net



一共4个页面:form.asp; chk.asp; num.asp; count.asp
得到一个随即数字。加密!
解密后成成XBM图片
利用session 判断

form.asp


<%
     '### To encrypt/decrypt include this code in your page
     '### strMyEncryptedString = EncryptString(strString)
     '### strMyDecryptedString = DeCryptString(strMyEncryptedString)
     '### You are free to use this code as long as credits remain in place
     '### also if you improve this code let me know.
     
     Private Function EncryptString(strString)
     '####################################################################
     '### Crypt Function (C) 2001 by Slavic Kozyuk grindkore@yahoo.com ###
     '### Arguments: strString <--- String you wish to encrypt ###
     '### Output: Encrypted HEX string ###
     '####################################################################
     
     Dim CharHexSet, intStringLen, strTemp, strRAW, i, intKey, intOffSet
     Randomize Timer
     
     intKey = Round((RND * 1000000) + 1000000) '##### Key Bitsize
     intOffSet = Round((RND * 1000000) + 1000000) '##### KeyOffSet Bitsize
     
     If IsNull(strString) = False Then
     strRAW = strString
     intStringLen = Len(strRAW)
     
     For i = 0 to intStringLen - 1
     strTemp = Left(strRAW, 1)
     strRAW = Right(strRAW, Len(strRAW) - 1)
     CharHexSet = CharHexSet & Hex(Asc(strTemp) * intKey)& Hex(intKey)
     Next
     
     EncryptString = CharHexSet & "|" & Hex(intOffSet + intKey) & "|" & Hex(intOffSet)
     Else
     EncryptString = ""
     End If
     End Function
     
     
     
     
     Private Function DeCryptString(strCryptString)
     '####################################################################
     '### Crypt Function (C) 2001 by Slavic Kozyuk grindkore@yahoo.com ###
     '### Arguments: Encrypted HEX stringt ###
     '### Output: Decrypted ASCII string ###
     '####################################################################
     '### Note this function uses HexConv() and get_hxno() functions ###
     '### so make sure they are not removed ###
     '#############################