Page 1 of 1
I want to unlock my javacard applet
Posted: Wed Feb 15, 2017 1:43 am
by sla1023
Hello
I locked the applet via GPSystem.SetCardContentState (GPSystem.APPLICATION_LOCK)
But I do not know how to unlock the applet again.
Some people ask you to use ISD, but I do not know how to choose ISD.
Please tell me how to unlock the locked applet
Thank you
Re: I want to unlock my javacard applet
Posted: Wed Feb 15, 2017 4:31 am
by UNKNwYSHSA
What's the model of your card?
Re: I want to unlock my javacard applet
Posted: Wed Feb 15, 2017 4:47 am
by UNKNwYSHSA
1 Select the ISD; (Ask your card provider for the ISD AID value, or try to send SELECT command without ISD AID: "00 A4 04 00 00")
2 GP auth;
3 Send SET STATUS command: "80 F0 40 XX LC YY YY YY YY ...", XX is the new status value according to the definition "Application Life Cycle Coding", YY is the AID of your applet instance.
Re: I want to unlock my javacard applet
Posted: Thu Feb 23, 2017 11:20 am
by sla1023
thank you for your answer
but i still don't know how to get gp auth
please explain gp auth using apdu
thank you
Re: I want to unlock my javacard applet
Posted: Thu Feb 23, 2017 10:30 pm
by UNKNwYSHSA
1
pyApdutool2
GPShellopen_sc command
3 pyResMan
4
GlobalPlatformProgp.exe --unlock-applet <AID>
Note: Use gp.exe -h for usage informations.
5 Commands:
Code: Select all
INITIALIZE UPDATE
EXTERNAL AUTHENTICATE
Note: For the details, see GlobalPlatform specification.
6 Write code:
Refer to the code of opensource tools: GPShell(C lanaguage)/GlobalPlatformPro(java language)/pyResMan(python language)/....
Re: I want to unlock my javacard applet
Posted: Fri Feb 24, 2017 1:03 am
by sla1023
thank you for your answer
i only use number 5
but i don't know how to use
i send command
0x80, 0x50, 0x00, 0x00, 0x08, 0xF2, 0xA5, 0xFA, 0x8B, 0xEF, 0x9F, 0x8A, 0x51, 0x00
and
0x84, 0x82, 0x03, 0x00, 0x10 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
first command receive 9000
but second receive 69 85
so please explain how to use second command using apdu
thank you for your help
Re: I want to unlock my javacard applet
Posted: Fri Feb 24, 2017 1:34 am
by UNKNwYSHSA
This command needs "Host cryptogram and MAC". Both these datas can be calculated following globalplatform specification. this process is cumbersome, and the value can be used once.
The steps:
1 Send INITIALIZE UPDATE command with host challenge, the card challenge got;
2 Calculate Host cryptogram with host challenge + card challenge + other data and the command MAC;
3 Send EXTERNAL AUTHENTICATE command with Host cryptogram and MAC;
It is recommanded that use one tool to send these commands.