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.
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.
Pages: 1
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
Offline
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
Pages: 1