| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1665 人关注过本帖
标题:求助以下语句翻译
只看楼主 加入收藏
金晋
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-3-10
结帖率:0
收藏
已结贴  问题点数:10 回复次数:1 
求助以下语句翻译
Option Compare Database
Option Explicit
Private Const conKey = "E54fdgedfgvdern7kVSr6ub56uyAV%^&^$^%$$*YUGhj" 'RC4密钥,可以自己更改
Public Function RC4(strInp As String) As String
    Dim s(0 To 255) As Byte, k(0 To 255) As Byte, i As Long
    Dim j As Long, temp As Byte, y As Byte, t As Long, x As Long
    Dim Outp As String

    For i = 0 To 255
        s(i) = i
    Next

    j = 1
    For i = 0 To 255
        If j > Len(conKey) Then j = 1
        k(i) = Asc(Mid(conKey, j, 1))
        j = j + 1
    Next i

    j = 0
    For i = 0 To 255
        j = (j + s(i) + k(i)) Mod 256
        temp = s(i)
        s(i) = s(j)
        s(j) = temp
    Next i

    i = 0
    j = 0
    For x = 1 To Len(strInp)
        i = (i + 1) Mod 256
        j = (j + s(i)) Mod 256
        temp = s(i)
        s(i) = s(j)
        s(j) = temp
        t = (s(i) + (s(j) Mod 256)) Mod 256
        y = s(t)

        Outp = Outp & ChrW(AscW(Mid(strInp, x, 1)) Xor y)
    Next
    RC4 = Outp
End Function
2016-03-10 09:39
HVB6
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:15
帖 子:331
专家分:561
注 册:2013-10-30
收藏
得分:10 
请运行以下代码,就知道您提供的代码,是加密字符串的:
Option Explicit
Private Const conKey = "E54fdgedfgvdern7kVSr6ub56uyAV%^&^$^%$$*YUGhj" 'RC4密钥,可以自己更改
Private Sub Command1_Click()
   Dim s As String
   s = "123asd"
   s = RC4(s)
   MsgBox s
End Sub
Public Function RC4(strInp As String) As String
    Dim s(0 To 255) As Byte, k(0 To 255) As Byte, i As Long
    Dim j As Long, temp As Byte, y As Byte, t As Long, x As Long
    Dim Outp As String

    For i = 0 To 255
        s(i) = i
    Next

    j = 1
    For i = 0 To 255
        If j > Len(conKey) Then j = 1
        k(i) = Asc(Mid(conKey, j, 1))
        j = j + 1
    Next i

    j = 0
    For i = 0 To 255
        j = (j + s(i) + k(i)) Mod 256
        temp = s(i)
        s(i) = s(j)
        s(j) = temp
    Next i

    i = 0
    j = 0
    For x = 1 To Len(strInp)
        i = (i + 1) Mod 256
        j = (j + s(i)) Mod 256
        temp = s(i)
        s(i) = s(j)
        s(j) = temp
        t = (s(i) + (s(j) Mod 256)) Mod 256
        y = s(t)

        Outp = Outp & ChrW(AscW(Mid(strInp, x, 1)) Xor y)
    Next
    RC4 = Outp
End Function

2016-03-10 11:49
快速回复:求助以下语句翻译
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023984 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved