2012-05-27 82 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