Christmas is coming soon! To thank for the support from all our dear customers, Christmas promotional activity is going on in JavaCardOS online store. For more activities details, please check this post.

How to compute MAC

Algorithm School

Moderator: UNKNwYSHSA

stanneraustin
Posts: 6
Joined: Fri Jul 07, 2017 12:22 pm
Points :110
Contact:

Re: How to compute MAC

Post by stanneraustin » Fri Jan 19, 2018 6:40 am

This i know already.
http://xionghuilin.com/?p=326 this explain some part of puzzel.
i posted more details at here too https://stackoverflow.com/questions/247 ... tools?rq=1
still not returning valid C-MAC for another command then EXTERNAL AUTHENTICATE

User avatar
Tolice
Posts: 31
Joined: Wed May 20, 2015 2:41 am
Points :188
Contact:

Re: How to compute MAC

Post by Tolice » Tue Jan 23, 2018 3:45 am

stanneraustin wrote:This i know already.
http://xionghuilin.com/?p=326 this explain some part of puzzel.
i posted more details at here too https://stackoverflow.com/questions/247 ... tools?rq=1
still not returning valid C-MAC for another command then EXTERNAL AUTHENTICATE



For the EXTERNAL AUTHENTICATE command MAC verification, the ICV is set to zero

stanneraustin
Posts: 6
Joined: Fri Jul 07, 2017 12:22 pm
Points :110
Contact:

Re: How to compute MAC

Post by stanneraustin » Tue Jan 23, 2018 6:33 am

Ok i have solved issue.
ICV is what we got from external auth.

1) ICV is des ecb each time we going to use with first 8 byte session MAC. used as IV on next step.
2) now if data is less then 8 byte or 8 byte skip this. des cbc first 8 byte data with first 8 byte session mac key and IV = ICV result we have new ICV used as IV on next step
3) now last des cbc last 8 byte with full session mac 16 byte + first 8 byte session mac (to get 24bit) key with IV = ICV
right 8 byte is ur final result C-MAC

Only thing complex is make 24bit key out of 16 bytes was not well documented by globalplatform.
Thanks to every one, i hope this will help others.

whitexiao
Posts: 16
Joined: Wed Sep 09, 2015 8:45 am
Points :80
Contact:

Re: How to compute MAC

Post by whitexiao » Sun Jan 28, 2018 10:28 pm

stanneraustin wrote:Ok i have solved issue.
ICV is what we got from external auth.

1) ICV is des ecb each time we going to use with first 8 byte session MAC. used as IV on next step.
2) now if data is less then 8 byte or 8 byte skip this. des cbc first 8 byte data with first 8 byte session mac key and IV = ICV result we have new ICV used as IV on next step
3) now last des cbc last 8 byte with full session mac 16 byte + first 8 byte session mac (to get 24bit) key with IV = ICV
right 8 byte is ur final result C-MAC

Only thing complex is make 24bit key out of 16 bytes was not well documented by globalplatform.
Thanks to every one, i hope this will help others.

It's really a good sharing, I'm also learning smart card. Thank you.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 0 guests

JavaCard OS : Disclaimer