2012-05-27 78 views
-2
Parameters.ReferencedAssemblies.Add("System.dll") 
Parameters.ReferencedAssemblies.Add("System.Data.dll") 
Parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll") 

是一种加密add()值中的“systems.dll”的方法吗?如何加密字符串

像添加(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

将字符串转换为字节并加密字节。 – CodesInChaos

+0

@CodeInChaos确定编码。使用System.Text.Encoding.XXX提取字节,然后加密 –

回答

0

您可以使用一个简单的XOR逻辑加密,您可以在该字符串处取一个字符,并将其与一个键异或。输出将是加密的字符。对字符串中的所有字符执行此操作。

XOR运算符是“^”

要获得初始字符串,使用相同的密钥和异或与加密字符,以获得原始字符。

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

+0

我不会称之为加密,而只是模糊处理,除非密钥是流密码的输出(假定正确使用IV)或一次性填充。现在Vinere和凯撒完全被打破了。 – CodesInChaos

+0

很好,特别是硬编码的关键是易受频率嗅探。我只是需要一些非常基本的东西。 – arijeet