⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 encryption.bas

📁 VB实现的注册码发生器
💻 BAS
📖 第 1 页 / 共 2 页
字号:
    EnigmaEncrypt = strOutput
    strMessage = ""
    strOutput = ""
End Function


Private Function EncryptRotateWheels()
    Dim k As Integer, strTempHold As String
    strTempHold = Wheel1(1)
    For k = 1 To (iTotalChar - 1) Step 1
        Wheel1(k) = Wheel1(k + 1)
    Next
    Wheel1(iTotalChar) = strTempHold
    strTempHold = Wheel2(iTotalChar)
    For k = iTotalChar To 2 Step -1
        Wheel2(k) = Wheel2(k - 1)
    Next
    Wheel2(1) = strTempHold
    strTempHold = Wheel3(1)
    For k = 1 To (iTotalChar - 1) Step 1
        Wheel3(k) = Wheel3(k + 1)
    Next
    Wheel3(iTotalChar) = strTempHold
    strTempHold = Wheel4(iTotalChar)
    For k = iTotalChar To 2 Step -1
        Wheel4(k) = Wheel4(k - 1)
    Next
    Wheel4(1) = strTempHold
    strTempHold = Wheel5(1)
    For k = 1 To (iTotalChar - 1) Step 1
        Wheel5(k) = Wheel5(k + 1)
    Next
    Wheel5(iTotalChar) = strTempHold
    strTempHold = Wheel6(iTotalChar)
    For k = iTotalChar To 2 Step -1
        Wheel6(k) = Wheel6(k - 1)
    Next
    Wheel6(1) = strTempHold
    strTempHold = Wheel7(1)
    For k = 1 To (iTotalChar - 1) Step 1
        Wheel7(k) = Wheel7(k + 1)
    Next
    Wheel7(iTotalChar) = strTempHold
    strTempHold = Wheel8(iTotalChar)
    For k = iTotalChar To 2 Step -1
        Wheel8(k) = Wheel8(k - 1)
    Next
    Wheel8(1) = strTempHold
    strTempHold = Wheel9(1)
    For k = 1 To (iTotalChar - 1) Step 1
        Wheel9(k) = Wheel9(k + 1)
    Next
    Wheel9(iTotalChar) = strTempHold
    strTempHold = Wheel10(iTotalChar)
    For k = iTotalChar To 2 Step -1
        Wheel10(k) = Wheel10(k - 1)
    Next
    Wheel10(1) = strTempHold
End Function


Private Sub GenerateRandomWheels()
    Dim i As Integer, j As Integer, bDupe As Boolean
    Randomize

    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel2(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel2(j) = "" Then
                        bDupe = False
                        Wheel2(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel3(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel3(j) = "" Then
                        bDupe = False
                        Wheel3(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel4(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel4(j) = "" Then
                        bDupe = False
                        Wheel4(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel5(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel5(j) = "" Then
                        bDupe = False
                        Wheel5(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel6(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel6(j) = "" Then
                        bDupe = False
                        Wheel6(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel7(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel7(j) = "" Then
                        bDupe = False
                        Wheel7(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel8(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel8(j) = "" Then
                        bDupe = False
                        Wheel8(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel9(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel9(j) = "" Then
                        bDupe = False
                        Wheel9(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        bDupe = True
        While bDupe = True
            MyValue = Int((iTotalChar * Rnd) + 1)
            For j = 1 To i Step 1
                If Wheel10(j) = MyValue Then
                    bDupe = True
                    Exit For
                Else
                    If Wheel10(j) = "" Then
                        bDupe = False
                        Wheel10(j) = MyValue
                    End If
                End If
            Next
        Wend
    Next
    For i = 1 To iTotalChar Step 1
        Wheel2String = Wheel2String & CStr(Wheel1(Wheel2(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel3String = Wheel3String & CStr(Wheel1(Wheel3(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel4String = Wheel4String & CStr(Wheel1(Wheel4(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel5String = Wheel5String & CStr(Wheel1(Wheel5(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel6String = Wheel6String & CStr(Wheel1(Wheel6(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel7String = Wheel7String & CStr(Wheel1(Wheel7(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel8String = Wheel8String & CStr(Wheel1(Wheel8(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel9String = Wheel9String & CStr(Wheel1(Wheel9(i)))
    Next
    For i = 1 To iTotalChar Step 1
        Wheel10String = Wheel10String & CStr(Wheel1(Wheel10(i)))
    Next
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -