12-30-2014, 04:55 PM
I wrote a little code for you that should solve the problem:
Code:
#!/usr/bin/env perl
use strict;
use warnings;
use Digest::SHA qw (sha1_hex);
use Crypt::CBC;
use Crypt::Rijndael;
my $hc = "\x68\x61\x73\x68\x63\x61\x74\x00";
my $key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
my $iv = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
my $suffix = $ARGV[0];
my $i = 1;
while ($i++)
{
my $cipher = Crypt::CBC->new({
key => $key,
cipher => "Crypt::Rijndael",
iv => $iv,
literal_key => 1,
header => "none",
keysize => 16,
padding => "none",
});
my $pt = $hc . pack ("Q", $i);
my $ct = $cipher->encrypt ($pt);
my $hash = sha1_hex ($ct);
next unless $hash =~ /$suffix$/;
printf "pt: %s\n", unpack ("H*", $pt);
printf "ct: %s\n", unpack ("H*", $ct);
printf "hash: %s\n", $hash;
last;
}
Quote:root@et:~/oclHashcat-1.32# perl sha1aes128date.pl 0402
pt: 68617368636174006d1c010000000000
ct: 381b9a3dd48c5bff7d1791c86375e56e
hash: a0676d214b22e0bc80f4e14e2892dbd42c8f0402
root@et:~/oclHashcat-1.32# perl -e 'print pack ("H*", "68617368636174006d1c010000000000")' | openssl enc -aes-128-cbc -K 00000000000000000000000000000000 -iv 00000000000000000000000000000000 -nopad | sha1sum
a0676d214b22e0bc80f4e14e2892dbd42c8f0402 -