X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/7847961b25c507b5a291c8ddb9aa1c1b222a4b11..28fdb04fd8d62e46c36f959b373d662f1a146448:/tools/mfkey/mfkey.c?ds=sidebyside diff --git a/tools/mfkey/mfkey.c b/tools/mfkey/mfkey.c index 442403f4..71e35589 100755 --- a/tools/mfkey/mfkey.c +++ b/tools/mfkey/mfkey.c @@ -11,8 +11,8 @@ int main (int argc, char *argv[]) { uint32_t nr_enc; // encrypted reader challenge uint32_t ar_enc; // encrypted reader response uint32_t at_enc; // encrypted tag response - uint32_t ks2; // keystream used to encrypt reader response - uint32_t ks3; // keystream used to encrypt tag response + uint32_t ks2; // keystream used to encrypt reader response + uint32_t ks3; // keystream used to encrypt tag response printf("MIFARE Classic key recovery\n\n"); @@ -48,7 +48,7 @@ int main (int argc, char *argv[]) { // Extract the keystream from the messages printf("\nKeystream used to generate {ar} and {at}:\n"); - ks2 = ar_enc ^ prng_successor(nt, 64); + ks2 = ar_enc ^ prng_successor(nt, 64); ks3 = at_enc ^ prng_successor(nt, 96); printf(" ks2: %08x\n",ks2); printf(" ks3: %08x\n",ks3); @@ -60,6 +60,7 @@ int main (int argc, char *argv[]) { lfsr_rollback_word(revstate, uid ^ nt, 0); crypto1_get_lfsr(revstate, &lfsr); printf("\nFound Key: [%02x %02x %02x %02x %02x %02x]\n\n",plfsr[5],plfsr[4],plfsr[3],plfsr[2],plfsr[1],plfsr[0]); + crypto1_destroy(revstate); return 0; }