[VB6 equivalent: MAC_HexFromHex]
Dim strKeyHex As String Dim strMsgHex As String Dim strMAC As String ' SP800-38: compute CMAC_AES-128 on Example 2: Mlen = 128 strKeyHex = "2b7e151628aed2a6abf7158809cf4f3c" strMsgHex = "6bc1bee22e409f96e93d7e117393172a" ' Output MAC size in hex is double the block length of the cipher strMAC = Mac.HexFromHex(strMsgHex, strKeyHex, MacAlgorithm.CmacAes128) If strMAC.Length > 0 Then Console.WriteLine("CMAC-AES-128(K128, M128)=" & strMAC) Else Console.WriteLine("Error") End If
See Also:
Mac.HexFromHex Method