TrueCrypt/VeraCrypt cracking: Do an entropy check on the TC/VC header on start
This commit is contained in:
@@ -19,6 +19,12 @@
|
||||
static const char LM_ZERO_HASH[] = "aad3b435b51404ee";
|
||||
static const char LM_MASKED_PLAIN[] = "[notfound]";
|
||||
|
||||
/**
|
||||
* entropy check (truecrypt, veracrypt, ...)
|
||||
*/
|
||||
|
||||
static const float MIN_SUFFICIENT_ENTROPY_FILE = 7.0f;
|
||||
|
||||
/**
|
||||
* algo specific
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
||||
bool overflow_check_u32_add (const u32 a, const u32 b);
|
||||
bool overflow_check_u32_mul (const u32 a, const u32 b);
|
||||
@@ -70,4 +71,7 @@ u64 round_up_multiple_64 (const u64 v, const u64 m);
|
||||
|
||||
void hc_strncat (u8 *dst, u8 *src, const size_t n);
|
||||
|
||||
int count_char (const u8 *buf, const int len, const u8 c);
|
||||
float get_entropy (const u8 *buf, const int len);
|
||||
|
||||
#endif // _SHARED_H
|
||||
|
||||
+38
-37
@@ -448,43 +448,44 @@ typedef enum outfile_fmt
|
||||
|
||||
typedef enum parser_rc
|
||||
{
|
||||
PARSER_OK = 0,
|
||||
PARSER_COMMENT = -1,
|
||||
PARSER_GLOBAL_ZERO = -2,
|
||||
PARSER_GLOBAL_LENGTH = -3,
|
||||
PARSER_HASH_LENGTH = -4,
|
||||
PARSER_HASH_VALUE = -5,
|
||||
PARSER_SALT_LENGTH = -6,
|
||||
PARSER_SALT_VALUE = -7,
|
||||
PARSER_SALT_ITERATION = -8,
|
||||
PARSER_SEPARATOR_UNMATCHED = -9,
|
||||
PARSER_SIGNATURE_UNMATCHED = -10,
|
||||
PARSER_HCCAPX_FILE_SIZE = -11,
|
||||
PARSER_HCCAPX_EAPOL_LEN = -12,
|
||||
PARSER_PSAFE2_FILE_SIZE = -13,
|
||||
PARSER_PSAFE3_FILE_SIZE = -14,
|
||||
PARSER_TC_FILE_SIZE = -15,
|
||||
PARSER_VC_FILE_SIZE = -16,
|
||||
PARSER_SIP_AUTH_DIRECTIVE = -17,
|
||||
PARSER_HASH_FILE = -18,
|
||||
PARSER_HASH_ENCODING = -19,
|
||||
PARSER_SALT_ENCODING = -20,
|
||||
PARSER_LUKS_FILE_SIZE = -21,
|
||||
PARSER_LUKS_MAGIC = -22,
|
||||
PARSER_LUKS_VERSION = -23,
|
||||
PARSER_LUKS_CIPHER_TYPE = -24,
|
||||
PARSER_LUKS_CIPHER_MODE = -25,
|
||||
PARSER_LUKS_HASH_TYPE = -26,
|
||||
PARSER_LUKS_KEY_SIZE = -27,
|
||||
PARSER_LUKS_KEY_DISABLED = -28,
|
||||
PARSER_LUKS_KEY_STRIPES = -29,
|
||||
PARSER_LUKS_HASH_CIPHER = -30,
|
||||
PARSER_HCCAPX_SIGNATURE = -31,
|
||||
PARSER_HCCAPX_VERSION = -32,
|
||||
PARSER_HCCAPX_MESSAGE_PAIR = -33,
|
||||
PARSER_TOKEN_ENCODING = -34,
|
||||
PARSER_TOKEN_LENGTH = -35,
|
||||
PARSER_UNKNOWN_ERROR = -255
|
||||
PARSER_OK = 0,
|
||||
PARSER_COMMENT = -1,
|
||||
PARSER_GLOBAL_ZERO = -2,
|
||||
PARSER_GLOBAL_LENGTH = -3,
|
||||
PARSER_HASH_LENGTH = -4,
|
||||
PARSER_HASH_VALUE = -5,
|
||||
PARSER_SALT_LENGTH = -6,
|
||||
PARSER_SALT_VALUE = -7,
|
||||
PARSER_SALT_ITERATION = -8,
|
||||
PARSER_SEPARATOR_UNMATCHED = -9,
|
||||
PARSER_SIGNATURE_UNMATCHED = -10,
|
||||
PARSER_HCCAPX_FILE_SIZE = -11,
|
||||
PARSER_HCCAPX_EAPOL_LEN = -12,
|
||||
PARSER_PSAFE2_FILE_SIZE = -13,
|
||||
PARSER_PSAFE3_FILE_SIZE = -14,
|
||||
PARSER_TC_FILE_SIZE = -15,
|
||||
PARSER_VC_FILE_SIZE = -16,
|
||||
PARSER_SIP_AUTH_DIRECTIVE = -17,
|
||||
PARSER_HASH_FILE = -18,
|
||||
PARSER_HASH_ENCODING = -19,
|
||||
PARSER_SALT_ENCODING = -20,
|
||||
PARSER_LUKS_FILE_SIZE = -21,
|
||||
PARSER_LUKS_MAGIC = -22,
|
||||
PARSER_LUKS_VERSION = -23,
|
||||
PARSER_LUKS_CIPHER_TYPE = -24,
|
||||
PARSER_LUKS_CIPHER_MODE = -25,
|
||||
PARSER_LUKS_HASH_TYPE = -26,
|
||||
PARSER_LUKS_KEY_SIZE = -27,
|
||||
PARSER_LUKS_KEY_DISABLED = -28,
|
||||
PARSER_LUKS_KEY_STRIPES = -29,
|
||||
PARSER_LUKS_HASH_CIPHER = -30,
|
||||
PARSER_HCCAPX_SIGNATURE = -31,
|
||||
PARSER_HCCAPX_VERSION = -32,
|
||||
PARSER_HCCAPX_MESSAGE_PAIR = -33,
|
||||
PARSER_TOKEN_ENCODING = -34,
|
||||
PARSER_TOKEN_LENGTH = -35,
|
||||
PARSER_INSUFFICIENT_ENTROPY = -36,
|
||||
PARSER_UNKNOWN_ERROR = -255
|
||||
|
||||
} parser_rc_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user