Reputation: 11
Having a quite newbie problem. But this question lingered for a very long time: We all know session keys used in SCP01/02/03 are derived from static keying materials. But I cannot figure out how those static keys are loaded on card! Maybe I read the spec too carelessly, yet I had searched the whole paper relating to those words of interest and I found nothing. Any boss could enlighten me? And could you by the way tell me something about the personalization process on its purpose? Please.
For those of you who might not have known the usage of the data "diversification data" just like me here I quote a paragraph from "GlobalPlatform Card Specifications 2.1.1 & 2.1 17 FAQ":
Upvotes: 0
Views: 761
Reputation: 4444
With a brandnew NXP JavaCard and jcshell
terminal. To change a static first key of value 1D9A55C27970FACEBABEDEC0DE4CCE55
:
/terminal
/atr
/card
init-update
ext-auth enc
/set-var k 1D9A55C27970FACEBABEDEC0DE4CCE55
set-key 1/1/DES-ECB/${k} 1/2/DES-ECB/${k} 1/3/DES-ECB/${k}
put-keyset -m add -r 1 1
Remove the card and put back the card and then authenticate using new static key:
/card
/set-var k 1D9A55C27970FACEBABEDEC0DE4CCE55
set-key 1/1/DES-ECB/${k} 1/2/DES-ECB/${k} 1/3/DES-ECB/${k}
init-update 1
Here are some things that I observed. A brandnew card default key index is FF
which means the static key is from manufacturing default. Once a new key is introduced, the default static keys is forever lost and the key index shall no longer be FF
. Since we set the static key index to 1
, then init-update
must supply this index number. Otherwise, the card will chose this index number.
I can continue adding more static keys, but not delete. Static keys can only be changed in value or reposition in index. I'm not messing with the 10 bytes diversification data yet, but I see them to be fixed for each card.
Upvotes: 0
Reputation: 2647
Your smartcard usually ships with default keys installed on the card. For most cards this is 404142..4F for all 3 DES keys in SCP02. So you might try the default key, otherwise ask your vendor/supplier/chip manufacturer for the keys. Beware that the chip locks itself after certain amount of unsuccessful tries..
To change the keys for operational lifecycle, Global Platform offers the PUTKEY
command, often also other proprietary chip-specific methods (e.g. STORE DATA
or completely proprietary) may exist. If PUTKEY
does not work, contact your vendor/supplier/chip manufacturer.
Upvotes: 2