I'm learning for the university and have to do a Mifare Classic replay attack. I don't really know how to do that and hope some of you can help me at least a bit.
The goal is to get the number of iterations after the start of the random number generator of the valid session.
Here is the information I got:
Random Number Zx:
2225499778
Seed:
1735622233
Polynomial:
x^24 + x^23 + x^22 + x^21 + x^19 + x^18 + x^17 + x^13 + x^5 + x^4 + x^3 + x^2 + 1
I have already implemented a basic LFSR in C but don't know what to do next:
#include <sys/types.h>
#include <stdio.h>
#define INITIAL 67737E59
int main(void) {
__int32 reg = INITIAL;
__int32 bit;
do {
bit = (reg & 0x0001) ^
((reg & 0x0004) >> 2) ^
((reg & 0x0008) >> 3) ^
((reg & 0x0020) >> 5);
reg = (reg >> 1) | (bit << 23);
printf("%i", bit);
} while (reg != INITIAL);
return 0;
}