From 2b80abde6dfe8208b960d83ff73fc530648f4ccb Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 27 Feb 2023 15:32:59 +0100 Subject: [PATCH] add comments on possible improvements --- OpenCL/m26610-pure.cl | 1 + tools/metamask2hashcat.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/OpenCL/m26610-pure.cl b/OpenCL/m26610-pure.cl index f23454824..1b3827ba7 100644 --- a/OpenCL/m26610-pure.cl +++ b/OpenCL/m26610-pure.cl @@ -359,6 +359,7 @@ KERNEL_FQ void m26610_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha256_tmp_t, pbkdf2_sh u32 pt[4] = { 0 }; // we try to decrypt the ciphertext + // TODO this can be moved to a separate decryption function in inc_cipher_aes-gcm.cl AES_GCM_inc32(J0); // the first ctr is used to compute the tag, only the second is used for decryption: https://en.wikipedia.org/wiki/Galois/Counter_Mode#/media/File:GCM-Galois_Counter_Mode_with_IV.svg AES_GCM_GCTR (key, J0, ct, 16, pt, s_te0, s_te1, s_te2, s_te3, s_te4); // decrypt the ciphertext diff --git a/tools/metamask2hashcat.py b/tools/metamask2hashcat.py index df1ca0a41..93b9636e2 100755 --- a/tools/metamask2hashcat.py +++ b/tools/metamask2hashcat.py @@ -27,7 +27,11 @@ def metamask_parser(file, shortdata): if((len(j['data']) > 3000) or shortdata): print("! Data too long, we limit it to 64 bytes, this hash can only be used with m26610!") data_bin = base64.b64decode(j['data']) + # TODO limit data to 16 bytes, we only check the first block of data, so we don't need more data. + # The use of smaller buffers should speedup the attack. + # Still the pbkdf 10k iter will be taking the most time by far probably. j['data'] = base64.b64encode(data_bin[0:64]).decode("ascii") + print('$metamask-short$' + j['salt'] + '$' + j['iv'] + '$' + j['data']) else: print('$metamask$' + j['salt'] + '$' + j['iv'] + '$' + j['data'])