×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    2

    Question Reading mifare1k, not getting expected output in last block sector

    Firstly, I am new to NFC, and the wiki and forum have been a great help. Thank you to all who contribute.

    I am reading a mifare1k. I am getting same result on the emulated card in the Nokia NFC Manager, and a physical card. I have tested this on a 6212 device and emulator.

    I read the first sector, then I print out it to the screen for debugging, I notice the first 6 octets of the last block are read as 0 and not ff. Is there a common mistake/issue I am not familiar with?

    Thanks

    Card UID : 92d1ac65

    Code:
    byte[] bKeyA = {(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff};
    MFKey.KeyA KeyA = new MFKey.KeyA(bKeyA);
    try{
    	String tagurl ="nfc:rf;type=mf1k;uid="+tp[0].getUid();
    	MFStandardConnection mfconn = (MFStandardConnection) Connector.open(tagurl);
    	MFSector sector = mfconn.getSector(0);
    	byte[] buf = new byte[sector.size()];
    	sector.read(KeyA, buf, 0, 0, sector.size());
    	for(int i =0;i<buf.length;i++){
    		if(i%16==0&&i!=0)
    			System.out.println("");
    		System.out.print(Integer.toHexString(buf[i] & 0xFF));
    	}
    	mfconn.close();
    } catch (Exception e){System.out.println(e);}
    
    /**
    OUTPUT:
    92d1ac658a8840468e36116130154
    0000000000000000
    0000000000000000
    000000ff78069ffffffffffff
    */

  2. #2
    Registered User
    Join Date
    May 2013
    Posts
    2

    Lightbulb Re: Reading mifare1k, not getting expected output in last block sector

    Nothing like a nice walk to clear the head. I am able to answer my own question. A case of RTFM, in this case the Mifare1K spec sheet.

    Short answer is Sector Trailer

    The keyA values are blanked out by returning logical zero's on a read. KeyB is not set so it returns FF as per chip delivery. Page 10 of the MF1S50yyX spec sheet.

    Hopefully this aids another lost soul with the same issue in the future.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    933

    Re: Reading mifare1k, not getting expected output in last block sector

    Thank you for sharing!

Similar Threads

  1. block reading data
    By widetech1 in forum Symbian
    Replies: 3
    Last Post: 2008-12-09, 20:08
  2. Wrong data to internal 4k on block 3 of one of sector
    By Alex_Polt in forum Near Field Communication
    Replies: 9
    Last Post: 2007-09-05, 08:07
  3. which block of the mifare1k or 4k card does the nokia nfc6131 access
    By pawangjain in forum Near Field Communication
    Replies: 2
    Last Post: 2007-06-29, 08:04
  4. which block of the mifare1k or 4k card does the nokia nfc6131 access
    By pawangjain in forum Near Field Communication
    Replies: 0
    Last Post: 2007-06-28, 08:56
  5. Power output reading on N80 Connection Manager
    By NotExcessive in forum General Development Questions
    Replies: 0
    Last Post: 2006-10-29, 13:41

Posting Permissions

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