Reading and writing Mifare Classic 1K RFID on Nexus-S

I'd like to be able to write and read strings from a Mifare 1K RFID. I successfully read and wrote to the tag I have using the NXP TagWriter App. I then tried the code here, but was able to get anything meaningful out of it. It wouldn't even authenticate until I changed

auth = mfc.authenticateSectorWithKeyA(0, MifareClassic.KEY_DEFAULT);

TO

auth = mfc.authenticateSectorWithKeyA(0, MifareClassic.KEY_MIFARE_APPLICATION_DIRECTORY);

But only got this as output:

BLOCK 0: 298091JFIS8903JF0SDF093
BLOCK 1: 298091JFIS8903JF0SDF093

Not sure what to make of it and what the process of reading and writing to the card would be. Any examples or directions would be very helpful!

Answers


Have you tried the code above on a blank Mifare 1K Classic tag?

Just removing one variable. It could be that the NXP TagWriter App changes the authentication key on its first write, preventing other programs from writing to it.


Need Your Help

How to use different behaviours in the same ViewModel?

wpf oop mvvm

I have the view designed for the long running tasks. It has a header and a progress bar.

Get signal strength of WIFI and Mobile Data

android performance connection switch-statement wifi

In my app I need to check the connection speed of both WiFi and Mobile Data and then compare it, then switch to which ever network has the highest speed.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.