问题描述
- 已知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)))
时间: 2024-11-29 16:28:57