1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-21 23:58:07 +00:00

Update m31900-pure.cl

extend comp to reduce false positives
This commit is contained in:
red 2023-08-29 21:45:18 +02:00 committed by GitHub
parent 2cc49d2e87
commit 0bc3bb3ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ typedef struct pbkdf2_sha512_aes_cbc
u32 salt_buf[64];
u32 iv_buf[4];
u32 iv_len;
u32 ct_buf[4];
u32 ct_buf[8];
u32 ct_len;
} pbkdf2_sha512_aes_cbc_t;
@ -413,16 +413,20 @@ KERNEL_FQ void m31900_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha512_tmp_t, pbkdf2_sh
// ct
u32 ct_buf[4];
u32 ct_buf[8];
ct_buf[0] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[0];
ct_buf[1] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[1];
ct_buf[2] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[2];
ct_buf[3] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[3];
ct_buf[4] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[4];
ct_buf[5] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[5];
ct_buf[6] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[6];
ct_buf[7] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[7];
// decrypt first block
u32 pt_buf[4] = { 0 };
u32 pt_buf[8] = { 0 };
AES256_decrypt (ks, ct_buf, pt_buf, s_td0, s_td1, s_td2, s_td3, s_td4);
@ -431,13 +435,29 @@ KERNEL_FQ void m31900_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha512_tmp_t, pbkdf2_sh
pt_buf[2] ^= iv_buf[2];
pt_buf[3] ^= iv_buf[3];
const int correct = is_valid_printable_32 (pt_buf[0])
+ is_valid_printable_32 (pt_buf[1])
+ is_valid_printable_32 (pt_buf[2])
+ is_valid_printable_32 (pt_buf[3]);
const int correct_b1 = is_valid_printable_32 (pt_buf[0])
+ is_valid_printable_32 (pt_buf[1])
+ is_valid_printable_32 (pt_buf[2])
+ is_valid_printable_32 (pt_buf[3]);
if (correct != 4) return;
if (correct_b1 != 4) return;
// proceed with second block to further reduce false-positives
AES256_decrypt (ks, ct_buf+4, pt_buf+4, s_td0, s_td1, s_td2, s_td3, s_td4);
pt_buf[4] ^= ct_buf[0];
pt_buf[5] ^= ct_buf[1];
pt_buf[6] ^= ct_buf[2];
pt_buf[7] ^= ct_buf[3];
const int correct_b2 = is_valid_printable_32 (pt_buf[4])
+ is_valid_printable_32 (pt_buf[5])
+ is_valid_printable_32 (pt_buf[6])
+ is_valid_printable_32 (pt_buf[7]);
if (correct_b2 != 4) return;
const u32 r0 = ct_buf[0];
const u32 r1 = ct_buf[1];
const u32 r2 = ct_buf[2];