mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 08:08:10 +00:00
Example of a better UTF8 to UTF16LE encoding in unit test. It allows digesting UTF8 encoded password candidates from the shell in passthrough mode
This commit is contained in:
parent
f8ea1d5e78
commit
db6f93b159
@ -9,7 +9,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Digest::MD4 qw (md4_hex);
|
use Digest::MD4 qw (md4_hex);
|
||||||
use Encode;
|
use Text::Iconv;
|
||||||
|
|
||||||
sub module_constraints { [[0, 256], [-1, -1], [0, 27], [-1, -1], [-1, -1]] }
|
sub module_constraints { [[0, 256], [-1, -1], [0, 27], [-1, -1], [-1, -1]] }
|
||||||
|
|
||||||
@ -17,7 +17,9 @@ sub module_generate_hash
|
|||||||
{
|
{
|
||||||
my $word = shift;
|
my $word = shift;
|
||||||
|
|
||||||
my $digest = md4_hex (encode ('UTF-16LE', $word));
|
my $converter = Text::Iconv->new('utf8', 'UTF-16LE');
|
||||||
|
|
||||||
|
my $digest = md4_hex ($converter->convert ($word));
|
||||||
|
|
||||||
return $digest;
|
return $digest;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user