1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Add missing unit test and docs entry for -m 21420

This commit is contained in:
Jens Steube 2021-12-30 09:04:26 +01:00
parent 6975cc0903
commit 8867da9122
3 changed files with 47 additions and 0 deletions

View File

@ -6,6 +6,7 @@
- Added hash-mode: Exodus Desktop Wallet (scrypt)
- Added hash-mode: Teamspeak 3 (channel hash)
- Added hash-mode: sha256($salt.sha256_bin($pass))
##
## Features

View File

@ -110,6 +110,7 @@ NVIDIA GPUs require "NVIDIA Driver" (440.64 or later) and "CUDA Toolkit" (9.0 or
- sha256($salt.$pass)
- sha256($salt.$pass.$salt)
- sha256($salt.sha256($pass))
- sha256($salt.sha256_bin($pass))
- sha256($salt.utf16le($pass))
- sha256(md5($pass))
- sha256(sha256($pass).$salt)

View File

@ -0,0 +1,45 @@
#!/usr/bin/env perl
##
## Author......: See docs/credits.txt
## License.....: MIT
##
use strict;
use warnings;
use Digest::SHA qw (sha256);
sub module_constraints { [[0, 256], [0, 256], [-1, -1], [-1, -1], [-1, -1]] }
sub module_generate_hash
{
my $word = shift;
my $salt = shift;
print unpack ("H*", sha256 ($word)), "\n";
my $digest = sha256 ($salt . sha256 ($word));
my $hash = sprintf ("%s:%s", unpack ("H*", $digest), $salt);
return $hash;
}
sub module_verify_hash
{
my $line = shift;
my ($digest, $salt, $word) = split (':', $line);
return unless defined $digest;
return unless defined $salt;
return unless defined $word;
my $word_packed = pack_if_HEX_notation ($word);
my $new_hash = module_generate_hash ($word_packed, $salt);
return ($new_hash, $word);
}
1;