2 y369595 y369595 于 2013.07.27 12:04 提问

已知VB编写的加密算法,求破对应解密算法!

求大神编写对应的解密算法!跪谢!

Dim Psw As String
Dim Key As String

Psw = Trim(Text1.Text)
Key = StrReverse(Psw)
Key = Key & Left(Key, 1) & Right(Key, 1)
Key = Key & Key & Key

Dim Val As String
Dim Idx1 As Integer
Dim Idx2 As Integer

Dim W1 As Integer
Dim W2 As Integer

W1 = Len(Key)
W2 = Len(Psw)

Idx1 = 1
Val = Psw
Do While Idx1 <= W1
    Psw = Val
    Val = ""
    Idx2 = 1
    Do While Idx2 <= W2 And Idx1 <= W1
        Dim Chr1 As String * 1
        Dim Chr2 As String * 1
        Chr1 = Mid(Key, Idx1, 1)
        Chr2 = Mid(Psw, Idx2, 1)
        Dim Char As String * 1
        Dim Ascii As Integer
        Ascii = Asc(Chr1) + Asc(Chr2)
        If Ascii > 127 Then
            Ascii = Ascii - 127
        End If
        If Ascii < 32 Then
            Ascii = Ascii + 32
        End If
        Char = Chr(Ascii)
        Val = Val + Char
        Idx1 = Idx1 + 1
        Idx2 = Idx2 + 1

    Loop
Loop

Text2.Text = Val + Right(Psw, Abs(Len(Psw) - Len(Val)))
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!