AnsweredAssumed Answered

Mifare DesFire Authentication

Question asked by Henrich Gregac on Jun 4, 2016
Latest reply on Jun 16, 2016 by soledad


I would like to ask about Mifare Desfire Ev1
I have one problem with authentication 3-pass mutual.(with default MasterKey 16 bytes 0x00)
In last step when compare RndA and RndA' is not equal.But I dont know why.
Because step befor Card send Status = 0x00(is OK..Authenticate).

I created application in C# and I use SL032 reader interfae.
And this is my communication.(S-send from PC)(R-received from Card)
S:0A 00 -> R:AF DE D4 E1 04 62 13 C5 B2
S:DB 47 CC D2 10 DA 8A 43 33 2B 67 E4 DD 8D C7 95  R:00 7C B5 65 E3 8B 65 BA 74 (this is last frame from CARD first byte is Status)

And I use same implementation TripleDes(.net framework implementation TripleDESCryptoServiceProvider with CipherMode.CBC,PaddingMode.Zeros)
in first step when I decrypt(IV= 8bytes 0x00) RndB' from card it is OK.
in second step when I encrypt(IV=EncRndB[8bytes received in first step]) RndA and RndB it is OK because response from card is status:0x00.

Can you help me why in last step when I decrypt(IV = second half SendData in second Step[enc RndB']) data from card is something  wrong because is not same like RndA(I generated in first step)?

Thank you for answer.

Best Regards