A total of 4 pages: form.asp; chk.asp; num.asp; count.asp
Get an additional number. encryption!
Decoupted into XBM picture
Use session judgment
Form.asp
<%
'### TO Encrypt / Decrypt Include this Code in Your Page
'### strmyencryptedstring = encryptstring (strstring)
'### strmyDecryptedString = decryptstring (strmyencryptedstring)
'#### area free to use this code as long as credits recain 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) '##### kY bitsize
INTOFFSET = ROUND ((RND * 1000000) 1000000) '##### Keyoffset Bitsize
IF isnull (strstring) = false kil
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 area not removed ###
'######################################################## ###################
Dim Strraw, Arhexcharset, I, Intkey, Intoffset, Strrawkey, StrHexcrypdata
Strrawkey = Right (StrcryptString, Len (StrcryptString) - INSTR (StrcryptString, "|"))
INTOFFSET = Right (Strrawkey, Len (Strawkey) - INSTR (Strrawkey, "|"))
INTKEY = HEXCONV (LEFT (Strrawkey, INSTR (Strrawkey, "|") - 1) - HEXCONV (INTOFFSET)
StrHexcrypdata = Left (strcryptstring, len (strrawkey) 1)))
Arhexcharset = split (strhexcrypdata, hex (intKey))
For i = 0 to ubound (arhexcharset)
Strraw = strraw & chr (HEXCONV (Arhexcharset (i)) / intKey)
NEXT
DecryptString = Strraw
END FUNCTION
Private function hexconv (HEXVAR)
DIM HXX, HXX_VAR, Multiply
IF Hexvar <> "" ""
HEXVAR = ucase (HEXVAR)
HEXVAR = Strreverse (HEXVAR)
DIM HX ()
Redim HX (Len (HEXVAR))
HXX = 0
HXX_VAR = 0
For hxx = 1 to len (HEXVAR)
If MULTIPLY = "" "Multiply = 1
HX (HXX) = MID (HEXVAR, HXX, 1)
HXX_VAR = (GET_HXNO (HX (HXX)) * Multiply) HXX_VAR
Multiply = (Multiply * 16)
NEXT
HEXVAR = HXX_VAR
HEXCONV = HEXVAR
END IF
END FUNCTION
Private function get_hxno (ghx)
IF ghx = "a" THEN
GHX = 10
Elseif ghx = "b" THEN
GHX = 11
Elseif ghx = "c" then
GHX = 12
Elseif GHX = "D" THEN
GHX = 13
Elseif GHX = "e" belove = 14
Elseif GHX = "f" THEN
GHX = 15
END IF
GET_HXNO = GHX
END FUNCTION
%>
<%
Randomize
Num = int (7999 * RND 2000) 'Counter value
Num2 = encryptstring (num)
Session ("PWDT") = NUM
%>