如何加密字符串

时间:2012-05-27 10:25:59

标签: .net vb.net string encryption

Parameters.ReferencedAssemblies.Add("System.dll")
Parameters.ReferencedAssemblies.Add("System.Data.dll")
Parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll")

是一种在add()值中加密“systems.dll”的方法吗?

类似Add(Char64 + char45 + ...)或任何方法???

    Dim Version = New Dictionary(Of String, String)
    Version.Add("CompilerVersion", "v2.0")

    Dim ICO As String = IO.Path.GetTempPath & "\iCompiler.ico"

    If Icon <> "" Then
        IO.File.Copy(Icon, ICO)
        Parameters.CompilerOptions &= " /win32icon:" & ICO
    End If

    cResults = Compiler.CompileAssemblyFromSource(Parameters, Source)

    If cResults.Errors.Count > 0 Then
        For Each CompilerError In cResults.Errors
            MessageBox.Show("Error: " & CompilerError.ErrorText, "", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Next
    ElseIf cResults.Errors.Count = 0 Then

    End If
    If Icon <> "" Then : IO.File.Delete(ICO) : End If
End Sub

1 个答案:

答案 0 :(得分:0)

您可以使用简单的XOR逻辑加密来获取字符串,并一次获取一个字符,使用密钥对其进行异或。输出将是加密字符。对字符串中的所有字符执行此操作。

XOR运算符是'^'

要获取原始字符串,请使用相同的密钥和带加密字符的XOR,以获取原始字符。

Google XOR加密以获取更多信息。

相关问题