Page 1 of 1

PUT KEY command Error

Posted: Fri Nov 04, 2016 1:30 am
by Wardor
I want to change my card keys by PUT KEY command.But the card returned error sw=0x6982.

Here is the details.Could somebody tell me the problem.

Code: Select all

Initial Key: 404142434445464748494A4B4C4D4E4F
New Key: 101112131415161718191A1B1C1D1E1F
 
IV: 0000000000000000
ENCSessionKey - 3DES_CBC("0182" + "0000" + "000000000000000000000000") with inital Key
 
macSessionKey - 3DES_CBC("0101" + "0000" + "000000000000000000000000") with inital Key
 
IV: 0000000000000000
encrypted Key  - 3DES_CBC(new key) with ENCSessionKey
 
KeyCheckValue - 3DES_CBC("0000000000000000") with new key
 
PutKey APDU = "80D8008143 + 01 + 8010 + 730CD82CAC6724E7CF9CA4E822934B7F + 03 + 3E1CFE + 8010 + 730CD82CAC6724E7CF9CA4E822934B7F + 03 + 3E1CFE + 8010 + 730CD82CAC6724E7CF9CA4E822934B7F + 03 + 3E1CFE"
 
Response from card : 6982

Re: PUT KEY command Error

Posted: Fri Nov 04, 2016 1:38 am
by wumindejia
before put key you need to do authenticaion of GP'S Channel.

Re: PUT KEY command Error

Posted: Fri Nov 04, 2016 4:05 am
by Wardor
wumindejia wrote:before put key you need to do authenticaion of GP'S Channel.


I have established secure channel before PUT KEY command. :(

Re: PUT KEY command Error

Posted: Fri Nov 04, 2016 11:19 pm
by wumindejia
Status ‘69 82’ is "Invalid key check value",so New Key: 101112131415161718191A1B1C1D1E1F, data = 0000000000000000, KeyCheckValue = FE 8A 09, algorithm is DES. and encrypted Key - 3DES_ECB(new key) with ENCSessionKey . so PutKey APDU = "80D8008143 + 01 + 8010 + encrypted + 03 + KeyCheckValue + 8010 + encrypted + 03 + KeyCheckValue + 8010 + encrypted + 03 + KeyCheckValue ".

Re: PUT KEY command Error

Posted: Sat Nov 05, 2016 4:35 am
by Wardor
Hi. It's it. I solved this issue. Thank you very much for your help. :lol: