Dim key(0) As Byte
Dim data(0) As Byte
Dim keydata(0) As Byte
Dim sigdata(0) As Byte
key = Bconv.HexToBytes( "ABCDABCDABCDABCD847FC70F12728DA2D1883F67020D8C5FF53CA0E309ECE70019D038B07DB3E0896ECFA34FB77F35C985D5124C040F4795ABCDABCDABCDABCD" )
Dim mac1 As Mac
Dim kg As KeyGenerator
kg.Initialize("DESEDE")
kg.KeyFromBytes( key )
text = "please encode me"
data = Bconv.StringToBytes(text, "UNICODE")
mac1.Initialise("HMACSHA1", kg.key)
mac1.Update(data)
sigdata = mac1.Sign
Dim B64 As Base64
b64str = B64.EncodeBtoS( sigdata, 0, sigdata.Length )
Msgbox( b64str, "Encoded" )