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 2011-01-14 22:05:06

romain
Member
Registered: 2010-01-03
Posts: 3

Parity check during authentication

Hello

I would like to do parity checking during authentication on a Mifare Classic 1k.

After sending the tag nounce I receive the 8 bytes of response, checking the 4 first bits is straightforward:

      for (i = 0; i < 4; i++) {
        reader_nounce[i] = crypto1_byte (&cs, data[i], 1) ^ data[i];

        if (parity[i] != (filter (cs.odd) ^ odd_parity[reader_nounce[i]])) {
          // Wrong parity
        }   
      }

However, the 4 following bytes are a bit more tricky.  I was unable to find some document which says what thoses bits are expected to be, so I did some experiments and it seems that the parity bits of the successor of the nounce are base on the nounce itself:

      BYTE pcd_succ2_tag_nounce[4];
      for (i = 4; i < 8; i++) {
        pcd_succ2_tag_nounce[i-4] = crypto1_byte(&cs, 0x00, 0) ^ data[i];
        if (parity[i] == (filter (cs.odd) ^ tag_nounce[i-4])) {
          // Wrong parity
        }
      }

This seems to work, but looks totally odd to for me, so am I missing something, or is it just the way things or done?  Do you have any pointer to some document that would say this is the good way to check?

Thanks!

Romain

Offline

#2 2011-01-24 00:11:32

rule
Member
Registered: 2008-05-21
Posts: 417

Re: Parity check during authentication

Hey Romain,

Does this or this post help you with your question.

This basically sows you how to handle the parity for a complete authentication.
Let me know if you have any questions related to this problem wink

Cheers,

  Roel

Offline

#3 2011-01-24 00:24:59

romain
Member
Registered: 2010-01-03
Posts: 3

Re: Parity check during authentication

Hey Roel,

Thank you for your reply, however I already saw these posts (and they helped me a lot!) but now that I send the good parity bits, I am willng to check if those I receive from the PCD are correct or not (to detect transmission error in the encyphered frames I receive).

A can't see this part of the parity checking in those posts (I just see how to generate good ones).

Thanks!
Romain

Offline

Board footer

Powered by FluxBB