Visual Basic不执行行

时间:2015-10-20 09:47:36

标签: vb.net encryption

我在visual basic中有一段代码,它应该逐个加密16字节块,在base64中编码并返回包含所有编码和加密块的字符串:

Private Function EncryptARIA(plaintext As String) As String
    Dim aria As ARIA = getAria()

    Dim result As String = ""
    Dim buffer As Byte() = System.Text.UTF8Encoding.UTF8.GetBytes(plaintext)
    Dim blocks As List(Of Byte()) = getByteBlocks(buffer)
    Try
        For Each block As Byte() In blocks
            result = result + Convert.ToBase64String(aria.Encrypt(block))
            'For Each bits As Byte In block
            '    Console.WriteLine("[DEBUG] input byte: " + bits)
            'Next
        Next
        Return result
    Catch ex As Exception
    End Try
    Return Nothing
End Function

代码没有正确解密,我想看到明文位进入,解密和解码位在另一种方法中出现,问题是每当我在代码中取消注释for时,函数开始返回没事,发生什么事了?

0 个答案:

没有答案