Comment décrypter une chaîne cryptée avec HMACSHA1?

Je suis un chiffrement novice en essayant de transmettre certaines valeurs et en arrière entre les systèmes. Je peux chiffrer la valeur, mais n'arrive pas à comprendre comment les décrypter à l'autre extrémité. J'ai créé une application Windows Forms simple à l'aide de VB.NET. En essayant d'entrée d'une valeur et d'une clé, crypter et décrypter pour obtenir la valeur d'origine. Voici mon code jusqu'à présent. Toute aide grandement appréciée. Merci.

Imports System
Imports System.IO
Imports System.Security.Cryptography
Imports System.Text

Public Class Form1

    Private Sub btnEncode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEncode.Click
        Dim hmacsha1 As New HMACSHA1(Encoding.ASCII.GetBytes(txtKey.Text))
        Dim hashValue As Byte() = hmacsha1.ComputeHash(Encoding.ASCII.GetBytes(txtValue.Text))
        txtResult.Text = BytesToHexString(hashValue)
        hmacsha1.Clear()
    End Sub

    Private Sub btnDecode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDecode.Click
        '???
    End Sub

    Private Function BytesToHexString(ByVal bytes As Byte()) As String
        Dim output As String = String.Empty
        Dim i As Integer = 0
        Do While i < bytes.Length
            output += bytes(i).ToString("X2")
            i += 1
        Loop
        Return output
    End Function
End Class

OriginalL'auteur | 2010-03-12