asp加密解密求解决求大神来啊。。。 1

这是解密的执行代码,

    解密以后页面显示空白。
 a = "6-66-85-21-69-4-87-82-65-3-75-74-64-"


==================================================================================
<%
Function EnCodeY(sText)
Dim arrCode()
Dim sCode
sCode = Request.Cookies("ddd")("Qmxanman")

arrData = split(sText, CHR(-24151))

cntData = UBOUND(arrData) - 1
cntCode = Len(sCode) - 1

Redim arrCode(cntCode)

For i = 0  To cntCode
arrCode(i) = Mid(sCode, i + 1, 1)
Next

flag = 0
strResult = ""
For i = 0 To cntData
strResult = strResult & CHR(Cint(arrData(i)) XOR ASC(arrCode(flag)))
IF flag = cntCode Then
flag = 0
Else
flag = flag + 1
End IF
Next

EnCodeY = strResult
End Function

a = "6-66-85-21-69-4-87-82-65-3-75-74-64-"
response.write EnCodeY(a)&"<br>"

%>
==================================================================================

3个回答

arrData = split(sText, CHR(-24151))

你的字符串分隔符是-,CHR(-24151)这个又不是-
==>arrData = split(sText, "-")

cntData = UBOUND(arrData) - 1
这个cntData就是-1了,你的For i = 0 To cntData这个循环就没有执行,那么不就返回空值了。
sCode = Request.Cookies("ddd")("Qmxanman")还有你的这个变量有值没用。。自己response.write输出看内容

改下面测试可以了,自己注意sCode

  Function EnCodeY(sText)
Dim arrCode()
Dim sCode
sCode = "123"'''''测试直接设置为1,自己注意这里cookie的值是否有
'sCode = Request.Cookies("ddd")("Qmxanman")'''''''''''''''''''''''''

arrData = split(sText, "-")'''''''''''''''''''''''''''''

cntData = UBOUND(arrData) - 1
cntCode = Len(sCode) - 1

Redim arrCode(cntCode)

For i = 0  To cntCode
arrCode(i) = Mid(sCode, i + 1, 1)
Next

flag = 0
strResult = ""
For i = 0 To cntData
strResult = strResult & CHR(Cint(arrData(i)) XOR ASC(arrCode(flag)))
IF flag = cntCode Then
flag = 0
Else
flag = flag + 1
End IF
Next

EnCodeY = strResult
End Function

a = "6-66-85-21-69-4-87-82-65-3-75-74-64-"
response.write EnCodeY(a)&"<br>"'===>输出7pf$w7f`r2yyq
qq_36257233
qq_36257233 回复showbo: 你看下,我下面这段怎么弄/??
2 年多之前 回复
showbo
支付宝加好友偷能量挖 回复qq_36257233: 我哪知道你scode是什么内容
2 年多之前 回复
qq_36257233
qq_36257233 大哥,我想要的这个解密以后应该是一串有用的数字。可是是乱码啊。
2 年多之前 回复
qq_36257233
qq_36257233 scode后面的"Qmxanman"这个值应该加上的
2 年多之前 回复
    Function EnxCodeX(sText)
            Dim arrxData()
            Dim arrxCode()

            cntData = Len(sText) - 1
            cntCode = Len(HhaCode) - 1

            Redim arrxData(cntData)
            Redim arrxCode(cntCode)

            For i = 0  To cntData
                arrxData(i) = Mid(sText, i + 1, 1)
            Next

            For i = 0  To cntCode
                arrxCode(i) = Mid(HhaCode, i + 1, 1)
            Next

            flag = 0
            strResult = ""
            For i = 0 To cntData
                strResult = strResult & ((ASC(arrxData(i)) XOR ASC(arrxCode(flag)))) & CHR(-24151)
                IF flag = cntCode Then
                    flag = 0
                Else
                    flag = flag + 1
                End IF
            Next
            EnxCodeX = strResult
        End Function
    if hamgu = "1" then
    '## -----------------------------##
    Set ZSO = Server.CreateObject("prjZ351.Z351")
        telNo = ZSO.goZ351(telNo, "x") & ""
    Set ZSO = Nothing
    '## -----------------------------##
    elseif hamgu = "2" then
        telNo       = EnxCodeX(telNo)
    elseif hamgu = "3" then
        telNo       = EnxCodeX(telNo)
    end if

    你看下这段怎么破?

<%
Function EnxCodeX(sText)
Dim arrxData()
Dim arrxCode()

    cntData = Len(sText) - 1
    cntCode = Len(HhaCode) - 1

    Redim arrxData(cntData)
    Redim arrxCode(cntCode)

    For enxI = 0  To cntData
        arrxData(enxI) = Mid(sText, enxI + 1, 1)
    Next

    For enxI = 0  To cntCode
        arrxCode(enxI) = Mid(HhaCode, enxI + 1, 1)
    Next

    flag = 0
    strResult = ""
    For enxI = 0 To cntData
        strResult = strResult & ((ASC(arrxData(enxI)) XOR ASC(arrxCode(flag)))) & CHR("-")
        IF flag = cntCode Then
            flag = 0
        Else
            flag = flag + 1
        End IF
    Next
    EnxCodeX = strResult
End Function

a="68-4-70-31-11-88-67-7-26-8-85-92-72-"
response.write EnxCodeX(a)&"<br>"

%>

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问