CryptoSys API Library Manual

Example: Mac.HexFromHex 

[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

[Contents] [Index]

[PREV: Example: Mac.HexFromBytes ...]   [Contents]   [Index]   
   [NEXT: Example: Md5.AddData ...]

Copyright © 2001-23 D.I. Management Services Pty Ltd. All rights reserved. Generated 2023-05-20T13:01:10Z.