On the o ne hand, the wireless interface has pra ctical advantages: without me-
chanical compo nents between readers and cards, the sy stem has lower maintenance
costs, is more reliable, and has shorter reading times, providing higher throughput.
On the other ha nd, it represents a potential threat to privacy [
3] and it is susceptible
to relay, replay and skimming attacks that were no t poss ible before.
There is a huge variety of cards on the market. They differ in size, casing, memory
and computing power. They also differ in the security features they provide. A well
known and widely used sy stem is mifare. mifare is a product family from NXP semi-
conductors (formerly Philips). According to NXP there are about 200 million mifare
cards in use around the world, covering 85 % of the contactless s martcard market.
The mifare family contains four different types of cards: Ultralight, Standard, DES-
Fire and SmartMX. The mifare Classic cards come in three different memory sizes:
320B, 1KB and 4KB. The mifare Classic is the most widely used contactless c ard
in the market. Throughout this paper we focus on this card. mifare Classic provides
mutual authentication and data secrecy by means of the so called CRYPTO1 strea m
cipher. This cipher is a proprietary algorithm of NXP and its design is kept secret.
Nohl and Pl¨otz [
7] have recently reverse engineered the hardware of the chip
and exposed several weaknesses. Among them, due to a weakness on the ps e udo-
random generator, is the observation that the 32-bit nonces used for authentication
have only 16 bits of entropy. They also noticed that the pseudo-random generator
is stateless. They claim to have knowledge of the exact encryption a lgorithm which
would facilitate an off-line brute force attack o n the 48-bit keys. Such an attack
would be feasible, in a reasonable amount of time, especially if dedicated hardware
is available.
Our Contribution We used a Proxmark III
4
to analyze mifare cards and mount
an a ttack. To do s o, we have implemented the ISO 1444 3-A functionality on the
Proxmark, since only ISO 14443-B was implemented at tha t time. We programmed
both processing and generation of reader- to-tag and tag-to-reader communication at
physical and higher levels of the protocol. The source code of the firmware is available
in the public domain
5
. Concurrently, and independently from Nohl and Pl¨otz results,
we also noticed a weakness in the pseudo-random generator.
Our co ntribution is threefold: First and foremost, using the weakness of the
pseudo-random generator, and given access to a particular mifare card, we are able
to recover the keystream g e nerated by the CRYPTO1 s tream cipher, without know-
ing the encryption key. Secondly, we describe in detail the communication between
tag and reader. Finally, we exploit the malleability of the stream cipher to read all
memory blocks of the first sector (sector zero) of the card (without having access to
the secret key). In general, we are able to read any sector of the memory of the card,
provided that we know one memory block within this sector. After eavesdropping a
transaction, we are always able to read the first 6 bytes of every block in that sector,
and in most cases also the last 6 bytes. This leaves only 4 unrevealed bytes in those
blocks.
4
http://cq.cx/proxmark3.pl
5
http://www.proxmark.org