Master Program Three
My call method <script language = "JavaScript" src = "/verify/num. asp"> </SCRIPT>
Verification Method if trim (loginnum) <> trim (Session ("loginnum") then
Response. Write error ("Verification code error! ")
Response. End
End if
Num. 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? 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, effecffset
Randomize Timer
Intkey = round (RND * 1000000) + 1000000) '##### key bitsize
Effecffset = 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 (effecffset + intkey) & "|" & hex (effecffset)
Else
Encryptstring = ""
End if
End Function
Private function decryptstring (strcryptstring)
'####################################### #############################
'### Crypt function? 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, effecffset, strrawkey, strhexcrypdata
Strrawkey = right (strcryptstring, Len (strcryptstring)-instr (strcryptstring, "| "))
Export ffset = right (strrawkey, Len (strrawkey)-instr (strrawkey, "| "))
Intkey = hexconv (left (strrawkey, instr (strrawkey, "|")-1)-hexconv (effecffset)
Strhexcrypdata = left (strcryptstring, Len (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 (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" then
Ghx = 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 ("loginnum") = num
%>
Document. Write (" '> ")' indicates the path of the image to be called.
Count. asp