Christmas is coming!

To celebrate the new year and thank for the support from all our dear customers, Christmas promotional activity is being held in JavaCardOS online store.

During the event, you can enjoy many promotional activities - High Discount on JavaCardOS products,Lucky Draw,Double forum Points.

Come to choose your own Christmas gift and try your luck now!

How to compute MAC

Algorithm School

Moderator: UNKNwYSHSA

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

Re: How to compute MAC

Postby 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: 26
Joined: Wed May 20, 2015 2:41 am
Points: 144
Contact:

Re: How to compute MAC

Postby 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: 98
Contact:

Re: How to compute MAC

Postby 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: 14
Joined: Wed Sep 09, 2015 8:45 am
Points: 60
Contact:

Re: How to compute MAC

Postby 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.


Return to “Algorithm School”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer