]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/loclass/hash1_brute.c
2 #include "cipherutils.h"
8 #include "elite_crack.h"
10 void calc_score(uint8_t* csn
, uint8_t* k
)
14 uint8_t goodvals
[16] = {0};
15 uint8_t uniq_vals
[8] = {0};
16 memset(goodvals
, 0x00, 16);
17 memset(uniq_vals
, 0x00, 8);
22 if(k
[i
] == 0x01) continue;
23 if(k
[i
] == 0x00) continue;
24 if(k
[i
] == 0x45) continue;
28 // if(k[i] ==9 || k[i]==2){
29 // goodvals[k[i]] = 1;
37 for(i
=0; i
< 16; i
++)
45 if(score
>=2 && badscore
< 2)
47 printf("CSN\t%02x%02x%02x%02x%02x%02x%02x%02x\t%02x %02x %02x %02x %02x %02x %02x %02x\t"
48 ,csn
[0],csn
[1],csn
[2],csn
[3],csn
[4],csn
[5],csn
[6],csn
[7]
49 ,k
[0],k
[1],k
[2],k
[3],k
[4],k
[5],k
[6],k
[7]
51 for(i
=0 ; i
< score
; i
++)
53 printf("%d,", uniq_vals
[i
]);
55 printf("\tbadscore: %d (%02x)", badscore
, badval
);
63 uint8_t csn
[8] = {0,0,0,0,0xf7,0xff,0x12,0xe0};
64 uint8_t k
[8]= {0,0,0,0,0,0,0,0};
66 uint8_t testcsn
[8] ={0x00,0x0d,0x0f,0xfd,0xf7,0xff,0x12,0xe0} ;
67 uint8_t testkey
[8] ={0x05 ,0x01 ,0x00 ,0x10 ,0x45 ,0x08 ,0x45,0x56} ;
68 calc_score(testcsn
,testkey
);
69 printf("Brute forcing hashones\n");
73 //if(a > 0)printf("%d/256 done...\n", a);
74 for(b
=0;b
< 256 ; b
++)