Program | essence | Verification Code ##### Copyright reprint please reserve thank you for your cooperation
##### part of the program is taken from the network
##### Author: Yang Zi
##### email:yangzinet@hotmail.com
##### qq:21112856
##### WebSite:www.tingfo.net
Altogether 4 pages: form.asp; chk.asp; num.asp; Count.asp
Get a random number. Encryption!
into XBM image after decryption
Using session to judge
Form.asp
<%
' ### to Encrypt/decrypt include-code in your page
' ### strmyencryptedstring = encryptstring (strstring)
' ### strmydecryptedstring = decryptstring (strmyencryptedstring)
' ### you are the free to use this code as long as credits remain into place
' ### also if you are improve this code let me know.
Private Function encryptstring (strstring)
'####################################################################
' ### Crypt Function (C) 2001 by Slavic Kozyuk grindkore@yahoo.com
' ### arguments:strstring <---String 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 ###
'####################################################################
Dim Strraw, Arhexcharset, I, Intkey, Intoffset, Strrawkey, Strhexcrypdata
Strrawkey = Right (strcryptstring, Len (strcryptstring)-InStr (strcryptstring, "|"))
Intoffset = Right (Strrawkey, Len (Strrawkey)-InStr (Strrawkey, "|"))
Intkey = Hexconv (left (Strrawkey, InStr (Strrawkey, "|")-1))-Hexconv (Intoffset)
Strhexcrypdata = Left (strcryptstring, Len (strcryptstring)-(Len (Strrawkey) + 1))