Use Android Phone as NFC Tag?

Search This thread

nfc_

Member
Jul 4, 2012
7
1
This is going to be hard to get the various libs in arm format. Especially the libnfc and other nfc specific libs. But this is only needed if you really want a certain program to run, but you can always do some heavy work with a read reader on the pc and make an app on the phone to do other stuff not needing such programs.

Yeah, I found that out the hard way, it's all fun and games until the point where something isn't ARM compatible, and the sourcecode won't compile as well.
Besides, I really doubt that there is a NFC driver out there for ARM that isn't limited (ie: no writing/emulating) by Google/Android.
Although I was amazed how far I came, nearly all programs except the USB driver and some other dependicy.

Did anyone ever ran Linux from the core of the phone? Not booting an ISO within Android, but really install Linux on the phone?
 

Damastus

Member
Aug 31, 2012
49
3
Hi everybody
What about that ?

Great library If you have access to a secure element. Useless otherwise. All this does is provide a NFC Secure Element stack and API in order to communicate with it. It`s only useful to you if you can actually install your own app on the secure element and want to communicate with it by sending APDUs.
 

Nizda1

Senior Member
Nov 12, 2011
411
85
Check out adafruit's new nfc Breakout board. I use it with a ras pi or you could use arduino but the point is ras pi Im using arm archlinux, I got libnfc for PN532 and UART configured and r/w . Gwallet is another story for obvious reasons, but if you really wanna dig into nfc check it out.
 
  • Like
Reactions: exebreez

poussinvert

Member
Sep 4, 2011
35
4
Great library If you have access to a secure element. Useless otherwise. All this does is provide a NFC Secure Element stack and API in order to communicate with it. It`s only useful to you if you can actually install your own app on the secure element and want to communicate with it by sending APDUs.
Ok, thank you for your explanations.
I am not an expert in android and nfc, but this subject really interest me...
 

rayzzz

New member
Oct 16, 2012
1
1
Nickolay Elenkov (Sorry, can't post outgoing links yet: nelenkov.blogspot.nl/2012/10/emulating-pki-smart-card-with-cm91.html) has a detailed article on his blog about how to make an app with card emulation on Cyanogenmod 9.1 (he claims cm10 works as well). I haven't got it working yet, but this might have something to do with the drivers of my reader.
 
  • Like
Reactions: Lexicarnus

Robbilie

Senior Member
Jul 11, 2012
249
93
Ratingen
anybody having 2 nfc phones habing tried to simulate a mcfit membercard? since its claimed to use the default key, copying the complete ta might be easier...?nelenkov.blogspot.nl/2012/10/emulating-pki-smart-card-with-cm91.html

//Robert ;)
 

Damastus

Member
Aug 31, 2012
49
3
If I remember right, that McFit card was a Mifare Classic? Then its just not possible to emulate it. Only way to emulate it is to read the content, root a Nexus S with Mortadellos patch (I guess you could find that somewhere in here) and write the previously read content with an external reader onto the Mifare part of the SmartMX. You cannot use CyanogenMod for that. CM can only (well, at least it can do that, which is a big step forward) emulate basic ISO 14443 A & B compliant cards. Mifare Classic is ISO 14443-3 A.
 

Robbilie

Senior Member
Jul 11, 2012
249
93
Ratingen
you are right, its a mifare classic...

some nfc readers tell me the nfc tag in the mcfit card is empty, other tell me only the first block is written with the defaul key ( yeah they are stupid i know... ) and nfc classic app tells me it is emulating the nfc tag from the mcfit card when i press emulate... running a motorola razr i, doesnt even now what chip is in it...nxp?

havent tested if its really emulating since i dont have annother nfc device...
 

DVDL16

Member
Feb 23, 2010
34
6
Pretoria
...Because of this, it is indeed possible to get your phone's NFC chip associated with your account instead of a NFC card. However, the issue with Android is that your phone generates a random UID with each NFC interaction. This means that, once the security guy swipes your phone to associate it with your account, the UID will change the next time you swipe it. The only way to fix this and get a static UID would be to enable card emulation. This was done in the Nexus S with custom firmware a while ago, but has not been repeated on any other phones. If you are able to enable card emulation, your phone will emulate a generic Mifare NFC card with a static UID, and you would then be able to replace your door access card with your phone (in most cases).

Phones can't emulate specific UIDs, not because of software limitations, but because of hardware. There are other solutions out there, such as the Proxmark 3, which allows UID cloning. The Proxmark 3 makes it very easy to clone school, university and place of work access cards, as most of these rely purely on UID association.

Any of you gyus have experience with Arduino?

Would say an NFC Shield coupled with an Arduino microcontroller detect an NFC enabled phone, and complete actions based on the detection of a specific phone. Or does this NFC Shield also rely on a static UID, as LoveNFC mentioned?
 

SamsungPisser

Senior Member
Jun 17, 2011
50
7
As far as I know the NFC specification is especially designed that you can use every device as tag. It seems that this has been disabled in kernel, but it should be possible to enable it on all NFC capable phones.
 

Damastus

Member
Aug 31, 2012
49
3
As far as I know the NFC specification is especially designed that you can use every device as tag. It seems that this has been disabled in kernel, but it should be possible to enable it on all NFC capable phones.

Number 1) No its not possible on all phones, but I wont go further into that
Number 2) Even if enabled, you as a third party can't do anything
Number 3) Card Emulation is specified as optional
 

Damastus

Member
Aug 31, 2012
49
3
Could you explain it futher why I can't use that feature? I thought changing like described here http://techshek4u.blogspot.de/2012/01/applying-card-emulation-patch-to_03.html would enable it and enable that the App NFCClassic can emulate a card.

Because card emulation is done via the secure hardware module inside the phone. You don't have the keys for it. Only thing you can do is what mortadello did and get a static UID from the mifare classic that is emulated by the chip. If that is sufficient to your needs so may it be then. This works only on the nexus s.

Other idea is to check cyanogenmod out. They claim to be able to fully emulate iso 14443 A/B emulation which does not seem to work that well either.
 

vanillapuff

Member
Sep 30, 2012
44
6
Hong Kong
I have like a wireless key card and I am sure its NFC tag. Is there a way for my phone to replace the card. I know about Google wallet, but doesn't seem to be what I want. Anyone in the same situation?

Sent from my HTC One X using xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    definately not going to work. Your phone may be able to read the write command, and save this as a file, or whatever. But you will need a different approach if you want to actually emulate the card.

    This is false. These systems are based on the UID of the NFC card. The vast majority of access systems for schools and places of work don't write anything onto the card. They simply make an association in their backend system with that person's user account and the UID of their NFC card.

    Because of this, it is indeed possible to get your phone's NFC chip associated with your account instead of a NFC card. However, the issue with Android is that your phone generates a random UID with each NFC interaction. This means that, once the security guy swipes your phone to associate it with your account, the UID will change the next time you swipe it. The only way to fix this and get a static UID would be to enable card emulation. This was done in the Nexus S with custom firmware a while ago, but has not been repeated on any other phones. If you are able to enable card emulation, your phone will emulate a generic Mifare NFC card with a static UID, and you would then be able to replace your door access card with your phone (in most cases).

    It would be insane to allow phones to emulate this, then everybody would ride the train for free, enter storage areas with other ppl's tag etc.

    You might be able to recharge this yourself if you get a card r/w for your PC. Depends how pro the cantina solution is.
    Phones can't emulate specific UIDs, not because of software limitations, but because of hardware. There are other solutions out there, such as the Proxmark 3, which allows UID cloning. The Proxmark 3 makes it very easy to clone school, university and place of work access cards, as most of these rely purely on UID association.

    Here in England, trains, buses etc don't work with the system you've described, and I'd imagine it's the same for most other countries. The data (money stored, top-ups, money deducted) is written to the card in real time. Of course these types of cards have higher levels of security through the use of secret access keys. Without access to these secret access keys, you can't dump the data from an Oyster card, for example. You therefore cannot simply duplicate an Oyster card with your phone, unless the issuer provides you with the access keys or you manage to crack them on your own.
    6
    HID scanners

    I tried nfclassic and that didn't work I'm also looking for NFC card emulation

    I just wanted to weigh in and let everyone know that I do the security at my work and I was successfully able to get the Nexus 4 to be scanned by the HID scanner. It passed an ID back to the access control and I was able to set it up under my profile. I can now gain access with my phone to the same places as my badge. I tried to do the same on a Samsung Galaxy S III and it generated a random "ID" for the access control server and I wasn't able to set it up.

    -Kr@w

    -UPDATE:
    I was also successful setting it up for a EVO 4g LTE. This is big since the Nexus 4 uses a Broadcom chip and the EVO 4g LTE uses a NXP chip as far as I can tell. This in my mind points to it possibly being software that causes a random id each time. Just my 2 cents.
    4
    Hi everyone,

    I recently update my app NFC Tools, and I added a tag emulation feature in the PRO version.
    It's a start, and this is a beta feature, so please be indulgent ^^

    nfctools.preview.4.15.png


    It works with most devices, but some of them don't work together, I don't know why but I think it's a hardware problem.
    So I created this Google Form if you want to send me your tests for I try to list the devices which have problems or not.

    http://goo.gl/forms/QetokVxDa5J82T4n2

    Feel free to send me your feedback.
    3
    I thought that you needed the key in order to read all of the sectors & blocks. So, there is a key exchange between the card and reader meaning that it is a lot harder to copy the card entirely, leaving it somewhat useless.

    I've been following this thread wondering to my self how long it would take to for someone to finally explain the reason card emulation is difficult on Android devices. Kudos!...yes, the encryption keys are needed to read the encrypted info on the card, for the most part...However, there is a way to dump just raw data from the MiFare Classic card and a way to retransmit, or emulate, this data with the NFC chip on Android without the keys. However, as a previous post states, the problem with emulation is that the NFC chip changes the UID, it's not static. One does need reprogram the firmware, or ROM, of the NFC chip to enable card emulation. I'll find the article I found related to this and throw it in this post a bit later...It's quite the study though! If someone wants to throw some code out for some custom firmware flashing by all means. And even more props if anyone is able to actually flash it on the chip itself (it would require the right testing and development platform and tools of course).

    Most devices folks are using carry a NXP brand NFC chip. However, if you are the proud owner of a device with a NXP PN65 NFC chip, it has an embedded SmartMX chip, so you can forget firmware mods; it is a secondary security element that has no pins or contacts on the outside, which means it cannot be flashed.

    Interestingly though, the Nexus S has the SmartMX, and it is one of the phones listed in this thread that has effectively emulated the MiFare Classic.

    Oh, and a note to any security pros: If success with a project such as this stirs your buckets, then you know what to do...develop a method that is more secure. As you know, any worthy security measure must withstand penetration and hold it's own. Just sayin'

    From The Q, Of Course


    Live the life you love, Love the life you live
    3
    tried this w/my card and no luck reading it w/several nfc apps. however, the door reader will beep when i try my phone on it. so i think door readers use a different frequency for security. makes sense.

    If they were operating at a different frequency then your phone likely wouldn't be recognised.

    None of you will get your phones to open your doors. Google have not provided access to card emulation mode, so there's nothing for the door readers to read. Somebody here on XDA claimed that they wrote an application to send NDEF messages containing the data on their access cards and that this worked for doors etc, but they didn't share this app so I'm not sure how true that is.