当前位置: 移动技术网 > IT编程>开发语言>.net > ASP 验证码的程序及原理

ASP 验证码的程序及原理

2018年10月19日  | 移动技术网IT编程  | 我要评论

黑镜第四季下载,昆仑决直播,南昌保利高尔夫花园

一共4个页面:form.; 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 ###
####################################################################

    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))

    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(

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网