Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

You are not logged in.

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2018-05-02 11:02:16

124829359
Contributor
Registered: 2018-05-02
Posts: 2

Mifare simulation authenticate failed

Hi guys,

I am a software engineer working in smart card industry for some years.
Now I am trying to port mifare simulation functions to smart card operating system, however my pm3 can't pass authentication on all readers I got. And I make some self test code to verify my crypto1 algorithm works properly.

First I monitor a NXP card and got the following log:
CYZQyV.png

Then I use these data in my self test code:

CYZeij.jpg

Looks like my code stop at line 1022 (returns a 1):
CYnpW9.png

Expected cardRr is 0xC725BF0D, while my card got a 0xCC1706F01.

I read some paper & code and try to find out why, but days passed still can't.

Can anyone point me out where need to correct? Thank you in advance.

If any further info needed, kindly let me know.

Offline

#2 2018-05-02 16:27:06

piwi
Contributor
Registered: 2013-06-04
Posts: 704

Re: Mifare simulation authenticate failed

  1. in line 981: you are assuming big endian word order for 64Bit values. This is not correct for Intel CPUs. Why don't you use uint64_t for the key?

  2. in line 981: even if your assumption about the word order would be correct, the second part of your key is incomplete. It needs to be 0xFFFFFFFF instead of 0xFFFFFF.

  3. in line 992: you pass the address of the array instead of the key itself.

The compiler should have complained a lot.

Offline

Board footer

Powered by FluxBB