Forum Replies Created

  • Re: Reply To: Trying to connect to PlusSL3

    31. May 2018 at 13:00
    in reply to: Trying to connect to PlusSL3
    Actually, it works with Taplinx 1.0, but not 1.4.
    + 1  |  - 0

    Re: Reply To: Trying to connect to PlusSL3

    31. May 2018 at 12:41
    in reply to: Trying to connect to PlusSL3
    Ok, just connecting to the Maven repository corrects this, so it's probably a bug.
    + 0  |  - 0

    Re: Reply To: Understanding the sample app

    29. May 2018 at 11:11
    in reply to: Understanding the sample app
    I think now that I could have changed the authentication key in the sample code, because the code for SL3EV1 has 4006 as authentication key although it writes in the same block. So now I think the code writes on block 12, wich is the first block of sector 3. The thing is it worked before and it works now. It's like it always authenticates no matter what. The issue now is the byte array it writes. I changed the last byte and maybe another byte, but it works, but if I change the first byte, for instance, it doesn't work. Here an array that works:

    byte[] dataWrite = new byte[]{(byte) 0x16, (byte) 0x00, (byte) 0x00,
    (byte) 0x00, (byte) 0xE9, (byte) 0xFF, (byte) 0xFF,
    (byte) 0xFF, (byte) 0x16, (byte) 0x00, (byte) 0x00,
    (byte) 0x00, (byte) 0x04, (byte) 0xFB, (byte) 0x04,
    (byte) 0xFB, (byte) 0x21, (byte) 0x00, (byte) 0x00,
    (byte) 0x00, (byte) 0xDE, (byte) 0xFF, (byte) 0xFF,
    (byte) 0xFF, (byte) 0x21, (byte) 0x00, (byte) 0x00,
    (byte) 0x00, (byte) 0x05, (byte) 0xFB, (byte) 0x05,
    (byte) 0xFA, (byte) 0x2C, (byte) 0x00, (byte) 0x00,
    (byte) 0x00, (byte) 0xD3, (byte) 0xFF, (byte) 0xFF,
    (byte) 0xFF, (byte) 0x2C, (byte) 0x00, (byte) 0x00,
    (byte) 0x00, (byte) 0x06, (byte) 0xF9, (byte) 0x06,(byte) 0x10};

    Here one that doesn't work:

    dataWrite = new byte[]{(byte) 0x09, (byte) 0x00, (byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
    (byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x01, (byte) 0x00};

    Why does this happen?



    + 0  |  - 0

    Re: Reply To: Understanding the sample app

    25. May 2018 at 2:01
    in reply to: Understanding the sample app
    Although my theory must be incorrect, because block 12 would be the first block of sector 3, not the last of sector 2. I've seen the Mifare Classic documentation and it is indeed like that, but I'm using a PLUS, hence my doubt.
    + 0  |  - 0

    Re: Reply To: Understanding the sample app

    24. May 2018 at 10:50
    in reply to: Understanding the sample app
    But, in the sample app code, it says (only the important parts in lines 1088-1108 of MainActivity.java):


    plusSL3.authenticateFirst(0x4004, objKEY_AES128, pcdCap2In);

    plusSL3.writeValue(IPlusSL3.WriteMode.Plain_ResponseMACed, 12, 999, (byte) 0x09);

    valueResult = plusSL3.readValue(IPlusSL3.ReadMode.Plain_ResponseMACed_CommandMACed, 12);

    plusSL3.multiBlockWrite(IPlusSL3.WriteMode.Plain_ResponseMACed, (byte) 12, 3, dataWrite);

    result = plusSL3.multiBlockRead(IPlusSL3.ReadMode.Plain_ResponseMACed_CommandMACed, 12, 3);


    According to the Taplinx Javacoc, the writeValue is like this: writeValue(mode,blocknum,value,address), so in the first line it should be writing the value 999 (2 bytes I think) in block 12. It first authenticated to 4004, which is the key for sector 2, key A, but there is no block 12 in sector 2. So, what is this doing?

    My theory is that 12 refers to the sector trailer of sector 2, key A, and the address is the address of the block to be written, in this case block 9, and that is why the label that you read on the phone says "data in block-9" or something like that, and that is why the multiBlockWrite writes on 12. I checked that, indeed, this overwrites what the writeValue() method wrote, so I suppose the 12 is because we must access the sector trailer to write on that sector. Then, if you try to read from block 12, that is the sector trailer, it reads whatever is written in the 3 data blocks (9-11), and that is what the methods readValue() and multiBlockRead() are doing.

    The thing is that I can't read this data with APDU commands. I authenticate correctly, obtaining the secret key for the MAC calculation, I calculate the MAC with an online tool that I know for sure that works, but it doesn't work. I know that this could be for many reasons, including that my Gemalto doing just doesn't understand the read command because it was bought prior to the Mifare PLUS release, so it is not interely compatible, but I would like to properly understand what Taplinx is doing in this case.


    + 0  |  - 0

    Re: Reply To: Understanding the sample app

    23. May 2018 at 16:50
    in reply to: Understanding the sample app
    Well, after thinking about it, since in the documentation they access block 17 and so, now I suppose that block 12, for instance, is, by definition in sector 2. Blocks 0-4, would be in sector 0, 5-8 in sector 1, and 9-12 in sector 2. The problem is that, for some reason, I can't read the data in any of those blocks. What's more, wouldn't block 12 be a sector trailer that can't store data? I suppose this goes in another forum, but, anyway, I would like some insight into the workings of the method writeValue() in the PLUSL3 class.
    + 0  |  - 0
Viewing 6 posts - 1 through 6 (of 6 total)