469,117 Members | 1,339 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,117 developers. It's quick & easy.

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

Hi,

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 9303
Hello

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

Thanks
Mohamed Moustafa
Nov 15 '08 #2
muncho
1
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?

Thanks,
Muncho
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.