mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 16:18:09 +00:00
Fixed unit tests using 'null' as padding method in Crypt::CBC but actually want to use 'none'
This commit is contained in:
parent
282eb75fe9
commit
057bf48924
@ -67,6 +67,7 @@
|
|||||||
- Fixed too-early execution of some module functions that use non-final values opts_type and opti_type
|
- Fixed too-early execution of some module functions that use non-final values opts_type and opti_type
|
||||||
- Fixed unexpected non-unique salts in multi-hash cracking in Bitcoin/Litecoin wallet.dat module which led to false negatives
|
- Fixed unexpected non-unique salts in multi-hash cracking in Bitcoin/Litecoin wallet.dat module which led to false negatives
|
||||||
- Fixed unit test for -m 3000 by preventing it to generate zero hashes
|
- Fixed unit test for -m 3000 by preventing it to generate zero hashes
|
||||||
|
- Fixed unit tests using 'null' as padding method in Crypt::CBC but actually want to use 'none'
|
||||||
- Fixed vector datatype support in -m 21100 only -P mode and only -a 3 mode were affected
|
- Fixed vector datatype support in -m 21100 only -P mode and only -a 3 mode were affected
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -48,7 +48,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 16,
|
keysize => 16,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $cipher2 = Crypt::CBC->new ({
|
my $cipher2 = Crypt::CBC->new ({
|
||||||
@ -58,7 +58,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 16,
|
keysize => 16,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $encdata;
|
my $encdata;
|
||||||
|
@ -48,7 +48,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 32,
|
keysize => 32,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $cipher2 = Crypt::CBC->new ({
|
my $cipher2 = Crypt::CBC->new ({
|
||||||
@ -58,7 +58,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 32,
|
keysize => 32,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $encdata;
|
my $encdata;
|
||||||
|
@ -65,7 +65,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 16,
|
keysize => 16,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $data = $aes->encrypt ($data);
|
my $data = $aes->encrypt ($data);
|
||||||
|
@ -190,7 +190,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p2 = Crypt::ECB->new ({
|
my $p2 = Crypt::ECB->new ({
|
||||||
@ -199,7 +199,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p3 = Crypt::ECB->new ({
|
my $p3 = Crypt::ECB->new ({
|
||||||
@ -208,7 +208,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
# let's compute a 3DES-EDE-CBC decryption
|
# let's compute a 3DES-EDE-CBC decryption
|
||||||
@ -256,7 +256,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 32,
|
keysize => 32,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $expected_cleartext = $aes->decrypt ($cipher);
|
my $expected_cleartext = $aes->decrypt ($cipher);
|
||||||
@ -288,7 +288,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p2 = Crypt::ECB->new ({
|
my $p2 = Crypt::ECB->new ({
|
||||||
@ -297,7 +297,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p3 = Crypt::ECB->new ({
|
my $p3 = Crypt::ECB->new ({
|
||||||
@ -306,7 +306,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
# let's compute a 3DES-EDE-CBC encryption
|
# let's compute a 3DES-EDE-CBC encryption
|
||||||
@ -342,7 +342,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 32,
|
keysize => 32,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
$cipher = $aes->encrypt ($cleartext);
|
$cipher = $aes->encrypt ($cleartext);
|
||||||
|
@ -192,7 +192,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p2 = Crypt::ECB->new ({
|
my $p2 = Crypt::ECB->new ({
|
||||||
@ -201,7 +201,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p3 = Crypt::ECB->new ({
|
my $p3 = Crypt::ECB->new ({
|
||||||
@ -210,7 +210,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
# let's compute a 3DES-EDE-CBC decryption
|
# let's compute a 3DES-EDE-CBC decryption
|
||||||
@ -258,7 +258,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 32,
|
keysize => 32,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $expected_cleartext = $aes->decrypt ($cipher);
|
my $expected_cleartext = $aes->decrypt ($cipher);
|
||||||
@ -290,7 +290,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p2 = Crypt::ECB->new ({
|
my $p2 = Crypt::ECB->new ({
|
||||||
@ -299,7 +299,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $p3 = Crypt::ECB->new ({
|
my $p3 = Crypt::ECB->new ({
|
||||||
@ -308,7 +308,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 8,
|
keysize => 8,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
# let's compute a 3DES-EDE-CBC encryption
|
# let's compute a 3DES-EDE-CBC encryption
|
||||||
@ -344,7 +344,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 32,
|
keysize => 32,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
$cipher = $aes->encrypt ($cleartext);
|
$cipher = $aes->encrypt ($cleartext);
|
||||||
|
@ -33,7 +33,7 @@ sub module_generate_hash
|
|||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
keysize => 32,
|
keysize => 32,
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
if (defined $plain_bin)
|
if (defined $plain_bin)
|
||||||
|
@ -44,7 +44,7 @@ sub module_generate_hash
|
|||||||
cipher => "DES",
|
cipher => "DES",
|
||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $des2 = Crypt::CBC->new ({
|
my $des2 = Crypt::CBC->new ({
|
||||||
@ -53,7 +53,7 @@ sub module_generate_hash
|
|||||||
cipher => "DES",
|
cipher => "DES",
|
||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $des3 = Crypt::CBC->new ({
|
my $des3 = Crypt::CBC->new ({
|
||||||
@ -62,7 +62,7 @@ sub module_generate_hash
|
|||||||
cipher => "DES",
|
cipher => "DES",
|
||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
padding => "null",
|
padding => "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
my $data_encrypted = "";
|
my $data_encrypted = "";
|
||||||
|
@ -75,7 +75,7 @@ sub module_generate_hash
|
|||||||
keysize => 16,
|
keysize => 16,
|
||||||
literal_key => 1,
|
literal_key => 1,
|
||||||
header => "none",
|
header => "none",
|
||||||
padding => "null"
|
padding => "none"
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($is_decrypt == 1)
|
if ($is_decrypt == 1)
|
||||||
|
@ -375,7 +375,7 @@ sub module_generate_hash
|
|||||||
-keysize => 16,
|
-keysize => 16,
|
||||||
-literal_key => 1,
|
-literal_key => 1,
|
||||||
-header => 'none',
|
-header => 'none',
|
||||||
-padding => 'null'
|
-padding => 'none'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (defined ($data))
|
if (defined ($data))
|
||||||
|
Loading…
Reference in New Issue
Block a user