add module
This commit is contained in:
1 parent
195ad52151
commit
99bc47c1ac
6 files changed
+66
-1
No files matched your search
@@ -228,6 +228,7 @@ set (TARGET_SOURCES
|
|||||||
${PM3_ROOT}/client/src/mifare/mifaredefault.c
|
${PM3_ROOT}/client/src/mifare/mifaredefault.c
|
||||||
${PM3_ROOT}/client/src/mifare/mifarehost.c
|
${PM3_ROOT}/client/src/mifare/mifarehost.c
|
||||||
${PM3_ROOT}/client/src/nfc/ndef.c
|
${PM3_ROOT}/client/src/nfc/ndef.c
|
||||||
|
${PM3_ROOT}/client/src/mifare/lrpcrypto.c
|
||||||
${PM3_ROOT}/client/src/mifare/desfirecrypto.c
|
${PM3_ROOT}/client/src/mifare/desfirecrypto.c
|
||||||
${PM3_ROOT}/client/src/mifare/desfiresecurechan.c
|
${PM3_ROOT}/client/src/mifare/desfiresecurechan.c
|
||||||
${PM3_ROOT}/client/src/mifare/desfirecore.c
|
${PM3_ROOT}/client/src/mifare/desfirecore.c
|
||||||
|
|||||||
@@ -588,6 +588,7 @@ SRCS = mifare/aiddesfire.c \
|
|||||||
loclass/cipherutils.c \
|
loclass/cipherutils.c \
|
||||||
loclass/elite_crack.c \
|
loclass/elite_crack.c \
|
||||||
loclass/ikeys.c \
|
loclass/ikeys.c \
|
||||||
|
mifare/lrpcrypto.c \
|
||||||
mifare/desfirecrypto.c \
|
mifare/desfirecrypto.c \
|
||||||
mifare/desfirecore.c \
|
mifare/desfirecore.c \
|
||||||
mifare/desfiresecurechan.c \
|
mifare/desfiresecurechan.c \
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <mbedtls/pk.h>
|
#include <mbedtls/pk.h>
|
||||||
|
|
||||||
|
#define CRYPTO_AES_BLOCK_SIZE 16
|
||||||
|
#define CRYPTO_AES128_KEY_SIZE 16
|
||||||
|
|
||||||
void des_encrypt(void *out, const void *in, const void *key);
|
void des_encrypt(void *out, const void *in, const void *key);
|
||||||
void des_decrypt(void *out, const void *in, const void *key);
|
void des_decrypt(void *out, const void *in, const void *key);
|
||||||
void des_encrypt_ecb(void *out, const void *in, const int length, const void *key);
|
void des_encrypt_ecb(void *out, const void *in, const int length, const void *key);
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "crypto/libpcrypto.h"
|
#include "crypto/libpcrypto.h"
|
||||||
|
|
||||||
#define CRYPTO_AES_BLOCK_SIZE 16
|
|
||||||
#define MAX_CRYPTO_BLOCK_SIZE 16
|
#define MAX_CRYPTO_BLOCK_SIZE 16
|
||||||
#define DESFIRE_MAX_CRYPTO_BLOCK_SIZE 16
|
#define DESFIRE_MAX_CRYPTO_BLOCK_SIZE 16
|
||||||
#define DESFIRE_MAX_KEY_SIZE 24
|
#define DESFIRE_MAX_KEY_SIZE 24
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*-
|
||||||
|
* Copyright (C) 2021 Merlok
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "lrpcrypto.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <util.h>
|
||||||
|
#include "ui.h"
|
||||||
|
#include "aes.h"
|
||||||
|
#include "commonutil.h"
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*-
|
||||||
|
* Copyright (C) 2021 Merlok
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __LRPCRYPTO_H
|
||||||
|
#define __LRPCRYPTO_H
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include "crypto/libpcrypto.h"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t key[CRYPTO_AES128_KEY_SIZE];
|
||||||
|
} LRPContext;
|
||||||
|
|
||||||
|
void LRPSetKey(LRPContext *ctx);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __LRPCRYPTO_H
|
||||||
Reference in new issue
Block a user