1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
librfid - low-level RFID access library
(C) 2005 by Harald Welte <laforge@gnumonks.org>
======================================================================
This library intends to provide a reader- and (as much as possible)
PICC / tag independent API for RFID applications.
1. Supported Prodocols:
At this early stage of implementaition, it offers only ISO 14443-2, ISO 14443-3
A and B as well as ISO 14443-4 (T=CL) support. Other protocols, both open
(such as ISO 15693) and proprietary are to be added as soon as I find some more
time.
2. Supported Readers:
At this time only the Omnikey Cardman 5121 reader is supported.
The cm5121 is a relatively stupid piece of hardware. Basically a contact-based
cm3121 that was enhanced by putting a Philips CL RC632 reader ASIC next to it.
There is no RFID protocol implementation on the cm5121, everything is done on
the host (PC) software. Four primitives (read/write byte/fifo) are provided
via simple PC_to_RDR_Escape CCID messages.
This makes it the ideal device to learn and play with RFID, since you don't
have any (proprietary) software interfere and puts you in full control of
everything.
Support for more devices shouldn't be too difficult to add, provided the
devices are stupid enough. More sophisticated readers like Integrated
Engineering or Philips Pegoda do much of the protocol handling in firmware on a
Microcontroller. This makes them (at least till now) faster, but also of
limited use, especially in education and research.
So if you happen to run into any other dumb RFID readers, especially those
based on Philips CL RC531 and RC632, adding support should be very
straightforward. If you want to contract me for implementing a driver backend,
don't hesitate to contact me.
3. Installation
In order to run librfid, you need a reader transport backend that provides a
PC_to_RDR_Escape function. The current version of this library offers two backends
3.1 (new) native CCID backend
If you add the '--with-ccid' option to the './configure' command, then the new
native CCID driver (courtesy of Werner Koch) will be linked into the library.
This requires a working libusb with development headers.
In order to use the reader, you will need to set the permissions of the respective
/proc/bus/usb or /sys/bus/usb files (or run the application as root, if you
trust my code, which you shouldn't).
3.2 (old) OpenCT backend
This backend has the advantage that it will allow you to use the contact-based
part and the contactless part of the CM5121 simultaneously. However, it requires
a patched version of OpenCT.
A patch against openct-0.6.7 is available as openct-0.6.7-librfid.patch.
Please note that while librfid in this configuration _uses_ OpenCT as a
lower-layer transport interface, it doesn't actually provide a virtual reader
interface to it, i.e. you can't use CT-API/OpenCT/PCSC API's to access RFID
transponders.
4. Testing
In the 'utils' directory, you will get a 'librfid-tool' binary. It is very
minimalistic, and mainly an example on how to use the librfid api. For an ICAO
compliant passport, you may try "--protocol tcl". For a mifare ultralight transponder,
"--protocol mifare-ultralight" will give you a full dump of the transponder.
-- Harald Welte <laforge@gnumonks.org>
|