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

make -m 21200 more generic (except all supported salt len)

This commit is contained in:
philsmd 2020-03-30 13:53:37 +02:00
parent ddb641b843
commit 4f3165c6ea
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF
3 changed files with 5 additions and 10 deletions

View File

@ -60,8 +60,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
| TOKEN_ATTR_VERIFY_HEX;
token.len_min[1] = 19;
token.len_max[1] = 19;
token.len_min[1] = SALT_MIN;
token.len_max[1] = SALT_MAX;
token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH;
if (hashconfig->opts_type & OPTS_TYPE_ST_HEX)

View File

@ -11,12 +11,12 @@ use warnings;
use Digest::MD5 qw (md5_hex);
use Digest::SHA qw (sha1_hex);
sub module_constraints { [[0, 256], [19, 19], [0, 55], [-1, -1], [-1, -1]] }
sub module_constraints { [[0, 256], [0, 256], [0, 55], [-1, -1], [-1, -1]] }
sub module_generate_hash
{
my $word = shift;
my $salt = random_hex_string (19, 19);
my $salt = shift;
my $digest = md5_hex (sha1_hex ($salt) . md5_hex ($word));

View File

@ -11,18 +11,13 @@ use warnings;
use Digest::MD5 qw (md5_hex);
use Digest::SHA qw (sha1_hex);
sub module_constraints { [[0, 256], [1, 256], [0, 55], [-1, -1], [-1, -1]] }
sub module_constraints { [[0, 256], [0, 256], [0, 55], [0, 55], [0, 55]] }
sub module_generate_hash
{
my $word = shift;
my $salt = shift;
if (length $salt == 0)
{
$salt = random_hex_string (1, 256);
}
my $digest = md5_hex ($salt . sha1_hex ($salt . $word));
my $hash = sprintf ("%s:%s", $digest, $salt);