From 0a820bbb67db9d790979fe530b632ec9feccb98b Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 18 Dec 2023 22:15:54 +0100 Subject: [PATCH] added some easy test for saflok key generation --- client/src/cmdhfmf.c | 17 +++++++++++++++++ client/src/cmdhfmfu.c | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 7d180db7b..32ca91191 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -3254,6 +3254,7 @@ static int CmdHF14AMfChk_fast(const char *Cmd) { bool firstChunk = true, lastChunk = false; int i = 0; + // time uint64_t t1 = msclock(); @@ -3288,6 +3289,7 @@ static int CmdHF14AMfChk_fast(const char *Cmd) { // all keys, aborted if (res == PM3_SUCCESS || res == 2) goto out; + } // end chunks of keys firstChunk = true; lastChunk = false; @@ -8906,6 +8908,21 @@ static int CmdHF14AMfInfo(const char *Cmd) { PrintAndLogEx(NORMAL, ""); PrintAndLogEx(INFO, "--- " _CYAN_("Keys Information")); + /* + 1. fast check for different KDF here + 2. mew command "hf mf keygen" + + " Vingcard algo"); + PrintAndLogEx(INFO, " Saflok algo"); + PrintAndLogEx(INFO, " SALTO algo"); + uint64_t key = 0; + mfc_algo_saflok_one(uid, 1, 0, &key); + PrintAndLogEx(INFO, " Dorma Kaba algo | %012X" PRIX64, key); + PrintAndLogEx(INFO, " STiD algo"); + PrintAndLogEx(INFO, "-------------------------------------"); + */ + + uint8_t fkey[MIFARE_KEY_SIZE] = {0}; uint8_t fKeyType = 0xff; diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index 440e05180..a5f6ac86f 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -3700,7 +3700,9 @@ static int CmdHF14AMfUPwdGen(const char *Cmd) { } PrintAndLogEx(INFO, "--------------------+----------+-----"); PrintAndLogEx(INFO, " Vingcard algo"); - PrintAndLogEx(INFO, " Saflok algo"); + uint64_t key = 0; + mfc_algo_saflok_one(uid, 0, 0, &key); + PrintAndLogEx(INFO, " Saflok algo | %012" PRIX64, key); PrintAndLogEx(INFO, " SALTO algo"); PrintAndLogEx(INFO, " Dorma Kaba algo"); PrintAndLogEx(INFO, " STiD algo");