472,106 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,106 software developers and data experts.

ISO/IEC 9797-1 CBC MAC using vb.net


I need to calculate the Cryptographic checksum using ISO/IEC 9797-1 MAC
algorithm with cipher block chaining MAC. The resultant MAC length must be 8 bytes.
As a sample, the data I am working on now is:
Data = '72C29C2371CC9BDB65B779B8E8D37B29ECC154AA56A8799FA E2F498F76ED92F2'
Kmac = '7962D9ECE03D1ACD4C76089DCE131543'

Resultant MAC[Kmac](Data)='53265320' (I want to know how to get
to this value using vb.net).
I search this on google but no success for the last 1 week.
Any code?
May 29 '07 #1
2 9695

You can do it very easy

Divide the key with Key1[ first 64 bits] and key2 [last 64 bits]

use initial vector {0,0,0,0,0,0,0,0}
divide the message into 8 bytes blocks
pad the last block with "80" and "00","00","00" until it reaches 8 bytes
if the message already can be divided by 8, then add another block "80 00 00 00 00 00 00 00"
encrypt by DES CBC algorith with the first key KEY 1
Decrypt the result by DES ECB with the second key KEY2
Encrypt the result by DES ECB with the first key KEY1

take the first 4 bytes as the MAC

Mohamed Moustafa
Nov 15 '08 #2
Hi Mohamed,

I need to calculate MAC according to the ISO/IEC 9797-1 Algorithm 1 using DES in CBC mode (the one you talk about is Algorithm 3). Could you tell me how to do that?

Apr 28 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Skip Montanaro | last post: by
8 posts views Thread by Anders Eriksson | last post: by
3 posts views Thread by Ismael Herrera | last post: by
5 posts views Thread by Andrew | last post: by
23 posts views Thread by Luc Vaillant | last post: by
67 posts views Thread by Philippe Martin | last post: by
6 posts views Thread by =?Utf-8?B?TWljaGFlbCBNaWxsZXI=?= | last post: by
2 posts views Thread by =?Utf-8?B?VG9tIEFsbGVu?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.