1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-08-01 19:38:26 +00:00

Fixed a1 kernel error, Added perl test-unit. All unit tests passed.

This commit is contained in:
root 2025-07-29 08:21:39 -07:00
parent 47beaf4a6e
commit 64278babc0
2 changed files with 55 additions and 5 deletions

View File

@ -97,9 +97,12 @@ KERNEL_FQ void m22800_mxx (KERN_ATTR_BASIC ())
// Update with salt
md5_update (&ctx, s, salt_len);
// Update with the password combination
md5_update (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
// Update with the password combination using global functions
md5_update_global (&ctx, pws[gid].i, pws[gid].pw_len);
md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
// Update with the hexadecimal MD5 result
u32 w0[4];
u32 w1[4];
u32 w2[4];
@ -224,11 +227,14 @@ KERNEL_FQ void m22800_sxx (KERN_ATTR_BASIC ())
md5_init (&ctx);
// Update with salt
// Update with salt
md5_update (&ctx, s, salt_len);
// Update with the password combination
md5_update (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
// Update with the password combination
md5_update_global (&ctx, pws[gid].i, pws[gid].pw_len);
md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
// Update with the hexadecimal MD5 result
u32 w0[4];
u32 w1[4];
u32 w2[4];

View File

@ -0,0 +1,44 @@
#!/usr/bin/env perl
##
## Author......: See docs/credits.txt
## License.....: MIT
##
use strict;
use warnings;
use Digest::MD5 qw (md5_hex);
sub module_constraints { [[0, 256], [0, 223], [0, 55], [0, 23], [-1, -1]] }
sub module_generate_hash
{
my $word = shift;
my $salt = shift;
my $digest = md5_hex ($salt . $word . md5_hex ($word));
my $hash = sprintf ("%s:%s", $digest, $salt);
return $hash;
}
sub module_verify_hash
{
my $line = shift;
my ($hash, $salt, $word) = split (':', $line);
return unless defined $hash;
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;