0
Public Shared Function DESEncrypt(ByVal Data As String, ByVal Key As String) As Byte()
Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}
Try
Dim bykey() As Byte = System.Text.Encoding.UTF8.GetBytes(Left(Key, 8))
Dim InputByteArray() As Byte = System.Text.Encoding.UTF8.GetBytes(Data)
Dim des As New DESCryptoServiceProvider
Dim ms As New MemoryStream
Dim cs As New CryptoStream(ms, des.CreateEncryptor(bykey, IV), CryptoStreamMode.Write)
cs.Write(InputByteArray, 0, InputByteArray.Length)
cs.FlushFinalBlock()
Return ms.ToArray()
Catch ex As Exception
End Try
End Function
這是我現在有我的DES加密,但我是相當新的VB.Net我可以計算出如何使其使用三重DES而不是DESVB.Net DES加密功能,三重DES
當我去隱窩我的文件,它說:「值不能爲空參數名:inArray」 – Epicblood 2012-03-14 05:11:23
現在就來試試,剛剛更新的代碼,看看如果你通過正確的數據。還TripleDES鍵必須是24長度不是8. – 2012-03-14 05:42:34
好吧,我會嘗試當我回家 – Epicblood 2012-03-14 14:53:33