Announce two new product: SmartCard Reader Rockey200 and USB2.0 Extension Cable

ROCKEY 200 is a handy and portable USB Smart Card reader that can perform read/write operations on any ISO 7816-1/2/3/4 smart cards which are compatible with protocol T=0 and T=1.

USB2.0 Extension Cable With high speed USB 2.0 devices such as USB token ,USB Card Reader and so on.

Come to try it now!

How to compute MAC

Algorithm School

Moderator: UNKNwYSHSA

stanneraustin
Posts: 6
Joined: Fri Jul 07, 2017 12:22 pm
Points: 102
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: 29
Joined: Wed May 20, 2015 2:41 am
Points: 172
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: 102
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: 16
Joined: Wed Sep 09, 2015 8:45 am
Points: 80
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