<div style="font-family: Arial, sans-serif; font-size: 14px;"><span>Hi,</span><div><br></div><div><span>Hereby the code to decrypt 8 rounds of SHA-256 deterministically.</span></div><div><span>An original input message length up to 447 bits (single block) is supported.</span></div><div><br></div><div><span>The same method can be applied to SHA-512.</span></div><div><br></div><div><br></div><div><span>Apologies for the <a target="_blank" rel="noreferrer nofollow noopener" href="http://VB.NET">VB.NET</a> code.</span></div><div><br></div><div><br></div><div><span>Sincerely,</span></div><div><br></div><div><span>8ff3f7366e32be1bd139acd9146ebab6a150fe7e65de72a8f4910b0769c72d48</span></div><div><br></div><div><br></div><div><br></div><div><span>Option Explicit On</span></div><div><span>Option Strict On</span></div><div><br></div><div><span>Public Class Sha256</span></div><div><br></div><div><span>    Private Const forceOperationInt64 As Int64 = 0</span></div><div><span>    Private Const forceOperationUInt64 As UInt64 = 0</span></div><div><br></div><div><span>    ' for debugging</span></div><div><span>    Private ReadOnly rounds As Integer = 8</span></div><div><br></div><div><br></div><div><br></div><div><span>    ' algoRithm constants</span></div><div><br></div><div><span>    Private ReadOnly k As UInt32() = New UInt32() {</span></div><div><span>        &H428A2F98UI, &H71374491UI, &HB5C0FBCFUI, &HE9B5DBA5UI, &H3956C25BUI, &H59F111F1UI, &H923F82A4UI, &HAB1C5ED5UI,</span></div><div><span>        &HD807AA98UI, &H12835B01UI, &H243185BEUI, &H550C7DC3UI, &H72BE5D74UI, &H80DEB1FEUI, &H9BDC06A7UI, &HC19BF174UI,</span></div><div><span>        &HE49B69C1UI, &HEFBE4786UI, &HFC19DC6UI, &H240CA1CCUI, &H2DE92C6FUI, &H4A7484AAUI, &H5CB0A9DCUI, &H76F988DAUI,</span></div><div><span>        &H983E5152UI, &HA831C66DUI, &HB00327C8UI, &HBF597FC7UI, &HC6E00BF3UI, &HD5A79147UI, &H6CA6351UI, &H14292967UI,</span></div><div><span>        &H27B70A85UI, &H2E1B2138UI, &H4D2C6DFCUI, &H53380D13UI, &H650A7354UI, &H766A0ABBUI, &H81C2C92EUI, &H92722C85UI,</span></div><div><span>        &HA2BFE8A1UI, &HA81A664BUI, &HC24B8B70UI, &HC76C51A3UI, &HD192E819UI, &HD6990624UI, &HF40E3585UI, &H106AA070UI,</span></div><div><span>        &H19A4C116UI, &H1E376C08UI, &H2748774CUI, &H34B0BCB5UI, &H391C0CB3UI, &H4ED8AA4AUI, &H5B9CCA4FUI, &H682E6FF3UI,</span></div><div><span>        &H748F82EEUI, &H78A5636FUI, &H84C87814UI, &H8CC70208UI, &H90BEFFFAUI, &HA4506CEBUI, &HBEF9A3F7UI, &HC67178F2UI</span></div><div><span>    }</span></div><div><br></div><div><span>    Private ReadOnly initHash As UInt32() = New UInt32() {</span></div><div><span>        &H6A09E667UI, &HBB67AE85UI, &H3C6EF372UI, &HA54FF53AUI, &H510E527FUI, &H9B05688CUI, &H1F83D9ABUI, &H5BE0CD19UI</span></div><div><span>    }</span></div><div><br></div><div><br></div><div><span>    Private Function RightRotate(value As UInt32, bits As Byte) As UInt32</span></div><div><span>        Return (value >> bits) Or (value << (32 - bits))</span></div><div><span>    End Function</span></div><div><br></div><div><br></div><div><span>    Public Function Encrypt(value As String,</span></div><div><span>                            ByRef debugWords As UInt32()(),</span></div><div><span>                            ByRef debugVariables As UInt32()(,)</span></div><div><span>                            ) As String</span></div><div><br></div><div><span>        Dim resultHexString As String</span></div><div><br></div><div><span>        resultHexString = Nothing</span></div><div><span>        Me.Encrypt(System.Text.Encoding.UTF8.GetBytes(value), resultHexString, debugWords, debugVariables)</span></div><div><br></div><div><span>        Return resultHexString</span></div><div><br></div><div><span>    End Function</span></div><div><br></div><div><span>    Public Function Encrypt(value As Byte(),</span></div><div><span>                            ByRef resultHexString As String,</span></div><div><span>                            ByRef debugWords As UInt32()(),</span></div><div><span>                            ByRef debugVariables As UInt32()(,)</span></div><div><span>                            ) As Byte()</span></div><div><br></div><div><span>        Dim resultBytes(31) As Byte</span></div><div><br></div><div><span>        Dim messageLength As UInt64</span></div><div><span>        Dim messageLengthBytes() As Byte ' 8 bytes</span></div><div><br></div><div><span>        Dim i As Integer</span></div><div><span>        Dim wordBytes(3) As Byte</span></div><div><br></div><div><span>        Dim currentWords(63) As UInt32</span></div><div><span>        Dim currentWord As Integer</span></div><div><span>        Dim remainingBytes As Integer</span></div><div><br></div><div><span>        Dim currentHash() As UInt32 ' 8 unsigned integers</span></div><div><br></div><div><span>        ' for dEbugging</span></div><div><span>        Dim blockCount As Integer</span></div><div><span>        Dim currentBlock As Integer</span></div><div><span>        Dim words()() As UInt32</span></div><div><span>        Dim variables()(,) As UInt32</span></div><div><br></div><div><span>        ' for debugging</span></div><div><span>        ' one additional byte for the extra bit 1, and 8 additional bytes for the MEssage length</span></div><div><span>        blockCount = CType(Math.Ceiling((value.Length + 1 + 8) / 64), Integer)</span></div><div><span>        ReDim words(blockCount - 1)</span></div><div><span>        ReDim variables(blockCount - 1)</span></div><div><span>        currentBlock = 0</span></div><div><br></div><div><br></div><div><span>        remainingBytes = value.Length Mod 4</span></div><div><br></div><div><span>        currentHash = Me.initHash</span></div><div><br></div><div><span>        currentWord = 0</span></div><div><span>        For i = 0 To value.Length - remainingBytes - 1 Step 4</span></div><div><span>            If BitConverter.IsLittleEndian Then</span></div><div><span>                wordBytes(0) = value(i + 3)</span></div><div><span>                wordBytes(1) = value(i + 2)</span></div><div><span>                wordBytes(2) = value(i + 1)</span></div><div><span>                wordBytes(3) = value(i)</span></div><div><span>            Else</span></div><div><span>                wordBytes(0) = value(i)</span></div><div><span>                wordBytes(1) = value(i + 1)</span></div><div><span>                wordBytes(2) = value(i + 2)</span></div><div><span>                wordBytes(3) = value(i + 3)</span></div><div><span>            End If</span></div><div><br></div><div><span>            currentWords(currentWord) = BitConverter.ToUInt32(wordBytes, 0)</span></div><div><br></div><div><span>            If currentWord = 15 Then</span></div><div><span>                ' BLOCK READY</span></div><div><br></div><div><span>                ' calculate derived words and compress</span></div><div><span>                Me.AddDerivedWords(currentWords)</span></div><div><span>                ' for debugging: pass debug variables</span></div><div><span>                currentHash = Me.Encrypt(currentHash, currentWords, variables(currentBlock))</span></div><div><br></div><div><span>                ' for debugging</span></div><div><span>                ' clone array, otherwise all word arrays in 'words' will refer to the saMe array ('currentWords')</span></div><div><span>                words(currentBlock) = DirectCast(currentWords.Clone, UInt32())</span></div><div><span>                currentBlock += 1</span></div><div><br></div><div><span>                ' then reset word array</span></div><div><span>                currentWord = 0</span></div><div><br></div><div><span>            Else</span></div><div><span>                currentWord += 1</span></div><div><span>            End If</span></div><div><br></div><div><span>        Next</span></div><div><br></div><div><span>        ' last word (remaining BytEs + addition bit 1)</span></div><div><span>        If BitConverter.IsLittleEndian Then</span></div><div><span>            ' Remaining bytes</span></div><div><span>            For i = 0 To remainingBytes - 1</span></div><div><span>                wordBytes(3 - i) = value(value.Length - remainingBytes + i)</span></div><div><span>            Next</span></div><div><span>            ' addition bit 1</span></div><div><span>            wordBytes(3 - remainingBytes) = &H80</span></div><div><br></div><div><span>            ' reset unused bytes</span></div><div><span>            For i = remainingBytes + 1 To 3</span></div><div><span>                wordBytes(3 - i) = 0</span></div><div><span>            Next</span></div><div><span>        Else</span></div><div><span>            ' remaining bytes</span></div><div><span>            For i = 0 To remainingBytes - 1</span></div><div><span>                wordBytes(i) = value(value.Length - remainingBytes + i)</span></div><div><span>            Next</span></div><div><span>            ' addition bit 1</span></div><div><span>            wordBytes(remainingBytes) = &H80</span></div><div><br></div><div><span>            ' reset unused bytes</span></div><div><span>            For i = remainingBytes + 1 To 3</span></div><div><span>                wordBytes(i) = 0</span></div><div><span>            Next</span></div><div><span>        End If</span></div><div><br></div><div><span>        currentWords(currentWord) = BitConverter.ToUInt32(wordBytes, 0)</span></div><div><br></div><div><br></div><div><span>        If currentWord < 14 Then</span></div><div><span>            ' last block</span></div><div><span>            For i = currentWord + 1 To 13</span></div><div><span>                currentWords(i) = 0</span></div><div><span>            Next</span></div><div><br></div><div><span>        Else</span></div><div><span>            ' an extra block is needed for the message length</span></div><div><span>            For i = currentWord + 1 To 15</span></div><div><span>                currentWords(i) = 0</span></div><div><span>            Next</span></div><div><span>            ' BLOCK READY</span></div><div><br></div><div><span>            ' calculate derived words and compress</span></div><div><span>            Me.AddDerivedWords(currentWords)</span></div><div><span>            ' for debugging: pass debug variables</span></div><div><span>            currentHash = Me.Encrypt(currentHash, currentWords, variables(currentBlock))</span></div><div><br></div><div><span>            ' for debugging</span></div><div><span>            ' clone array, otherwise all word arrays in 'words' will refer to the same array ('currentWords')</span></div><div><span>            words(currentBlock) = DirectCast(currentWords.Clone, UInt32())</span></div><div><span>            currentBlock += 1</span></div><div><br></div><div><br></div><div><span>            ' reset word array</span></div><div><span>            For i = 0 To 13</span></div><div><span>                currentWords(i) = 0</span></div><div><span>            Next</span></div><div><br></div><div><span>        End If</span></div><div><br></div><div><span>        ' add message length to last block</span></div><div><span>        messageLength = CType(value.Length * 8, UInt64) ' in bits</span></div><div><span>        messageLengthBytes = BitConverter.GetBytes(messageLength)</span></div><div><br></div><div><span>        If BitConverter.IsLittleEndian Then</span></div><div><span>            currentWords(14) = BitConverter.ToUInt32(messageLengthBytes, 4)</span></div><div><span>            currentWords(15) = BitConverter.ToUInt32(messageLengthBytes, 0)</span></div><div><span>        Else</span></div><div><span>            currentWords(14) = BitConverter.ToUInt32(messageLengthBytes, 0)</span></div><div><span>            currentWords(15) = BitConverter.ToUInt32(messageLengthBytes, 4)</span></div><div><span>        End If</span></div><div><br></div><div><span>        ' BLOCK READY</span></div><div><br></div><div><span>        ' calculate derived words and compress</span></div><div><span>        Me.AddDerivedWords(currentWords)</span></div><div><span>        ' for debugging: pass debug variables</span></div><div><span>        currentHash = Me.Encrypt(currentHash, currentWords, variables(currentBlock))</span></div><div><br></div><div><span>        ' for debugging</span></div><div><span>        ' clone array is not necessary, as it is the last array, </span></div><div><span>        ' and there are no more manipulations with array 'currentWords' hereafter</span></div><div><span>        'words(currentBlock) = DirectCast(currentWords.Clone, UInt32())</span></div><div><span>        words(currentBlock) = currentWords</span></div><div><br></div><div><br></div><div><span>        ' return resulting hash </span></div><div><br></div><div><span>        ' as a byte array (big-endian)</span></div><div><span>        If BitConverter.IsLittleEndian Then</span></div><div><span>            BitConverter.GetBytes(currentHash(0)).Reverse.ToArray.CopyTo(resultBytes, 0)</span></div><div><span>            BitConverter.GetBytes(currentHash(1)).Reverse.ToArray.CopyTo(resultBytes, 4)</span></div><div><span>            BitConverter.GetBytes(currentHash(2)).Reverse.ToArray.CopyTo(resultBytes, 8)</span></div><div><span>            BitConverter.GetBytes(currentHash(3)).Reverse.ToArray.CopyTo(resultBytes, 12)</span></div><div><span>            BitConverter.GetBytes(currentHash(4)).Reverse.ToArray.CopyTo(resultBytes, 16)</span></div><div><span>            BitConverter.GetBytes(currentHash(5)).Reverse.ToArray.CopyTo(resultBytes, 20)</span></div><div><span>            BitConverter.GetBytes(currentHash(6)).Reverse.ToArray.CopyTo(resultBytes, 24)</span></div><div><span>            BitConverter.GetBytes(currentHash(7)).Reverse.ToArray.CopyTo(resultBytes, 28)</span></div><div><br></div><div><span>        Else</span></div><div><span>            BitConverter.GetBytes(currentHash(0)).CopyTo(resultBytes, 0)</span></div><div><span>            BitConverter.GetBytes(currentHash(1)).CopyTo(resultBytes, 4)</span></div><div><span>            BitConverter.GetBytes(currentHash(2)).CopyTo(resultBytes, 8)</span></div><div><span>            BitConverter.GetBytes(currentHash(3)).CopyTo(resultBytes, 12)</span></div><div><span>            BitConverter.GetBytes(currentHash(4)).CopyTo(resultBytes, 16)</span></div><div><span>            BitConverter.GetBytes(currentHash(5)).CopyTo(resultBytes, 20)</span></div><div><span>            BitConverter.GetBytes(currentHash(6)).CopyTo(resultBytes, 24)</span></div><div><span>            BitConverter.GetBytes(currentHash(7)).CopyTo(resultBytes, 28)</span></div><div><span>        End If</span></div><div><br></div><div><span>        ' as a hex string</span></div><div><span>        resultHexString =</span></div><div><span>            currentHash(0).ToString("x8") & currentHash(1).ToString("x8") & currentHash(2).ToString("x8") & currentHash(3).ToString("x8") &</span></div><div><span>            currentHash(4).ToString("x8") & currentHash(5).ToString("x8") & currentHash(6).ToString("x8") & currentHash(7).ToString("x8")</span></div><div><br></div><div><span>        ' for debugging</span></div><div><span>        debugWords = words</span></div><div><span>        debugVariables = variables</span></div><div><br></div><div><span>        Return resultBytes</span></div><div><br></div><div><span>    End Function</span></div><div><br></div><div><span>    Private Sub AddDerivedWords(ByRef words As UInt32())</span></div><div><span>        Dim currentWord As Integer</span></div><div><br></div><div><span>        For currentWord = 16 To 63</span></div><div><br></div><div><span>            words(currentWord) = CType((</span></div><div><span>                    Sha256.forceOperationUInt64 +</span></div><div><span>                    words(currentWord - 16) +</span></div><div><span>                    words(currentWord - 7) +</span></div><div><span>                    (Me.RightRotate(words(currentWord - 15), 7) Xor Me.RightRotate(words(currentWord - 15), 18) Xor (words(currentWord - 15) >> 3)) +</span></div><div><span>                    (Me.RightRotate(words(currentWord - 2), 17) Xor Me.RightRotate(words(currentWord - 2), 19) Xor (words(currentWord - 2) >> 10))</span></div><div><span>                    ) And UInt32.MaxValue, UInt32)</span></div><div><br></div><div><span>        Next</span></div><div><span>    End Sub</span></div><div><br></div><div><br></div><div><span>    Private Function Encrypt(hash As UInt32(),</span></div><div><span>                             words As UInt32(),</span></div><div><span>                             ByRef debugVariables As UInt32(,)) As UInt32()</span></div><div><br></div><div><span>        Dim a, b, c, d, e, f, g, h As UInt32</span></div><div><span>        Dim s1_ch_k_h_w As UInt64</span></div><div><span>        Dim round As Integer</span></div><div><span>        Dim resultHash(7) As UInt32</span></div><div><br></div><div><span>        ' for debugging</span></div><div><span>        Dim variables((Me.rounds + 1) - 1, 7) As UInt32</span></div><div><br></div><div><br></div><div><br></div><div><span>        ' initialize working variables to current hash value</span></div><div><span>        a = hash(0)</span></div><div><span>        b = hash(1)</span></div><div><span>        c = hash(2)</span></div><div><span>        d = hash(3)</span></div><div><span>        e = hash(4)</span></div><div><span>        f = hash(5)</span></div><div><span>        g = hash(6)</span></div><div><span>        h = hash(7)</span></div><div><br></div><div><span>        ' for debugging</span></div><div><span>        variables(0, 0) = a</span></div><div><span>        variables(0, 1) = b</span></div><div><span>        variables(0, 2) = c</span></div><div><span>        variables(0, 3) = d</span></div><div><span>        variables(0, 4) = e</span></div><div><span>        variables(0, 5) = f</span></div><div><span>        variables(0, 6) = g</span></div><div><span>        variables(0, 7) = h</span></div><div><br></div><div><span>        ' compression function main loop</span></div><div><span>        For round = 0 To Me.rounds - 1</span></div><div><span>            s1_ch_k_h_w = Sha256.forceOperationUInt64 +</span></div><div><span>                (Me.RightRotate(e, 6) Xor Me.RightRotate(e, 11) Xor Me.RightRotate(e, 25)) +</span></div><div><span>                ((e And f) Xor ((Not e) And g)) +</span></div><div><span>                Me.k(round) +</span></div><div><span>                h +</span></div><div><span>                words(round)</span></div><div><br></div><div><br></div><div><span>            h = g</span></div><div><span>            g = f</span></div><div><span>            f = e</span></div><div><span>            e = CType((d + s1_ch_k_h_w) And UInt32.MaxValue, UInt32)</span></div><div><span>            d = c</span></div><div><span>            c = b</span></div><div><span>            b = a</span></div><div><span>            a = CType((</span></div><div><span>                s1_ch_k_h_w +</span></div><div><span>                (Me.RightRotate(b, 2) Xor Me.RightRotate(b, 13) Xor Me.RightRotate(b, 22)) +</span></div><div><span>                ((b And c) Xor (b And d) Xor (c And d))</span></div><div><span>                ) And UInt32.MaxValue, UInt32)</span></div><div><br></div><div><span>            ' for debugging</span></div><div><span>            variables(round + 1, 0) = a</span></div><div><span>            variables(round + 1, 1) = b</span></div><div><span>            variables(round + 1, 2) = c</span></div><div><span>            variables(round + 1, 3) = d</span></div><div><span>            variables(round + 1, 4) = e</span></div><div><span>            variables(round + 1, 5) = f</span></div><div><span>            variables(round + 1, 6) = g</span></div><div><span>            variables(round + 1, 7) = h</span></div><div><br></div><div><span>        Next</span></div><div><br></div><div><span>        ' for debugging</span></div><div><span>        debugVariables = variables</span></div><div><br></div><div><span>        resultHash(0) = CType((Sha256.forceOperationUInt64 + hash(0) + a) And UInt32.MaxValue, UInt32)</span></div><div><span>        resultHash(1) = CType((Sha256.forceOperationUInt64 + hash(1) + b) And UInt32.MaxValue, UInt32)</span></div><div><span>        resultHash(2) = CType((Sha256.forceOperationUInt64 + hash(2) + c) And UInt32.MaxValue, UInt32)</span></div><div><span>        resultHash(3) = CType((Sha256.forceOperationUInt64 + hash(3) + d) And UInt32.MaxValue, UInt32)</span></div><div><span>        resultHash(4) = CType((Sha256.forceOperationUInt64 + hash(4) + e) And UInt32.MaxValue, UInt32)</span></div><div><span>        resultHash(5) = CType((Sha256.forceOperationUInt64 + hash(5) + f) And UInt32.MaxValue, UInt32)</span></div><div><span>        resultHash(6) = CType((Sha256.forceOperationUInt64 + hash(6) + g) And UInt32.MaxValue, UInt32)</span></div><div><span>        resultHash(7) = CType((Sha256.forceOperationUInt64 + hash(7) + h) And UInt32.MaxValue, UInt32)</span></div><div><br></div><div><span>        Return resultHash</span></div><div><br></div><div><span>    End Function</span></div><div><br></div><div><br></div><div><br></div><div><br></div><div><span>    Private Function GetVariablesLastRound(refHash As UInt32(), hash As UInt32()) As UInt32()</span></div><div><span>        Dim variables(7) As UInt32</span></div><div><br></div><div><span>        variables(0) = CType((Sha256.forceOperationInt64 + refHash(0) - hash(0)) And UInt32.MaxValue, UInt32)</span></div><div><span>        variables(1) = CType((Sha256.forceOperationInt64 + refHash(1) - hash(1)) And UInt32.MaxValue, UInt32)</span></div><div><span>        variables(2) = CType((Sha256.forceOperationInt64 + refHash(2) - hash(2)) And UInt32.MaxValue, UInt32)</span></div><div><span>        variables(3) = CType((Sha256.forceOperationInt64 + refHash(3) - hash(3)) And UInt32.MaxValue, UInt32)</span></div><div><span>        variables(4) = CType((Sha256.forceOperationInt64 + refHash(4) - hash(4)) And UInt32.MaxValue, UInt32)</span></div><div><span>        variables(5) = CType((Sha256.forceOperationInt64 + refHash(5) - hash(5)) And UInt32.MaxValue, UInt32)</span></div><div><span>        variables(6) = CType((Sha256.forceOperationInt64 + refHash(6) - hash(6)) And UInt32.MaxValue, UInt32)</span></div><div><span>        variables(7) = CType((Sha256.forceOperationInt64 + refHash(7) - hash(7)) And UInt32.MaxValue, UInt32)</span></div><div><br></div><div><span>        Return variables</span></div><div><span>    End Function</span></div><div><br></div><div><span>    Private Sub OutputResult(resultVariables As UInt32(,), resultWords As UInt32(),</span></div><div><span>                             refVariables As UInt32(,), refWords As UInt32(),</span></div><div><span>                             actualVariables As UInt32(,), actualWords As UInt32())</span></div><div><span>        Dim round As Integer</span></div><div><span>        Dim variable As Integer</span></div><div><br></div><div><span>        For round = Me.rounds To 0 Step -1</span></div><div><span>            Debug.Write("------------------------- variables n - " & round)</span></div><div><br></div><div><span>            If round < Me.rounds Then</span></div><div><span>                Debug.WriteLine(" | w = " & actualWords(round).ToString.PadRight(10) & " | w found = " & resultWords(round))</span></div><div><span>            Else</span></div><div><span>                Debug.WriteLine("")</span></div><div><span>            End If</span></div><div><br></div><div><br></div><div><span>            For variable = 0 To 7</span></div><div><span>                Debug.WriteLine(actualVariables(round, variable).ToString.PadRight(10) & " | " &</span></div><div><span>                                refVariables(round, variable).ToString.PadRight(10) & " | " &</span></div><div><span>                                resultVariables(round, variable).ToString.PadRight(10)</span></div><div><span>                                )</span></div><div><span>            Next</span></div><div><span>        Next</span></div><div><span>    End Sub</span></div><div><br></div><div><span>    ''' <summary></span></div><div><span>    ''' Assume only one block in this version</span></div><div><span>    ''' </summary></span></div><div><span>    Friend Function Decrypt(hexValue As String, debugWords()() As UInt32, debugVariables()(,) As UInt32) As String</span></div><div><br></div><div><span>        Dim hash(7) As UInt32</span></div><div><span>        Dim resultWords As UInt32()</span></div><div><span>        Dim resultBytes(63) As Byte</span></div><div><br></div><div><br></div><div><span>        For w = 0 To 7</span></div><div><span>            hash(w) = Convert.ToUInt32(hexValue.Substring(w * 8, 8), 16)</span></div><div><span>        Next</span></div><div><br></div><div><br></div><div><span>        resultWords = Me.Decrypt(hash, debugWords, debugVariables)</span></div><div><br></div><div><br></div><div><span>        If BitConverter.IsLittleEndian Then</span></div><div><span>            For w = 0 To resultWords.Length - 1</span></div><div><span>                BitConverter.GetBytes(resultWords(w)).Reverse.ToArray.CopyTo(resultBytes, w * 4)</span></div><div><span>            Next</span></div><div><span>        Else</span></div><div><span>            For w = 0 To resultWords.Length - 1</span></div><div><span>                BitConverter.GetBytes(resultWords(w)).CopyTo(resultBytes, w * 4)</span></div><div><span>            Next</span></div><div><span>        End If</span></div><div><br></div><div><span>        ' get message length (not supported in this 8 rounds version)</span></div><div><br></div><div><span>        ' reset additional bit (do not use message length in this 8 rounds version)</span></div><div><span>        ' find first non-zero bit (byte)</span></div><div><br></div><div><span>        For b = resultBytes.Length - 1 To 0 Step -1</span></div><div><span>            If resultBytes(b) = &H80 Then</span></div><div><span>                resultBytes(b) = 0</span></div><div><br></div><div><span>                Exit For</span></div><div><span>            End If</span></div><div><br></div><div><span>        Next</span></div><div><br></div><div><span>        Return System.Text.Encoding.UTF8.GetString(resultBytes)</span></div><div><br></div><div><br></div><div><span>    End Function</span></div><div><br></div><div><br></div><div><span>    Private Function Decrypt(hash() As UInt32, debugWords()() As UInt32, debugVariables()(,) As UInt32) As UInt32()</span></div><div><br></div><div><span>        Dim refWords(Me.rounds - 1) As UInt32</span></div><div><span>        Dim refVariables(,) As UInt32</span></div><div><span>        Dim variablesLastRound As UInt32()</span></div><div><span>        Dim resultVariables As UInt32(,)</span></div><div><span>        Dim resultWords As UInt32()</span></div><div><span>        Dim round As Integer</span></div><div><br></div><div><span>        Dim a_ref, b_ref, c_ref, d_ref, e_ref, f_ref, g_ref, h_ref As UInt32</span></div><div><span>        Dim a_res, b_res, c_res, d_res, e_res, f_res, g_res, h_res As UInt32</span></div><div><br></div><div><span>        Dim s0_maj_ref As Int64</span></div><div><span>        Dim s0_maj_res As Int64</span></div><div><br></div><div><span>        Dim diff_s0_maj As Int64</span></div><div><span>        Dim diff_d As Int64</span></div><div><br></div><div><span>        Dim word As UInt32</span></div><div><br></div><div><br></div><div><span>        variablesLastRound = Me.GetVariablesLastRound(hash, Me.initHash)</span></div><div><br></div><div><span>        ' start with empty reference words</span></div><div><br></div><div><br></div><div><span>        ' get reference variables for words passed (words passed are initially empty)</span></div><div><span>        ' (we don't use the resulting hash)</span></div><div><span>        refVariables = Nothing</span></div><div><span>        Me.Encrypt(Me.initHash, refWords, refVariables)</span></div><div><br></div><div><span>        resultVariables = Nothing</span></div><div><span>        resultWords = Nothing</span></div><div><span>        Me.Decrypt(variablesLastRound, refVariables, resultVariables, resultWords)</span></div><div><br></div><div><span>        If debugVariables IsNot Nothing And debugWords IsNot Nothing Then</span></div><div><span>            Me.OutputResult(resultVariables, resultWords, refVariables, refWords, debugVariables(0), debugWords(0))</span></div><div><span>        End If</span></div><div><br></div><div><br></div><div><span>        ' resulting round 0 variables e, f, g, h should match actual round 0 variables (initial hash)</span></div><div><br></div><div><span>        ' we can now check whether resulting w1 is correct:</span></div><div><br></div><div><span>        ' 1) resulting w1 is incorrect when resulting d0 doesn't match actual d0 (initial hash) because:</span></div><div><br></div><div><span>        ' e1 = d0 + fx(e0, f0, g0) + k1 + h0 + w1</span></div><div><br></div><div><span>        ' --> h0 resolves to correct (initial hash) value, so we can leave h0 out of the equation</span></div><div><span>        ' --> e0, f0, g0 resolve to correct (initial hash) values, so we can leave fx(e0, f0, g0) out of the equation</span></div><div><span>        ' --> d0 doesn't resolve to correct (initial hash) value, so we have to take into account the difference</span></div><div><span>        '     of resulting d0 and actual d0 to adjust resulting w1 </span></div><div><br></div><div><span>        ' 2) resulting w1 is incorrect when resulting fx(a0, b0, c0) doesn't match actual fx(a0, b0, c0) because:</span></div><div><br></div><div><span>        ' a1 = fx(e0, f0, g0) + k1 + h0 + w1 + fx(a0, b0, c0)</span></div><div><br></div><div><span>        ' --> h0 resolves to correct (initial hash) value, so we can leave h0 out of the equation</span></div><div><span>        ' --> e0, f0, g0 resolve to correct (initial hash) values, so we can leave fx(e0, f0, g0) out of the equation</span></div><div><span>        ' --> fx(a0, b0, c0) doesn't resolve to correct value, so we have to take into account the difference</span></div><div><span>        '     of resulting fx(a0, b0, c0) and actual fx(a0, b0, c0) to adjust resulting w1 </span></div><div><br></div><div><br></div><div><br></div><div><span>        ' adjust reference words (and reference variables as a result)</span></div><div><br></div><div><span>        For round = 0 To Me.rounds - 1 - 4</span></div><div><br></div><div><span>            a_ref = refVariables(round, 0)</span></div><div><span>            b_ref = refVariables(round, 1)</span></div><div><span>            c_ref = refVariables(round, 2)</span></div><div><span>            d_ref = refVariables(round, 3)</span></div><div><span>            e_ref = refVariables(round, 4)</span></div><div><span>            f_ref = refVariables(round, 5)</span></div><div><span>            g_ref = refVariables(round, 6)</span></div><div><span>            h_ref = refVariables(round, 7)</span></div><div><br></div><div><span>            a_res = resultVariables(round, 0)</span></div><div><span>            b_res = resultVariables(round, 1)</span></div><div><span>            c_res = resultVariables(round, 2)</span></div><div><span>            d_res = resultVariables(round, 3)</span></div><div><span>            e_res = resultVariables(round, 4)</span></div><div><span>            f_res = resultVariables(round, 5)</span></div><div><span>            g_res = resultVariables(round, 6)</span></div><div><span>            h_res = resultVariables(round, 7)</span></div><div><br></div><div><br></div><div><br></div><div><br></div><div><span>            ' difference sum(s0, maj)</span></div><div><span>            s0_maj_ref = Sha256.forceOperationInt64 +</span></div><div><span>                (Me.RightRotate(a_ref, 2) Xor Me.RightRotate(a_ref, 13) Xor Me.RightRotate(a_ref, 22)) +</span></div><div><span>                ((a_ref And b_ref) Xor (a_ref And c_ref) Xor (b_ref And c_ref))</span></div><div><br></div><div><span>            s0_maj_res = Sha256.forceOperationInt64 +</span></div><div><span>                (Me.RightRotate(a_res, 2) Xor Me.RightRotate(a_res, 13) Xor Me.RightRotate(a_res, 22)) +</span></div><div><span>                ((a_res And b_res) Xor (a_res And c_res) Xor (b_res And c_res))</span></div><div><br></div><div><br></div><div><br></div><div><span>            diff_s0_maj = s0_maj_res - s0_maj_ref</span></div><div><br></div><div><span>            ' difference d</span></div><div><span>            diff_d = Sha256.forceOperationInt64 + d_res - d_ref</span></div><div><br></div><div><span>            ' word found</span></div><div><span>            word = CType((diff_s0_maj - diff_d) And UInt32.MaxValue, UInt32)</span></div><div><br></div><div><span>            'refWords(round) = word</span></div><div><span>            refWords(round) = CType((Sha256.forceOperationUInt64 + refWords(round) + word) And UInt32.MaxValue, UInt32)</span></div><div><br></div><div><br></div><div><span>            ' get reference variables for words passed</span></div><div><span>            ' (we don't use the resulting hash)</span></div><div><span>            refVariables = Nothing</span></div><div><span>            Me.Encrypt(Me.initHash, refWords, refVariables)</span></div><div><br></div><div><span>            resultVariables = Nothing</span></div><div><span>            resultWords = Nothing</span></div><div><span>            Me.Decrypt(variablesLastRound, refVariables, resultVariables, resultWords)</span></div><div><br></div><div><span>            If debugVariables IsNot Nothing And debugWords IsNot Nothing Then</span></div><div><span>                Me.OutputResult(resultVariables, resultWords, refVariables, refWords, debugVariables(0), debugWords(0))</span></div><div><span>            End If</span></div><div><span>        Next</span></div><div><br></div><div><span>        Return resultWords</span></div><div><br></div><div><span>    End Function</span></div><div><br></div><div><br></div><div><span>    Private Sub Decrypt(variablesLastRound As UInt32(), refVariables As UInt32(,),</span></div><div><span>                        ByRef resultVariables As UInt32(,),</span></div><div><span>                        ByRef resultWords As UInt32())</span></div><div><br></div><div><span>        Dim a, b, c, d, e, f, g, h As UInt32</span></div><div><span>        Dim s1_ch_k_h_w_prev As Int64</span></div><div><span>        Dim h_w_prev As Int64</span></div><div><span>        Dim w_prev As Int64</span></div><div><br></div><div><span>        Dim round As Integer</span></div><div><span>        Dim variables(Me.rounds, 7) As UInt32</span></div><div><span>        Dim words(Me.rounds - 1) As UInt32</span></div><div><br></div><div><span>        a = variablesLastRound(0)</span></div><div><span>        b = variablesLastRound(1)</span></div><div><span>        c = variablesLastRound(2)</span></div><div><span>        d = variablesLastRound(3)</span></div><div><span>        e = variablesLastRound(4)</span></div><div><span>        f = variablesLastRound(5)</span></div><div><span>        g = variablesLastRound(6)</span></div><div><span>        h = variablesLastRound(7)</span></div><div><br></div><div><span>        variables(Me.rounds, 0) = a</span></div><div><span>        variables(Me.rounds, 1) = b</span></div><div><span>        variables(Me.rounds, 2) = c</span></div><div><span>        variables(Me.rounds, 3) = d</span></div><div><span>        variables(Me.rounds, 4) = e</span></div><div><span>        variables(Me.rounds, 5) = f</span></div><div><span>        variables(Me.rounds, 6) = g</span></div><div><span>        variables(Me.rounds, 7) = h</span></div><div><br></div><div><span>        For round = Me.rounds - 1 To 0 Step -1</span></div><div><span>            ' determine previous d</span></div><div><span>            ' --------------------</span></div><div><br></div><div><span>            ' current e = previous d + sum(previous s1, ch, k, h, w)</span></div><div><span>            ' so previous d = current e - sum(previous s1, ch, k, h, w)</span></div><div><br></div><div><span>            ' so we have to know sum(previous s1, ch, k, h, w) in order to determine previous d</span></div><div><span>            ' current a = sum(previous s1, ch, k, h, w) + sum(previous s0, maj)</span></div><div><span>            ' so sum(previous s1, ch, k, h, w) = current a - sum(previous s0, maj)</span></div><div><span>            ' we know current a, and we can calculate sum(previous s0, maj)</span></div><div><br></div><div><br></div><div><span>            s1_ch_k_h_w_prev = a -</span></div><div><span>                (Sha256.forceOperationInt64 +</span></div><div><span>                    (Me.RightRotate(b, 2) Xor Me.RightRotate(b, 13) Xor Me.RightRotate(b, 22)) +</span></div><div><span>                    ((b And c) Xor (b And d) Xor (c And d))</span></div><div><span>                    )</span></div><div><br></div><div><br></div><div><span>            ' now we know sum(previous s1, ch, k, h, w) and so we can determine previous d</span></div><div><br></div><div><br></div><div><span>            ' determine previous h</span></div><div><span>            ' --------------------</span></div><div><br></div><div><span>            ' obviously there is no direct way to determine previous h,</span></div><div><span>            ' but we can however calculate the sum of previous h and w</span></div><div><br></div><div><span>            ' we already know the value of sum(previous s1, ch, k, h, w), which we will call x here</span></div><div><span>            ' x = previous s1 + previous ch + previous k + previous h + previous w</span></div><div><span>            ' so previous h + previous w = x - previous s1 - previous ch - previous k</span></div><div><br></div><div><span>            ' we can calculate previous s1 and previous ch and we know previous k</span></div><div><br></div><div><span>            h_w_prev = s1_ch_k_h_w_prev -</span></div><div><span>                (Me.RightRotate(f, 6) Xor Me.RightRotate(f, 11) Xor Me.RightRotate(f, 25)) -</span></div><div><span>                ((f And g) Xor ((Not f) And h)) -</span></div><div><span>                Me.k(round)</span></div><div><br></div><div><span>            ' now we know the sum of previous h and w</span></div><div><br></div><div><span>            ' when we substract reference variable (previous) h from this sum,</span></div><div><span>            ' we get an intermediate value for previous w</span></div><div><span>            ' (and as a result we can calculate the intermediate value for previous h)</span></div><div><br></div><div><span>            ' ultimately, when we keep substracting reference variable (previous) h in each round,</span></div><div><span>            ' initial variables found for at least e, f, g, and h would equal initial reference variables</span></div><div><br></div><div><span>            ' from there on, we will have to adjust reference variables (reference words)</span></div><div><span>            ' in order for all variables found to comply with reference variables</span></div><div><br></div><div><span>            w_prev = h_w_prev - refVariables(round, 7)</span></div><div><br></div><div><br></div><div><span>            a = b</span></div><div><span>            b = c</span></div><div><span>            c = d</span></div><div><br></div><div><span>            d = CType((e - s1_ch_k_h_w_prev) And UInt32.MaxValue, UInt32)</span></div><div><br></div><div><span>            e = f</span></div><div><span>            f = g</span></div><div><span>            g = h</span></div><div><br></div><div><span>            h = CType(h_w_prev - w_prev, UInt32)</span></div><div><br></div><div><span>            variables(round, 0) = a</span></div><div><span>            variables(round, 1) = b</span></div><div><span>            variables(round, 2) = c</span></div><div><span>            variables(round, 3) = d</span></div><div><span>            variables(round, 4) = e</span></div><div><span>            variables(round, 5) = f</span></div><div><span>            variables(round, 6) = g</span></div><div><span>            variables(round, 7) = h</span></div><div><br></div><div><span>            words(round) = CType(w_prev And UInt32.MaxValue, UInt32)</span></div><div><span>        Next</span></div><div><br></div><div><span>        resultVariables = variables</span></div><div><span>        resultWords = words</span></div><div><br></div><div><span>    End Sub</span></div><div><br></div><div><br></div><div><span>End Class</span></div><div><br></div><div><br></div><div><br></div><div><span>' TEST FORM</span></div><div><br></div><div><span>Option Explicit On</span></div><div><span>Option Strict On</span></div><div><br></div><div><span>Public Class Form1</span></div><div><br></div><div><span>    Private Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click</span></div><div><br></div><div><span>        Dim sha As New Sha256</span></div><div><span>        Dim debugWords As UInt32()() = Nothing</span></div><div><span>        Dim debugVariables As UInt32()(,) = Nothing</span></div><div><br></div><div><br></div><div><span>        Me.btnTest.Enabled = False</span></div><div><span>        Try</span></div><div><span>            Me.txtEncodeOutput.Text = sha.Encrypt(Me.txtEncodeInput.Text, debugWords, debugVariables)</span></div><div><span>            Me.txtDecodeInput.Text = Me.txtEncodeOutput.Text</span></div><div><br></div><div><span>            'Me.txtDecodeOutput.Text = sha.Decrypt(Me.txtEncodeOutput.Text, debugWords, debugVariables)</span></div><div><span>            Me.txtDecodeOutput.Text = sha.Decrypt(Me.txtEncodeOutput.Text, Nothing, Nothing)</span></div><div><br></div><div><span>        Finally</span></div><div><span>            Me.btnTest.Enabled = True</span></div><div><span>        End Try</span></div><div><br></div><div><br></div><div><span>    End Sub</span></div><div><br></div><div><span>End Class</span></div><div><br></div><div><br></div><div><span>' FOR THE FORM DESIGNER FILE</span></div><div><br></div><div><span><Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _</span></div><div><span>Partial Class Form1</span></div><div><span>    Inherits System.Windows.Forms.Form</span></div><div><br></div><div><span>    'Form overrides dispose to clean up the component list.</span></div><div><span>    <System.Diagnostics.DebuggerNonUserCode()> _</span></div><div><span>    Protected Overrides Sub Dispose(ByVal disposing As Boolean)</span></div><div><span>        Try</span></div><div><span>            If disposing AndAlso components IsNot Nothing Then</span></div><div><span>                components.Dispose()</span></div><div><span>            End If</span></div><div><span>        Finally</span></div><div><span>            MyBase.Dispose(disposing)</span></div><div><span>        End Try</span></div><div><span>    End Sub</span></div><div><br></div><div><span>    'Required by the Windows Form Designer</span></div><div><span>    Private components As System.ComponentModel.IContainer</span></div><div><br></div><div><span>    'NOTE: The following procedure is required by the Windows Form Designer</span></div><div><span>    'It can be modified using the Windows Form Designer.  </span></div><div><span>    'Do not modify it using the code editor.</span></div><div><span>    <System.Diagnostics.DebuggerStepThrough()> _</span></div><div><span>    Private Sub InitializeComponent()</span></div><div><span>        Me.btnTest = New System.Windows.Forms.Button()</span></div><div><span>        Me.Label1 = New System.Windows.Forms.Label()</span></div><div><span>        Me.Label2 = New System.Windows.Forms.Label()</span></div><div><span>        Me.txtEncodeInput = New System.Windows.Forms.TextBox()</span></div><div><span>        Me.txtEncodeOutput = New System.Windows.Forms.TextBox()</span></div><div><span>        Me.grpEncode = New System.Windows.Forms.GroupBox()</span></div><div><span>        Me.grpDecode = New System.Windows.Forms.GroupBox()</span></div><div><span>        Me.txtDecodeOutput = New System.Windows.Forms.TextBox()</span></div><div><span>        Me.Label3 = New System.Windows.Forms.Label()</span></div><div><span>        Me.txtDecodeInput = New System.Windows.Forms.TextBox()</span></div><div><span>        Me.Label4 = New System.Windows.Forms.Label()</span></div><div><span>        Me.grpEncode.SuspendLayout()</span></div><div><span>        Me.grpDecode.SuspendLayout()</span></div><div><span>        Me.SuspendLayout()</span></div><div><span>        '</span></div><div><span>        'btnTest</span></div><div><span>        '</span></div><div><span>        Me.btnTest.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)</span></div><div><span>        Me.btnTest.Location = New System.Drawing.Point(537, 374)</span></div><div><span>        Me.btnTest.Margin = New System.Windows.Forms.Padding(2)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.btnTest.Name">Me.btnTest.Name</a> = "btnTest"</span></div><div><span>        Me.btnTest.Size = New System.Drawing.Size(56, 19)</span></div><div><span>        Me.btnTest.TabIndex = 0</span></div><div><span>        Me.btnTest.Text = "Test"</span></div><div><span>        Me.btnTest.UseVisualStyleBackColor = True</span></div><div><span>        '</span></div><div><span>        'Label1</span></div><div><span>        '</span></div><div><span>        Me.Label1.AutoSize = True</span></div><div><span>        Me.Label1.Location = New System.Drawing.Point(5, 20)</span></div><div><span>        Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.Label1.Name">Me.Label1.Name</a> = "Label1"</span></div><div><span>        Me.Label1.Size = New System.Drawing.Size(31, 13)</span></div><div><span>        Me.Label1.TabIndex = 2</span></div><div><span>        Me.Label1.Text = "Input"</span></div><div><span>        '</span></div><div><span>        'Label2</span></div><div><span>        '</span></div><div><span>        Me.Label2.AutoSize = True</span></div><div><span>        Me.Label2.Location = New System.Drawing.Point(5, 49)</span></div><div><span>        Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.Label2.Name">Me.Label2.Name</a> = "Label2"</span></div><div><span>        Me.Label2.Size = New System.Drawing.Size(39, 13)</span></div><div><span>        Me.Label2.TabIndex = 3</span></div><div><span>        Me.Label2.Text = "Output"</span></div><div><span>        '</span></div><div><span>        'txtEncodeInput</span></div><div><span>        '</span></div><div><span>        Me.txtEncodeInput.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _</span></div><div><span>            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)</span></div><div><span>        Me.txtEncodeInput.Location = New System.Drawing.Point(113, 17)</span></div><div><span>        Me.txtEncodeInput.Margin = New System.Windows.Forms.Padding(2)</span></div><div><span>        Me.txtEncodeInput.MaxLength = 31</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.txtEncodeInput.Name">Me.txtEncodeInput.Name</a> = "txtEncodeInput"</span></div><div><span>        Me.txtEncodeInput.Size = New System.Drawing.Size(462, 20)</span></div><div><span>        Me.txtEncodeInput.TabIndex = 4</span></div><div><span>        '</span></div><div><span>        'txtEncodeOutput</span></div><div><span>        '</span></div><div><span>        Me.txtEncodeOutput.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _</span></div><div><span>            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)</span></div><div><span>        Me.txtEncodeOutput.Location = New System.Drawing.Point(113, 46)</span></div><div><span>        Me.txtEncodeOutput.Margin = New System.Windows.Forms.Padding(2)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.txtEncodeOutput.Name">Me.txtEncodeOutput.Name</a> = "txtEncodeOutput"</span></div><div><span>        Me.txtEncodeOutput.ReadOnly = True</span></div><div><span>        Me.txtEncodeOutput.Size = New System.Drawing.Size(462, 20)</span></div><div><span>        Me.txtEncodeOutput.TabIndex = 5</span></div><div><span>        '</span></div><div><span>        'grpEncode</span></div><div><span>        '</span></div><div><span>        Me.grpEncode.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _</span></div><div><span>            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)</span></div><div><span>        Me.grpEncode.Controls.Add(Me.txtEncodeOutput)</span></div><div><span>        Me.grpEncode.Controls.Add(Me.Label1)</span></div><div><span>        Me.grpEncode.Controls.Add(Me.txtEncodeInput)</span></div><div><span>        Me.grpEncode.Controls.Add(Me.Label2)</span></div><div><span>        Me.grpEncode.Location = New System.Drawing.Point(12, 12)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.grpEncode.Name">Me.grpEncode.Name</a> = "grpEncode"</span></div><div><span>        Me.grpEncode.Size = New System.Drawing.Size(580, 78)</span></div><div><span>        Me.grpEncode.TabIndex = 6</span></div><div><span>        Me.grpEncode.TabStop = False</span></div><div><span>        Me.grpEncode.Text = "Encode"</span></div><div><span>        '</span></div><div><span>        'grpDecode</span></div><div><span>        '</span></div><div><span>        Me.grpDecode.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _</span></div><div><span>            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)</span></div><div><span>        Me.grpDecode.Controls.Add(Me.txtDecodeOutput)</span></div><div><span>        Me.grpDecode.Controls.Add(Me.Label3)</span></div><div><span>        Me.grpDecode.Controls.Add(Me.txtDecodeInput)</span></div><div><span>        Me.grpDecode.Controls.Add(Me.Label4)</span></div><div><span>        Me.grpDecode.Location = New System.Drawing.Point(12, 96)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.grpDecode.Name">Me.grpDecode.Name</a> = "grpDecode"</span></div><div><span>        Me.grpDecode.Size = New System.Drawing.Size(580, 78)</span></div><div><span>        Me.grpDecode.TabIndex = 7</span></div><div><span>        Me.grpDecode.TabStop = False</span></div><div><span>        Me.grpDecode.Text = "Decode"</span></div><div><span>        '</span></div><div><span>        'txtDecodeOutput</span></div><div><span>        '</span></div><div><span>        Me.txtDecodeOutput.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _</span></div><div><span>            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)</span></div><div><span>        Me.txtDecodeOutput.Location = New System.Drawing.Point(113, 46)</span></div><div><span>        Me.txtDecodeOutput.Margin = New System.Windows.Forms.Padding(2)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.txtDecodeOutput.Name">Me.txtDecodeOutput.Name</a> = "txtDecodeOutput"</span></div><div><span>        Me.txtDecodeOutput.ReadOnly = True</span></div><div><span>        Me.txtDecodeOutput.Size = New System.Drawing.Size(462, 20)</span></div><div><span>        Me.txtDecodeOutput.TabIndex = 5</span></div><div><span>        '</span></div><div><span>        'Label3</span></div><div><span>        '</span></div><div><span>        Me.Label3.AutoSize = True</span></div><div><span>        Me.Label3.Location = New System.Drawing.Point(5, 20)</span></div><div><span>        Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.Label3.Name">Me.Label3.Name</a> = "Label3"</span></div><div><span>        Me.Label3.Size = New System.Drawing.Size(31, 13)</span></div><div><span>        Me.Label3.TabIndex = 2</span></div><div><span>        Me.Label3.Text = "Input"</span></div><div><span>        '</span></div><div><span>        'txtDecodeInput</span></div><div><span>        '</span></div><div><span>        Me.txtDecodeInput.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _</span></div><div><span>            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)</span></div><div><span>        Me.txtDecodeInput.Location = New System.Drawing.Point(113, 17)</span></div><div><span>        Me.txtDecodeInput.Margin = New System.Windows.Forms.Padding(2)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.txtDecodeInput.Name">Me.txtDecodeInput.Name</a> = "txtDecodeInput"</span></div><div><span>        Me.txtDecodeInput.ReadOnly = True</span></div><div><span>        Me.txtDecodeInput.Size = New System.Drawing.Size(462, 20)</span></div><div><span>        Me.txtDecodeInput.TabIndex = 4</span></div><div><span>        '</span></div><div><span>        'Label4</span></div><div><span>        '</span></div><div><span>        Me.Label4.AutoSize = True</span></div><div><span>        Me.Label4.Location = New System.Drawing.Point(5, 49)</span></div><div><span>        Me.Label4.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.Label4.Name">Me.Label4.Name</a> = "Label4"</span></div><div><span>        Me.Label4.Size = New System.Drawing.Size(39, 13)</span></div><div><span>        Me.Label4.TabIndex = 3</span></div><div><span>        Me.Label4.Text = "Output"</span></div><div><span>        '</span></div><div><span>        'Form1</span></div><div><span>        '</span></div><div><span>        Me.AcceptButton = Me.btnTest</span></div><div><span>        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)</span></div><div><span>        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font</span></div><div><span>        Me.ClientSize = New System.Drawing.Size(604, 404)</span></div><div><span>        Me.Controls.Add(Me.grpDecode)</span></div><div><span>        Me.Controls.Add(Me.grpEncode)</span></div><div><span>        Me.Controls.Add(Me.btnTest)</span></div><div><span>        Me.Margin = New System.Windows.Forms.Padding(2)</span></div><div><span>        <a target="_blank" rel="noreferrer nofollow noopener" href="http://Me.Name">Me.Name</a> = "Form1"</span></div><div><span>        Me.Text = "Form1"</span></div><div><span>        Me.grpEncode.ResumeLayout(False)</span></div><div><span>        Me.grpEncode.PerformLayout()</span></div><div><span>        Me.grpDecode.ResumeLayout(False)</span></div><div><span>        Me.grpDecode.PerformLayout()</span></div><div><span>        Me.ResumeLayout(False)</span></div><div><br></div><div><span>    End Sub</span></div><div><span>    Friend WithEvents btnTest As System.Windows.Forms.Button</span></div><div><span>    Friend WithEvents Label1 As System.Windows.Forms.Label</span></div><div><span>    Friend WithEvents Label2 As System.Windows.Forms.Label</span></div><div><span>    Friend WithEvents txtEncodeInput As System.Windows.Forms.TextBox</span></div><div><span>    Friend WithEvents txtEncodeOutput As System.Windows.Forms.TextBox</span></div><div><span>    Friend WithEvents grpEncode As GroupBox</span></div><div><span>    Friend WithEvents grpDecode As GroupBox</span></div><div><span>    Friend WithEvents txtDecodeOutput As TextBox</span></div><div><span>    Friend WithEvents Label3 As Label</span></div><div><span>    Friend WithEvents txtDecodeInput As TextBox</span></div><div><span>    Friend WithEvents Label4 As Label</span></div><div><span>End Class</span></div><div><br></div><div><br></div><div><br></div><span></span></div>