javacardglobalplatform

How to change java card default key with my own keys?


I am trying to change a java card default keys (40 41... 4F) to my own key set. I tried to use JCManager but the process of Modify Key returns 6A 88 meaning that reference data not found.

Next I tried GPShell put_sc_key to change but same error returned.

What are proper P1 and P2 bytes for changing default keys?

How can I fix this?

APPENDIX 1:

This is the result of GET DATA command executed in GPShell as below:

mode_211
enable_trace
establish_context
card_connect
select -AID A000000151000000
Command --> 00A4040008A000000151000000
Wrapped command --> 00A4040008A000000151000000
Response <-- 6F108408A000000151000000A5049F6501FF9000
get_data -identifier E0
Command --> 80CA00E000
Wrapped command --> 80CA00E000
Response <-- E012C00401208080C00402208080C004032080809000
E012C00401208080C00402208080C00403208080
card_disconnect
release_context

APPNDIX 2:

This is the script by which I have tried to change key using GP pro with ACR83 reader:

gp -lock 010B0371D78377B801F2D62AFC671D95
Warning: no keys given, using default test key 404142434445464748494A4B4C4D4E4F
Failed to communicate with card in JnaCardTerminal{scardHandle=SCardContext{cd00000100000001}, name=ACS ACR83U 0}: SCardTransmit got response 0x57 (null: null)

Solution

  • I found pyResMan useful in my case. It is a python application which helps you easily list your key sets on your cards and add/modify keys.