Sub Decrypt(value() As Byte) As String
Dim raw() As Byte = value
bb.Initialize
bb.Append(raw)
Dim binaryflag() As Byte = Array As Byte(0x33, 0x36, 0x37, 0x30, 0x42, 0x42, 0x39, 0x46, 0x2f,0x2f,0x31,0x2f,0x2f)
If bb.IndexOf(binaryflag) > -1 Then
Dim msgbytes() As Byte = bb.SubArray2(13,bb.IndexOf2(Array As Byte(0x0),13)) ' use the index of the zerobyte to mark the "end".
End If
kg.Initialize("AES")
kg.KeyFromBytes(Key.GetBytes("UTF8"))
C.Initialize("AES/ECB/NoPadding")
msgbytes = C.Decrypt(msgbytes, kg.Key, False)
Return BConv.StringFromBytes(msgbytes, "UTF8").Trim
End Sub