Investigating nfc cards: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Mteivens (talk | contribs)
Mteivens (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
In this brief document i will attempt to explain how to setup your chip and pn532 NFC reader to poke around with NFc cars.
In this brief document i will attempt to explain how to setup your chip and pn532 NFC reader to poke around with NFc cars.


== Setup ==
=== Setup ===


After flashing[https://flash.getchip.com/] your chip, first thing yo need to do is install ''libnfc'' by running command  
After flashing[https://flash.getchip.com/] your chip, first thing yo need to do is install ''libnfc'' by running command  
Line 19: Line 19:
[[File:Nfc-scan-device.png]]
[[File:Nfc-scan-device.png]]


== Identifying cards ==
=== Identifying cards ===
Using this command you can check if reader detects NFC card successfully  
Using this command you can check if reader detects NFC card successfully  
  nfc-list
  nfc-list
Line 31: Line 31:
Nfc-list.png|nfc-list output
Nfc-list.png|nfc-list output
</gallery>
</gallery>
=== Basic working principles of Mifare Classic card ===
Both, ISIC and Estonian transportation cards are working on Mifare Classic chip. Bank cards use another chip which is able to emulate Mifare Classic. SEB uses Mifare Plus and Swedbank uses JCOP as far as i know.
Mifare classic`s memory is organized in 16 sectors of 4 blocks. One block contains 16 bytes.
[[File:Mifare_classic_memory_layout.png|200px]]

Latest revision as of 23:05, 11 April 2017

Investigating Mifare NFC cards with PN532 module and C.H.I.P

In this brief document i will attempt to explain how to setup your chip and pn532 NFC reader to poke around with NFc cars.

Setup

After flashing[1] your chip, first thing yo need to do is install libnfc by running command

apt-get install libnfc-bin

And add your NFC device

mkdir -p /etc/nfc/devices.d/
echo -e "name = \"PN532 board via UART\" \nconnstring = pn532_uart:/dev/ttyS0" > /etc/nfc/devices.d/pn532_uart.conf

Now you actually need to connect reader to chip. Check attached picture to see where to connect each pin.

If you did everything right, you should be able to detect the device by running

nfc-scan-device

Identifying cards

Using this command you can check if reader detects NFC card successfully

nfc-list

You can identify cards by returned ATQA/SENS_RES, SAK/SEL_RES and ATS[2] bytes manually by useing command

nfc-list

or you can use this utility[3] to make it easier. Below you can see responses from ISIC card (non bank issued one).

Basic working principles of Mifare Classic card

Both, ISIC and Estonian transportation cards are working on Mifare Classic chip. Bank cards use another chip which is able to emulate Mifare Classic. SEB uses Mifare Plus and Swedbank uses JCOP as far as i know.

Mifare classic`s memory is organized in 16 sectors of 4 blocks. One block contains 16 bytes.