y369595 2013-07-27 04:04
浏览 1137

已知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)))
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 聚类分析或者python进行数据分析
    • ¥15 如何用visual studio code实现html页面
    • ¥15 逻辑谓词和消解原理的运用
    • ¥15 三菱伺服电机按启动按钮有使能但不动作
    • ¥15 js,页面2返回页面1时定位进入的设备
    • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?