Add initial suport for MIFARE Key Diversification

This adds two new options to `hf mfdes auth`

```
    -d, --kdf <kdf>                Key Derivation Function (KDF) (0=None, 1=AN10922)
    -i, --kdfi <kdfi>              KDF input (HEX 1-31 bytes)
```

By specifying `-d 1` and some kdf data `-i 00112233`, the key will be
diversified using AN10922.
This commit is contained in:
NZSmartie 2020-10-31 20:54:28 +13:00
commit b788054aca
No known key found for this signature in database
GPG key ID: B7E1258B1896B531
4 changed files with 97 additions and 10 deletions

View file

@ -94,6 +94,11 @@ typedef enum {
MFDES_ALGO_AES = 4
} mifare_des_authalgo_t;
typedef enum {
MFDES_KDF_ALGO_NONE = 0,
MFDES_KDF_ALGO_AN10922 = 1,
} mifare_des_kdf_algo_t;
//-----------------------------------------------------------------------------
// "hf 14a sim x", "hf mf sim x" attacks
//-----------------------------------------------------------------------------