0

I am trying to load a FFFFFFFFFFFF key to the volatile memory of omnikey 5321 reader. But I get an error SW1 SW2: 69 86. Can anyone suggest why? (maybe omnikey does not support writing volatile keys?).

Here is the code:

bcla = 0xFF;
bins = 0x82;
bp1 =0x0     // Load key in volatile memory
bp2 = 0x20  // store in the volatile memory
len = 0x6;       // Length = 6 bytes
sendBuffer[0] = bcla;
sendBuffer[1] = bins;
sendBuffer[2] = bp1;
sendBuffer[3] = bp2;
sendBuffer[4] = len;

// Now, copy the actual key to the send buffer
for (int k =0 ;k<=5;k++)
         sendBuffer[k + 5] = str3[k]; // This will copy FFFFFFFFFFFF key


// then make call to scardtransmit.. also set length of send buffer to 11

1 Answers1

1

69 86 means "Command not Allowed".

Try this.....

CLA = FF

INS = 82

P1 = 00

P2 = 60/61 (Key Id, 60 for Key A and 61 for Key B)

Lc = 06 (Length of Key in Data Field)

Data Field = Value Of Key in 6 bytes

Example:

FF 82 00 60 06 FFFFFFFFFFFF

jiten
  • 5,128
  • 4
  • 44
  • 73
  • vikky Hi, nice to see you. Vikky I am following section 7.1 of link you sent me last time: http://www.epsys.no/downloads/pdf/API_ACR128_v1.9.pdf. if I write P2=60/61 will it write to **volatile** memory?? I don't want to overwrite non volatile memory yet... –  Sep 17 '13 at 06:48
  • Hey vikky, yes indeed I sent: FF 82 0 60 6 FF FF FF FF FF FF string now, but I have same problem ... –  Sep 17 '13 at 07:45
  • send this FF 82 00 60 06 FF FF FF FF FF FF – jiten Sep 17 '13 at 07:51
  • Hey vikky for example my `len` parameter is initialized like this: `len = 0x6;` (also see code above) where len is `byte` so I think len equals `06` as you said anyway, just debugger just showed 6 that is why I typed 6 in my above example. same for bp1 –  Sep 17 '13 at 08:40
  • vikky anyway I managed to successfully authenticate to the card however using **non-volatile** memory, so I think I can just skip writing on volatile memory .... (thanks for the link you gave me last time). –  Sep 17 '13 at 08:57
  • just one more question. I know more or less what commands/APDU to send to Mifare Classic cards if I want to communicate to it(this was in the document you sent me and also the Sample project). But if I want to communicate with Mifare Ultrlight C or Plus -- where can I find information what APDUs to send to them? There does not seem much information on the net, or I am wrong? –  Sep 17 '13 at 09:05