Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

[RESOLVED]download applet failed after changing key

JavaCard Applet Development Related Questions and Answers.
andromeda92
Posts: 38
Joined: Tue Aug 18, 2020 6:08 pm
Points :320
Contact:

[RESOLVED]download applet failed after changing key

Post by andromeda92 » Thu Sep 03, 2020 4:21 pm

Hi,

Download applet does not work anymore since i changed all 3 default key.

i can authenticate with this script GPShell

Code: Select all

mode_211 
enable_trace 
establish_context 
card_connect 
select -AID A000000003000000 
open_sc -scp 2 -scpimpl 0x15 -security 1 -keyind 0 -keyver 0 -key a068cd198555af5acc823dfae8a7827a -mac_key a068cd198555af5acc823dfae8a7827a -enc_key a068cd198555af5acc823dfae8a7827a -kek_key a068cd198555af5acc823dfae8a7827a // Open secure channel
card_disconnect 
release_context
If i use pyApdutool for download script, i have this error:

Code: Select all

Download Cap error: Check Card Cryptogram failed.
if i change the key GlobalPlatform/Auth and i clickto GP Verify, i have this error:

Code: Select all

GP Verify error: Check Card Cryptogram failed.
Using pyResMan v2.1, if i put my new key on Key Manager and i click to button Mutual Authentication, it work:

Code: Select all

doMutualAuth(): Start...
doMutualAuth(): Succeeded.
I also noticed that since I changed the keys, the version number of the keys has become 2.
(my smart card is not fused and protected.)

https://imgur.com/eOgZLH6

gp.exe -i -d -v

Code: Select all

#
# gp -i -d -v
SCardConnect("Athena ASEDrive IIIe USB 0", T=*) -> T=1, 3BF81300008131FE454A434F5076323431B7
# GlobalPlatformPro 325fe84
# Running on Windows 10 10.0 amd64, Java 1.8.0_261 by Oracle Corporation
A>> T=1 (4+0000) 00A40400 00
A<< (0103+2) (54ms) 6F658408A000000003000000A5599F6501FF9F6E06479100783300734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012A026E0102 9000
[DEBUG] GPSession - Auto-detected ISD: A000000003000000
A>> T=1 (4+0000) 80CA9F7F 00
A<< (0045+2) (27ms) 9F7F2A479050354791007833009005024992991894481290120000000006072432343939320000000000000000 9000
[WARN] GPData - Invalid CPLC date: 2432
CPLC: ICFabricator=4790
      ICType=5035
      OperatingSystemID=4791
      OperatingSystemReleaseDate=0078 (2010-03-19)
      OperatingSystemReleaseLevel=3300
      ICFabricationDate=9005 (2019-01-05)
      ICSerialNumber=02499299
      ICBatchIdentifier=1894
      ICModuleFabricator=4812
      ICModulePackagingDate=9012 (2019-01-12)
      ICCManufacturer=0000
      ICEmbeddingDate=0000 (2010-01-01)
      ICPrePersonalizer=0607
      ICPrePersonalizationEquipmentDate=2432 (invalid date format)
      ICPrePersonalizationEquipmentID=34393932
      ICPersonalizer=0000
      ICPersonalizationDate=0000 (2010-01-01)
      ICPersonalizationEquipmentID=00000000

A>> T=1 (4+0000) 80CA0042 00
A<< (0000+2) (15ms) 6A88
[DEBUG] GPData - GET DATA(IIN): N/A
A>> T=1 (4+0000) 80CA0045 00
A<< (0000+2) (17ms) 6A88
[DEBUG] GPData - GET DATA(CIN): N/A
Card Data:
A>> T=1 (4+0000) 80CA0066 00
A<< (0078+2) (38ms) 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012A026E0102 9000
Tag 6: 1.2.840.114283.1
-> Global Platform card
Tag 60: 1.2.840.114283.2.2.1.1
-> GP Version: 2.1.1
Tag 63: 1.2.840.114283.3
Tag 64: 1.2.840.114283.4.2.21
-> GP SCP02 i=15
Tag 65: 1.3.656.840.100.2.1.3
Tag 66: 1.3.6.1.4.1.42.2.110.1.2
-> JavaCard v2
Card Capabilities:
A>> T=1 (4+0000) 80CA0067 00
A<< (0000+2) (16ms) 6A88
[DEBUG] GPData - GET DATA(Card Capabilities): N/A
A>> T=1 (4+0000) 80CA00E0 00
A<< (0020+2) (21ms) E012C00401028010C00402028010C00403028010 9000
Version:   2 (0x02) ID:   1 (0x01) type: DES3         length:  16
Version:   2 (0x02) ID:   2 (0x02) type: DES3         length:  16
Version:   2 (0x02) ID:   3 (0x03) type: DES3         length:  16

Warning: no keys given, defaulting to 404142434445464748494A4B4C4D4E4F
SCardDisconnect("Athena ASEDrive IIIe USB 0", true) tx:35/rx:260
it's a bug from pyApdutool ?
What is wrong ?

Any idea ?
Thanks in advance.
Last edited by andromeda92 on Fri Sep 04, 2020 2:02 pm, edited 1 time in total.

kuafu
Posts: 317
Joined: Thu Jun 25, 2015 2:09 am
Points :4551
Contact:

Re: download applet failed after changing key

Post by kuafu » Thu Sep 03, 2020 8:57 pm

I think it's the bug of pyApdutool.
well

andromeda92
Posts: 38
Joined: Tue Aug 18, 2020 6:08 pm
Points :320
Contact:

Re: download applet failed after changing key

Post by andromeda92 » Fri Sep 04, 2020 5:52 am

Yes, me too, because on pyResMan all work, i can load, install, select applet, APDU work fine ,
i can authenticate from pyResMan.

but the command GP -l not work
Warning: no keys given, defaulting to 404142434445464748494A4B4C4D4E4F
Failed to open secure channel: Card cryptogram invalid!
Received: 40FCC922B688B08C
Expected: 327AEEAC380376EC
!!! DO NOT RE-TRY THE SAME COMMAND/KEYS OR YOU MAY BRICK YOUR CARD !!!
Read more from https://github.com/martinpaljak/GlobalP ... /wiki/Keys

andromeda92
Posts: 38
Joined: Tue Aug 18, 2020 6:08 pm
Points :320
Contact:

Re: download applet failed after changing key

Post by andromeda92 » Fri Sep 04, 2020 2:02 pm

I confirm, it's a bug from pyApdutool

i need to put new key to file config.ini, now it work fine, i can download, install, select, transmit
apdu with new key generated with gp - lock xxxxxxxxxxxxxxxx

the only problem is gp.exe - l that return me always

Code: Select all

Warning: no keys given, defaulting to 404142434445464748494A4B4C4D4E4F
Failed to open secure channel: Card cryptogram invalid!
Received: 6EFD618DDE6063C3
Expected: 5460847741EF5C22
!!! DO NOT RE-TRY THE SAME COMMAND/KEYS OR YOU MAY BRICK YOUR CARD !!!
Read more from https://github.com/martinpaljak/GlobalPlatformPro/wiki/Keys
may be another bug from gp.exe

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 54 guests

JavaCard OS : Disclaimer