1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-14 03:39:09 +00:00

Merge pull request #3845 from philsmd/26610_verify_fix

verify test fix for -m 26610 = MetaMask Wallet (short)
This commit is contained in:
Jens Steube 2023-09-05 08:19:08 +02:00 committed by GitHub
commit cc9ed0e24b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,8 +36,29 @@ sub module_generate_hash
my $iv_bin = pack ("H*", $iv);
my $pt = "";
my $pt = "[{\"type\":\"HD Key Tree\",\"data\":{\"mnemonic\":[112,97,121,109,101,110,116,32,117,112,115,101,116,32,109,101,116,97,108,32,99,104,97,112,116,101,114,32,114,117,110,32,97,100,109,105,116,32,109,101,97,115,117,114,101,32,114,101,109,105,110,100,32,115,117,112,112,108,121,32,104,111,112,101,32,101,110,101,109,121,32,104,101,100,103,101,104,111,103],\"numberOfAccounts\":1,\"hdPath\":\"m/44'/60'/0'/0\"}}]";
if (! defined ($ct))
{
$pt = "[{\"type\":\"HD Key Tree\",\"data\":{\"mnemonic\":[112,97,121,109,101,110,116,32,117,112,115,101,116,32,109,101,116,97,108,32,99,104,97,112,116,101,114,32,114,117,110,32,97,100,109,105,116,32,109,101,97,115,117,114,101,32,114,101,109,105,110,100,32,115,117,112,112,108,121,32,104,111,112,101,32,101,110,101,109,121,32,104,101,100,103,101,104,111,103],\"numberOfAccounts\":1,\"hdPath\":\"m/44'/60'/0'/0\"}}]";
}
else # verify / decrypt
{
my $ct_bin = pack ("H*", $ct);
my $aes = Crypt::AuthEnc::GCM->new ("AES", $key, $iv_bin);
$pt = $aes->decrypt_add ($ct_bin);
if ($pt =~ m/^[ -~]*$/) # is_valid_printable_32 ()
{
# ok
}
else
{
$pt = ""; # fake
}
}
$pt = substr ($pt, 0, $ct_len);