i have a new cyberflex card.
pcsclite under linux (suse 7.3), thus a send directly apdu command to
the card, without using any API.
i would create e file but i don't have the right permission. There's
need to authenticate. (ok?)
i send an APDU command verifyCHV (the default chv 00000000)
response 6983
i try to unblockCHV
response 6983
now i've read in this forum that if the counter becomes zero either the
pin and the unblock pin become blocked. It's necessary an externalAuth
(aut0).
steps:
askRandom
externalAuth with the given random ciphered with des and the trasport
key in the data field.
respons 6982 :(
i've a trouble in mind...
is there need to unlock new cyberflex card?
what do i do with the trasport key?
here the code in c
void doChallenge(BYTE *apdu, BYTE *rand)
{
int i=0;
char output;
char out2;
const_des_cblock key1={0xAD,0x9F,0x61,0xFE,0xFA,0x20,0xCE,0x63};
des_key_schedule skey1;
des_set_key(key1,skey1);
des_ecb_encrypt( (const_des_cblock*)rand,(des_cblock*)output,skey1,1);
//des_ecb_encrypt( (const_des_cblock*)output,(des_cblock*)
out2,skey1,0);
while (i<8)
apdu=output;
}
int main()
{
int i=0;
LONG rv;
SCARDCONTEXT hContext;
SCARDHANDLE hCard;
DWORD dwActiveProtocol,dwSendLength,pcbRecvLength;
SCARD_IO_REQUEST pioRecvPci;
BYTE buffer1={0};
BYTE buffer2={0};
BYTE askRandom={0x00,0x84,0x00,0x00,0x08};
BYTE externalAuth={0x00,0x82,0x00,0x00,0x08};
rv=SCardEstablishContext(SCARD_SCOPE_SYSTEM,NULL,NULL,&hContext);
rv=SCardConnect(hContext,"Gemplus GemPC410 Reader 0 0",
SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0,&hCard,&dwActiveProtocol);
SCardTransmit
(hCard,SCARD_PCI_T0,askRandom,5,&pioRecvPci,buffer1,&pcbRecvLength);
doChallenge(externalAuth,buffer1);
rv=SCardTransmit
(hCard,SCARD_PCI_T0,externalAuth,13,&pioRecvPci,buffer2,&pcbRecvLength);
print_buffer(buffer1,10);
print_buffer(externalAuth,13);
print_buffer(buffer2,10);
printf(" - %s\n",pcsc_stringify_error(rv));
}
/* **********************
*/
some question...
1) on new card what are the steps to unblock?
2) verifyCHV is sufficient?
3) the transport key must be used the first time I want use the card?
4) used scheme:
askRandom
cypher the result with simple DES
externalAuth with the given ciphered random
is this correct?
5) the transport key on the cover is in exadecimal format?
6) the APDU that i've sent to the card are correct?
7) how many check could I do before the new card is blocked on
CHV1
transportKey
thanks thanks thanks thanks
_______________________________________________
Muscle mailing list
[EMAIL PROTECTED]
http://lists.musclecard.com/mailman/listinfo/muscle