I want establish a scp03 secure channel.
My static keys are of length 32bytes or 256bits
Using 32 byte keys I want to generate session keys according to scp03 protocol,
when I tried implementing after generating session keys when I use the generate mac key to verify card cryptogram it is failing.
Following are steps that I have implemented:
- Initialize update
- Generate session keys. According to diversification scheme
input for session-enc – 11(0’s)+derivation constant(0x04-enc,0x06-mac,0x07-rmac)+00(separation indicator)+0x0100(L value bcz 32 byte key length)+0x02+hostchallange(8 bytes)+card challenge(8 bytes) — total 32 bytes
This is how I generate enc, mac, r-mac keys
- Verify card cryptogram – I use 16byte generated mac key and applied derivation scheme. When I am verifying the card cryptogram which is 8 bytes the comparison is failing.
Can I know the proper values to generate session keys and verify card cryptogram
abc is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
globalplatform for c on GitHub can do this. There might be also a test case in a file scp03Test.c