简体   繁体   中英

How to change javacard default keys?

I have a javacard and it's S_ENC , S_MAC and DEK keys are 404142434445464748494A4B4C4D4E4F . the question is how I can change these key via gpj , gpshell or jcmanager?

With gpshell, you can use the put_sc_key command:

put_sc_key -keyver <current key version> -newkeyver <new key version> -mac_key <mac key> -enc_key <enc key> -kek_key <kek key> [-current_kek <kek key>]

I don't think that changing keys is possible with GPJ. The GUI of jcManager has nice self-explanatory text-fields and buttons that should be fairly easy to understand (ie "New keys:", "Add/modify keys").

PUT KEY Command is a GP command to change key.
The APDU format is "80/84 D8 P1 P2 Lc Data Le", For more details you can see "GlobalPlatform Card Specification"

The PUT KEY command is used to either:

• Replace an existing key with a new key: The new key has the same or a different Key Version Number but the same Key Identifier as the key being replaced;

• Replace multiple existing keys with new keys: The new keys have the same or a different Key Version Number (identical for all new keys) but the same Key Identifiers as the keys being replaced;

• Add a single new key: The new key has a different combination Key Identifier / Key Version Number than that of the existing keys;

• Add multiple new keys: The new keys have different combinations of Key Identifiers / Key Version Number (identical to all new keys) than that of the existing keys; When the key management operation requires multiple PUT KEY commands, chaining of the multiple PUT KEY commands is recommended to ensure integrity of the operation. In this version of the Specification the public values of asymmetric keys are presented in clear text

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM