mifare

What APDU command gets card ID

家住魔仙堡 提交于 2019-11-29 04:20:58
What APDU command gets 7 byte of card ID? I use T=CL (ISO7816) pritocol with ISO14443 layer. On detect card I can see only 4 byte of card ID. I searched, that is APDU command for gets card ID. For example its: 0xFF, 0xCA, 0x00, 0x00, 0x00 but result of thouse command is: 6E 00 , that on specifications of APDU answers tell that "Class not supported" Then I find, that its APDU command may be as: 0x00, 0xCA, 0x00, 0x00, 0x00 this command return 6A 88 where 6A XX - "Wrong parameter(s) P1-P2" and 88 - "Referenced data not found" What you think about it? Thank you! p.s. All command as: CLA, INS, P1,

Set own authentication keys MiFare Classic with APDU C#

99封情书 提交于 2019-11-29 02:37:38
I'm using the SMARTCARD API from CardWerk. How can I change the default key ( (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF ) using an APDU? The APDU consits of a CLASS, an INSTRUCTION, P1, P2. I have been reading documentation but I'm unable to find what parameters do I need to change the actual key to a new one. The process for changing the keys of a MIFARE Classic card is like this: Authenticate to the secor for which you want to change the key. Read the sector trailer using normal read operation (or generate a new sector trailer containing the access bytes you want

Android HCE: are there rules for AID?

感情迁移 提交于 2019-11-29 00:21:17
I'm trying to use an ACR122 NFC reader to select an application emulated in one Nexus 5 using Android Host Card Emulation. However, small AIDs are not recognized. My goal is to use a three byte long AID, as I do in a DESfire card. My first goal is only to be able to do a SELECT command. My test app uses the following configuration for AIDs: <host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android" android:description="@string/service_descr" android:requireDeviceUnlock="false" > <aid-group android:category="other" android:description="@string/aid_descr" > <aid-filter android

DESFire EV1 card emulation

只愿长相守 提交于 2019-11-29 00:15:41
I need to emulate a DESFire EV1 card on an Android device. However, I'm confused on how to use the Mifare SDK (lite or advanced) with the HCE. Is that even possible? I need to start the project and I had a lot of researches about how the data are stored and ciphered in the DESFire cards but I ended up with the fact that I need to use Mifare SDK on HCE. First of all, you cannot use the MIFARE SDK to emulate cards. The MIFARE SDK provides reader-side functionality only. Second, you cannot emulate the whole functionality of MIFARE DESFire (EV1) cards using Android HCE. However, you can emulate

How well does the Android NFC API support Mifare Desfire?

*爱你&永不变心* 提交于 2019-11-28 17:20:30
I'm likely to be working on a project where existing Desfire cards (used to access paid services) will be replaced with an NFC-capable mobile device. Can anyone point me to any resources to help me understand what's involved in a) replicating a Desfire card's data onto a mobile device so it can take the place of a card, and b) for the app to deliver NFC data in order to present to the reader as if it were a card. All relevant keys and access will be provided by the card issuer (if the project goes ahead) but I'm keen to understand the process in advance. I also need to understand how well the

DES Send and Receive Modes for DESFire Authentication

放肆的年华 提交于 2019-11-28 16:55:17
I'm trying to authenticate DESFire card with my android application. I use the example in this link to decypher the bytes I got from the card. For that, I ruled out padding in decryption (commented out below), because DESFire documentation points it out. Also, if I don't do so, decryption returns 7 bytes for input of 8 bytes. Below are DES and TripleDES decryption functions I use: public static byte[] TripleDES_Decrypt(byte[] data,byte[][] keys) { int i; byte[] tmp = new byte[data.length]; byte[] bloc = new byte[8]; K = generateSubKeys(keys[0]); K1 = generateSubKeys(keys[1]); K2 =

Can I recover a MIFARE Classic card?

别来无恙 提交于 2019-11-28 11:41:02
问题 My problem is that I used the "read and write" example on the Arduino to re-write an RFID card (MIFARE Classic 1K) block by block. I started writing at block 4. At block 7 it stopped and now I can't read any sector. I wrote zeros to each block. The DumpToSerial function just prints for every sector PCD_Authenticate() failed: Timeout in communication. It can still read the UID, the SAK, and the PICC type. Did I destroy the card or can I recover it? Some more info: Card: MIFARE Classic 1K

Android: Authenticating with NXP MiFare Ultralight C

自古美人都是妖i 提交于 2019-11-28 10:39:57
I have been trying for more than a week to make an Android phone authenticate with a Mifare Ultralight C. I have confirmed I can write to the tag (by writing to an unsecured memory page and then reading what I wrote). I can also write to the key pages (44-47) and have written 0x00 for all 16 key bytes. When I try to authenticate, the following is an example of the data involved during one exchange - it is from a log written by my application. Can anyone tell me if I am doing something incorrect? I AM under non-disclosure and have access to the full data sheets. Note that the hexadecimal

How to detect NFC tag was removed

笑着哭i 提交于 2019-11-28 09:49:53
问题 I am new at NFC technology. I am trying to read and write Mifare Classic 4K tags. I succeeded reading and writing. I can detect the tag on onNewIntent action. My problem is that I could't detect when an NFC tag was removed (similar to onNewIntent when detecting a tag). How can I solve this problem? 回答1: There is no event that notifies your app if a tag is removed from the reader. A typical approach to detect removal is to actively poll the tag (e.g. by reading an NDEF message or a data block)

NTAG212 Mifare Ultralight with Authentication

倖福魔咒の 提交于 2019-11-28 09:34:05
I am new to NFC Android and I have been stuck for days trying to get the Page 4 to page 7 of NTAG212 Mifare Ultralight with Authentication , I already have the PWD and PACK to do the PWD_AUTH based on the NTAG212 Docs. I do this approach... //assume password as array of bytes //assume pack as array of bytes try{ nfc.connect(); byte[] cmd1 = nfc.transceive(new byte[]{ (byte) 0x30, (byte) 0x00 }); //read the page 0 to make the NFC active nfc.transceive(new byte[]{ (byte) 0x1B, //command for PWD_AUTH pass[0], pass[1], pass[2], pass[3] }); byte[] cmd4 = nfc.transceive(new byte[]{ (byte) 0x30,