]>
Commit | Line | Data |
---|---|---|
f89c7050 M |
1 | //----------------------------------------------------------------------------- |
2 | // Merlok - June 2011 | |
3 | // Roel - Dec 2009 | |
4 | // Unknown author | |
cd91e41c | 5 | // iceman - may 2015 |
f0e183ec | 6 | // marshmellow42 - june 2016 |
f89c7050 M |
7 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, |
8 | // at your option, any later version. See the LICENSE.txt file for the text of | |
9 | // the license. | |
10 | //----------------------------------------------------------------------------- | |
11 | // MIFARE Darkside hack | |
12 | //----------------------------------------------------------------------------- | |
13 | ||
f397b5cc M |
14 | #ifndef __NONCE2KEY_H |
15 | #define __NONCE2KEY_H | |
16 | ||
f89c7050 | 17 | #include <stdio.h> |
bfaecce6 | 18 | #include <stdlib.h> |
f397b5cc | 19 | #include "crapto1.h" |
db09cb3a | 20 | #include "common.h" |
59e933fc | 21 | #include "mifare.h" // nonces_t struct |
22 | #include "ui.h" // PrintAndLog | |
f0e183ec | 23 | #include "proxmark3.h" |
24 | #include "mifarehost.h" | |
f89c7050 | 25 | |
f0e183ec | 26 | extern int nonce2key(uint32_t uid, uint32_t nt, uint32_t nr, uint64_t par_info, uint64_t ks_info, uint64_t * key); |
59e933fc | 27 | extern int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, uint32_t nr, uint64_t ks_info, uint64_t * key); |
cd91e41c | 28 | |
29 | //iceman, added these to be able to crack key direct from "hf 14 sim" && "hf mf sim" | |
ba39db37 | 30 | bool tryMfk32(nonces_t data, uint64_t *outputkey, bool verbose ); |
31 | bool tryMfk32_moebius(nonces_t data, uint64_t *outputkey, bool verbose); // <<-- this one has best success | |
cd91e41c | 32 | int tryMfk64_ex(uint8_t *data, uint64_t *outputkey ); |
33 | int tryMfk64(uint32_t uid, uint32_t nt, uint32_t nr_enc, uint32_t ar_enc, uint32_t at_enc, uint64_t *outputkey); | |
f397b5cc | 34 | #endif |