Topic: mifare_desfire_authenticate's doubt

Hi everyone,

I want to make a program that accesses a DESFire and I have a doubt function mifare_desfire_authenticate(MifareTag tag, uint8_t key_no, MifareDESFireKey key). This function must be given as an argument MifareDESFireKey structure, this structure is the variable data, which I think is the encryption key, but the function don't use  this variable.

My question is, is this function can be started any card or only those that have an 0s encryption key?

Thanks

Re: mifare_desfire_authenticate's doubt

Hi

Please see Issue 49: mifare_desfire_authenticate's doubt.

Re: mifare_desfire_authenticate's doubt

Hello,

These function mifare_cbc_des & mifare_des can't use key->data or I don't see...

And key->data, is it the authentication key (rnda with rndb) or the encryption key (the key to the data to transfer)???


thanks

Last edited by Slalen (2010-11-18 12:42:18)

Re: mifare_desfire_authenticate's doubt

Hi

mifare_desfire_authenticate()'s key argument is the authentication key.  The session key is computed at the end:
http://code.google.com/p/nfc-tools/sour … fire.c#392

key->data is never used directly.  See the mifare_desfire_key struct:
http://code.google.com/p/nfc-tools/sour … rnal.h#172

It has it's ks* members filled in in the keys creation functions, which all call update_key_schedules():
http://code.google.com/p/nfc-tools/sour … e_key.c#30

Theses so-called schedules are then used in mifare_des():
http://code.google.com/p/nfc-tools/sour … cate.c#290

Does it helps ?

Re: mifare_desfire_authenticate's doubt

Ok

Now I understand all.

Thanks!!!!