×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    53

    External Reader talking to 6131 Internal MiFare

    I've got a basic java (J2EE, not J2ME) program which I run on my PC and through an Omnikey 5321 cardreader can talk to a regular MiFare 1K card - this all works fine.

    I want to be able to use the internal MiFare card within the 6131 (which has been unlocked) however this is not as straight forwards as I thought. The APDU to load an authentication key into a key number is:
    "FF 82 20 00 06 FF FF FF FF FF FF" - to put key FFFFFFFFFFFF into block 00. On the regular 1K card this works fine (Return 90 00) however on the 6131 it returns 6E 00.

    Do I need to do something else before I can talk to the MiFare part of the phone? I've tried sending SELECT commands to select the Application IDs listed on page 12 of the SDK userguide however none of these work.

    Infact the APDU I am trying to send should be accepted even if the key isn't valid for the card - it is a load command not an authenticate command.

    Any advise gratefully recieved.

    Cheers,
    -Jeff

  2. #2
    Registered User
    Join Date
    Jul 2007
    Posts
    20

    Re: External Reader talking to 6131 Internal MiFare

    I have seen problems where certain readers aren't capable of accessing the smartcard (secure element) mifare emulation. I had the impression that this was an issue with the readers not recognizing the smartcard as a mifare 1k/4k.

    I am confused, because afaik, the mifare protocol doesn't use APDU's. Is this the way this Omnikey reader works? Weird.

  3. #3
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    53

    Re: External Reader talking to 6131 Internal MiFare

    The example software that comes with the reader identifies a card as soon as it is placed on the reader - in the case of a regular MiFare 1K card the reader identifies it as a "MiFare 1K" - however the NFC phone is identifies as "unknown" and the option I have for authenticating to the card are disabled.

    As MiFare cards are part of the ISO 7816 they do accept APDUs (I don't know the specifics of how the cardreader example works). The software I am developeing to use the cardreader is written in Java and makes use of PC/SC for which I can only send APDUs. As mentioned, I can send APDUs to a regular MiFare card, anything I send to the phone is sent and a response is recieved (so should not be anything to do with the cardreader as all this is doing is passing commands) - the response is error code rather than a 90 00 which give me the impression there is a issue with the phone and not with the reader.

    Regards,
    -Jeff

  4. #4
    Registered User
    Join Date
    Jul 2007
    Posts
    20

    Re: External Reader talking to 6131 Internal MiFare

    hi,

    mifare 1k does not use ISO7816. Maybe you were talking to a DESFire?
    I suppose the PC/SC driver has some kind of workaround for accessing mifare through APDU...

    Anyways, I've heard about this issue already, where some readers just wont recognize a smartmx as a mifare 1k/4k. This is consistent with your software reporting it as unknown.

    The reader that our building access system provider uses can also read mifare 1k/4k, but is not capable of reading the mifare emulation on either a Smartmx with a mifare emulation nor on the nokia phone. So some readers have trouble recognizing the mifare emulation as a mifare card. Maybe something to do with mifare type identification not being properly implemented (documented here )?

    You probably should report the problem to the manufacturer of the reader, try to get a firmware update for the reader or get another reader altogether. I can read the phones (mifare emulation) with
    * NXP/Philips pegoda reader
    * NXP PN531 demo board
    * Arygon NFC/Mifare reader

    hope it helps

    regards

    Tim

  5. #5
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    53

    Re: External Reader talking to 6131 Internal MiFare

    Thanks for the clarification Tim ... I guess I've mis-understood how things work. Infact it could be the PC/SC library which converts the APDUs I send to the cardreader and it is this point that it fails.

    We got these omnikey 5321 card readers as they were explicitly mentioned in the SDK User Guide - ah well. I will contact Omnikey and see what they have to say. Can you suggest any key phrases that would make sence to them (apart from your comment "Maybe something to do with mifare type identification not being properly implemented (documented here )" ).

    Regards,
    -Jeff

  6. #6
    Registered User
    Join Date
    Jul 2007
    Posts
    20

    Re: External Reader talking to 6131 Internal MiFare

    unfortunately, no, the terminology is in the link to the type identification document. Specifically, their reader has trouble detecting the mifare emulation on a smartmx chip...

  7. #7
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    53

    Re: External Reader talking to 6131 Internal MiFare

    After speaking the Omnikey, the following must be done in order use the MiFare Emulation:

    Upgrade the driver to version 1.1.2.3 (from the omnikey website).
    In the registry, change ControlFlags under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CardMan\RFID to "00000004" then remove and reinsert the card reader.

    The phone will then be identified as a MiFare 4K card. However in order to interact with the JavaCard it is necessary to put the registry value back to what it was.

    It is possible to toggle the flag from within software which works on the fly, however I have not had chance to examine the code yet to see what it actually does.

    -Jeff

  8. #8
    Registered User
    Join Date
    Jul 2007
    Posts
    9

    Re: External Reader talking to 6131 Internal MiFare

    Jeff, did this solution for you work? I am facing the same problem.
    I installed the 1.1.2.3 driver, but I didn't have the value ControlFlags in the registry. I added it manually to the location you mention, but it makes no difference, it still does not recognize the 6131NFC as a Mifare tag.

  9. #9
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    53

    Re: External Reader talking to 6131 Internal MiFare

    Yes, it just worked for me ... I did need to unplug & replug the card reader but after that the sample tool provided with the API detected the card as a MiFare 4k

  10. #10
    Registered User
    Join Date
    Jul 2007
    Posts
    9

    Re: External Reader talking to 6131 Internal MiFare

    unplugging and replugging, didn't work for me. But after rebooting the PC it works fine now, thanks for your help.

  11. #11
    Regular Contributor
    Join Date
    May 2007
    Posts
    63

    Re: External Reader talking to 6131 Internal MiFare

    I tried this but OS cant boot after i change the key, i dont have the key there so i added a string value, wat type of value did u add ehindriks?

    Thanks

  12. #12
    Regular Contributor
    Join Date
    May 2007
    Posts
    63

    Re: External Reader talking to 6131 Internal MiFare

    Hi,

    A more detail description

    Under
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CardMan\RFID
    create a DWORD Value named
    ControlFlags
    and set the value for the DWORD to 0x04

  13. #13
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    53

    Re: External Reader talking to 6131 Internal MiFare

    That's what I said

  14. #14
    Registered User
    Join Date
    Sep 2008
    Posts
    34

    Re: External Reader talking to 6131 Internal MiFare

    Hi Pheonix,
    I am trying this same thing. Before I venture on the 6131 I thought I will learn it step by step.

    I have the OK 5321 and I am using JPCSC and I was able to detect card status by listeners.

    I tried the following APDU and I was able to read the UID ( I suppose)
    Apdu apdu = new Apdu(256);
    apdu.set("FFCA0000000000");

    the response I got for this is,
    console output..

    apdu3: 5: FFCA000000
    response: 9: 0409A1818A02819000
    response: 9: 0409A1818A02819000
    Disconnect from card ...
    Release context ...

    This is what I tried on a MiFare Ultralite which does not need any authentication. Do you know of list of step or APDU's i might have to follow for a Mifare 1K/4K or the 6131 Smartmx for instance to read and write ?

    would be very helpful .. if someone needs, I can post the code it is rather simple so far
    cheers
    Enya

  15. #15
    Registered User
    Join Date
    Apr 2004
    Location
    Vienna
    Posts
    321

    Re: External Reader talking to 6131 Internal MiFare

    As Mifare-Classic comes with a approprietary commands & encryption, you will not able (easily) to read/write mifare classic by using APDUs.

    For the Omnikey Reader there is a special developer document as far as I remember (on the OK-website) which explains how to read and write mifare classic with the OK reader. As this command set is proprietary, JPCSC won't support it I suppose.

    Another option would be, to gather all the information on the web, that is available on the mifare-hack and implement the encryption yourself.

    cheers, geri-m

Similar Threads

  1. Creating a 6131 readable external tag wth an external reader
    By gngulrajani in forum Near Field Communication
    Replies: 1
    Last Post: 2008-04-03, 17:47
  2. Some doubts about 6131 emulator and internal mifare 4k
    By o.ocariz in forum Near Field Communication
    Replies: 3
    Last Post: 2007-10-15, 17:40
  3. Internal Mifare card 6131
    By tdelazzari in forum Near Field Communication
    Replies: 4
    Last Post: 2007-08-23, 15:24
  4. S80 Platform SDK and Visual Studio .NET Linking Error
    By jayantjain in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2005-10-07, 22:14
  5. Unresolved external symbols problem
    By georgica1979 in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-04-06, 13:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×