A total of 4 pages: form.asp; chk.asp; num.asp; count.asp Get an additional number. encryption! Into a decrypted image using the session is determined to XBM form.asp <% '### To encrypt / decrypt include this code in your page' ### strMyEncryptedString = EncryptString (strString) '### strMyDecryptedString = DeCryptString (strMyEncryptedString)' # ###### ###################################################################
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)' #### kYoffset Bitsize
IF isnull (strstring) = false dam = strstring tenttinglen = len (strraw)
For i = 0 to IntStringlen - 1 strTemp = Left (Strraw, 1) Strraw = Right (Strraw, Len (Straw) - 1) Charhexset = Charhexset & HEX (ASC (strTemp) * Intkey) & hex (intKey) Next
EncryptString = CharhexSTSTRING = 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 the isy 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 (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 <> "" THEN 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 = "" Then Multiply = 1 HX (HXX) = MID (Hexvar, HXX, 1) HXX_VAR = (GET_HXNO (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" the ghx = 12 elseif ghx = "d" ghx = 13 elseif ghx = " E "Then GHX = 14 elseif ghx =" f "Then GHX = 15 end if get_hxno = ghx end function%> <% randomize num = int (7999 * rND 2000) 'counter Num2 = EncryptString (NUM) session "PWDT") = Num%>