Cracking Mifare Ultralight

Posted on  by  admin

Cracking Mifare Ultralight 7,1/10 9066 votes

Last month, the Dutch government issued a warning about the security of access keys based on the ubiquitous MiFare Classic RFID chip. Thewarning comes on the heels of an ingenious hack, spearheaded by Henryk Plotz, a German researcher, and Karsten Nohl, a doctoral candidate incomputer science at the University of Virginia, that demonstrated a way to crack the encryption on the chip.

The MIFARE Ultralight ® family currently consists of three family members which provide system integrators with maximum flexibility for complete system solutions including but not limited to time-based, zone-based or multiple-ride tickets as well as single use tickets. The MiFare RFID hack, writes Geeta Dayal, used a few tools not in the arsenal of your average code-duffer. But now that researchers have done the heavy lifting, subsequent cracks will be much, much simpler.

Millions upon millions of MiFare Classic chips are used worldwide in contexts such as payment cards for public transportationnetworks throughout Asia, Europe and the U.S. and in building-access passes.

The report asserts that systems employing MiFare will likely be secure for another two years, since hacking the chipseems to be an involved and expensive process. But in a recent report published by Nohl, titled 'Cryptanalysis of Crypto-1,' he presents anattack that recovers secret keys in mere minutes on an average desktop PC.

In December, Nohl and Plotz gave a presentation on MiFare's security vulnerabilities at the 24th Chaos Communications Congress (24C3), the annual four-day conference organized by Germany's notorious hacking collective, the Chaos Computer Club (CCC). Thousands of hackers from far-flung locales converged on Berlin between Christmas and New Year's for a raft of talks and project demonstrations.

Mifare ultralight

In their popular talk at 24C3, punctuated by bursts of raucous applause, Nohl presented an overview of radio frequency identification security vulnerabilities and the process of hacking the MiFare chip's means of encryption, known as the Crypto-1 cipher. 'This is the first public announcement that the Crypto-1 cipher on the MiFare tag is known,' said Nohl in December at the 24C3 talk. 'We will give out further details next year.'

Get out the microscopes

To hack the chip, Nohl and Plotz reverse-engineered the cryptography on the MiFare chip through a painstaking process. They examined theactual MiFare Classic chip in exacting detail using a microscope and the open-source OpenPCD RFID reader and snapped several in-depthphotographs of the chip's architecture. The chip is tiny -- about a 1-millimeter-square shred of silicon -- and is composed sed of severallayers.

Mifare

The researchers sliced off the minuscule layers of the chip and took photos of each layer. There are thousands of tiny blocks on thechip -- about 10,000 in all -- each encoding something such as an AND gate or an OR gate or a flip-flop.

Mifare Ultralight Ev1

Analyzing all of the blocks on the chip would have taken forever, but there was a shortcut. 'We couldn't actually look at all 10,000 of these small building blocks, so we wanted to categorize them a bit before we started analyzing,' said Nohl at 24C3. 'We observed that there aren't actually 10,000 different ones. They're all taken from a library of cells. There are only about 70 different types of gates; we ended up writing MATLAB scripts that once we select one instance of a gate finds allthe other ones.'

To find the cryptographically important regions of the chip, Nohl and Plotz scanned for clues in the blocks: long strings of flip-flops thatwould implement the register important to the cipher, XOR gates that are virtually never used in control logic, and blocks on the edge ofthe chip that were sparsely connected to the rest of the chip, but strongly connected to each other.

They then reconstructed the circuit using their data, and from the reconstruction, they read the functionality. It was a painful process, but once it was done, the researchers had decoded the security on the chip, unveiling several vulnerabilities. Among the potential securityrisks they uncovered was a 16-bit random number generator that was easy to manipulate -- so easy, in fact, that they were able to coax thegenerator into producing the same 'random' number in every transaction, effectively crippling the security.

Simpler from here on out

A potential attacker wouldn't have to go through all of the steps that Nohl and Plotz had to undertake to hack the RFID chip. A diagram ofthe Crypto-1 cipher, published in Nohl's recent paper, shows that the heart of the cipher is a 48-bit linear feedback shift register and afilter function. To find bits of the key, an attacker would send challenges to the reader and analyze the first bit of key stream sentback to the reader.

Though there are some tricks to generating these challenges, it is computationally not a terribly expensive, or expansive, procedure.'The number of challenges needed to recover key bits with high probability varies for different bits, but generally does not exceed afew dozen,' writes Nohl in the paper.

At 24C3, Nohl warned against the increasing ubiquity of RFID tags. 'We need some level of authentication, some security that has yet to be added to many of these applications,' he said. He pointed to the increasing use of RFID tags in public transit systems, car keys,passports, and even World Cup tickets -- and the potential worrying privacy implications of large-scale RFID tagging of products by big retailers such as Wal-Mart Stores Inc.

The gist? If you rely on MiFare Classic security for anything, you may want to start moving to a different system.

Hi everybody,
I recently finished working on a new app. It basically allows you to handle Mifare Ultralight tags.
Mifare Ultralight tags are inexpensive tags that are being used world-wide for a number of different tasks: public transportation, events, authentications and so on. The best thing about it (from my wicked point of view) is that it is not encrypted, which means that you can easily read/write those tags (as long as the contents of the tag can be overwritten).
As far as I know, there are some apps available for reading/writing tags, but most of them are either expensive or only allow you to write one word (32 bit) at a time, resulting in a long and boring process when you need to create a tag from scratch (i.e. writing 16 words on it), or editing multiple words.
This is why I came up with UltraManager. If you are in possess of Mifare Ultralight tags and you would like to find out more about their contents, this is the app you need.
At first I thought of only selling the app; but since the number of systems using Mifare Ultralight tags is getting higher as the time goes by, I wanted to allow as many people as possible to put their hands on those systems.
This is why I developed both a Lite and a Pro version. If you are only interested in doing some basic operations with your Mifare Ultralight tag, the Lite version will do just fine. There are no ads, and you will be able to read, edit and write tags.
If you find the app useful, or you need other features, there is a Pro version available as well: many other options are available for this version. The price for the Pro version is € 0.99 ($ 1.36).
The permissions required by both the Lite and the Pro apps are:
Network communication - control Near Field Communication
UltraManager Lite - Google Play
UltraManager Pro - Google Play
Any comment, suggestion and feedback is welcomed.
Thank you all,
Flavio 'darkjoker' Giobergia
Coments are closed
Scroll to top