Topic: Recycling old Mifare-Cards - Formatting does not work

Hello!

I started experimenting around with my touchatag and some mifare cards. As I still
have some old cards from which are not in use anymore I wanted to clear or format them
to put my own data on them.

Sadly, they have no default keys but I managed to get around this problem and got
them with mfoc. I put them into the default_keys[] array in the mifare-classic-format.c
but it still complains about having no valid key:

"No known authentication key for sector 0"

I double-checked the keys I got from mfoc with the ones I put into the source but still
no success.

Is there some way to just check if the key I used was correct?

Or maybe another way to "clear" a mifare-card to default values?

Greetings,
Gesar

Re: Recycling old Mifare-Cards - Formatting does not work

Did some messing around with a 1K card I had lying around and what worked for was:
With mfoc I dumped the data that was on it: dump.dump
Then from http://www.libnfc.org/documentation/exa … -mfclassic at the bottom I downloaded the empty 1K file.
In there I copied over the block 0 data (uid etc.) and saved it as empty.dump
Then wrote it to the card

nfc-mfclassic w b empty.dump dump.dump

Then dumped again with mfoc and the whole card was readable with the standard FFFFFFFFFFF key

My guess is that that's what you're looking for