1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 06:38:11 +00:00

verify test fix for -m 2661- = MetaMask Wallet (short)

This commit is contained in:
philsmd 2023-08-19 11:54:49 +02:00
parent 91095845b9
commit dd77925cdd
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF

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);