mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
hiclass
This commit is contained in:
parent
b9974e1224
commit
586cbd2137
2 changed files with 7 additions and 7 deletions
|
@ -766,8 +766,8 @@ int CmdHFiClassDecrypt(const char *Cmd) {
|
||||||
hdr->csn[4],hdr->csn[5],hdr->csn[6],hdr->csn[7]);
|
hdr->csn[4],hdr->csn[5],hdr->csn[6],hdr->csn[7]);
|
||||||
|
|
||||||
// tripledes
|
// tripledes
|
||||||
des3_context ctx = { DES_DECRYPT ,{ 0 } };
|
mbedtls_des3_context ctx = { 0 };
|
||||||
des3_set2key_dec( &ctx, key);
|
mbedtls_des3_set2key_dec( &ctx, key);
|
||||||
|
|
||||||
uint8_t enc_dump[8] = {0};
|
uint8_t enc_dump[8] = {0};
|
||||||
uint8_t empty[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
|
uint8_t empty[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
|
||||||
|
@ -778,7 +778,7 @@ int CmdHFiClassDecrypt(const char *Cmd) {
|
||||||
|
|
||||||
// block 7 or higher, and not empty 0xFF
|
// block 7 or higher, and not empty 0xFF
|
||||||
if(blocknum > 6 && memcmp(enc_dump, empty, 8) != 0 ) {
|
if(blocknum > 6 && memcmp(enc_dump, empty, 8) != 0 ) {
|
||||||
des3_crypt_ecb(&ctx, enc_dump, decrypted + idx );
|
mbedtls_des3_crypt_ecb(&ctx, enc_dump, decrypted + idx );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,10 +797,10 @@ static int iClassEncryptBlkData(uint8_t *blkData) {
|
||||||
PrintAndLogEx(SUCCESS, "decryption file found");
|
PrintAndLogEx(SUCCESS, "decryption file found");
|
||||||
uint8_t encryptedData[16];
|
uint8_t encryptedData[16];
|
||||||
uint8_t *encrypted = encryptedData;
|
uint8_t *encrypted = encryptedData;
|
||||||
des3_context ctx = { DES_DECRYPT ,{ 0 } };
|
mbedtls_des3_context ctx = { 0 };
|
||||||
des3_set2key_enc( &ctx, key);
|
mbedtls_des3_set2key_enc( &ctx, key);
|
||||||
|
|
||||||
des3_crypt_ecb(&ctx, blkData,encrypted);
|
mbedtls_des3_crypt_ecb(&ctx, blkData,encrypted);
|
||||||
memcpy(blkData,encrypted,8);
|
memcpy(blkData,encrypted,8);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "comms.h"
|
#include "comms.h"
|
||||||
#include "des.h"
|
#include "mbedtls/des.h"
|
||||||
#include "loclass/cipherutils.h"
|
#include "loclass/cipherutils.h"
|
||||||
#include "loclass/cipher.h"
|
#include "loclass/cipher.h"
|
||||||
#include "loclass/ikeys.h"
|
#include "loclass/ikeys.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue