mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-25 09:28:20 +00:00
verify test fix for -m 2661- = MetaMask Wallet (short)
This commit is contained in:
parent
91095845b9
commit
dd77925cdd
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user