/usr/share/doc/crack-common/examples/Dictstats.pl is in crack-common 5.0a-9.3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | #!/usr/bin/perl
###
# This program was written by and is copyright Alec Muffett 1991,
# 1992, 1993, 1994, 1995, and 1996, and is provided as part of the
# Crack v5.0 Password Cracking package.
#
# The copyright holder disclaims all responsibility or liability with
# respect to its usage or its effect upon hardware or computer
# systems, and maintains copyright as set out in the "LICENCE"
# document which accompanies distributions of Crack v5.0 and upwards.
###
# number of crypts()/second for one CPU
#$crypts_per_second = 1710; # 486dx2/66 + 128Kb cache, libdes, gcc-2.7.2
$crypts_per_second = 3430; # Pentium P75, libdes, gcc-2.7.2
#$crypts_per_second = 1; # Sparcstation 10/40, libdes, gcc-2.7.2
#$crypts_per_second = 1; # Ultrastation 1, libdes, gcc-2.7.2
# gcc flags: gcc -O4 -fomit-frame-pointer -funroll-loops
$one_kb = 1024;
$one_mb = 1024 ** 2;
$one_gb = 1024 ** 3;
$one_tb = 1024 ** 4;
sub Expand {
($seconds) = @_;
$retval = "";
$years = int($seconds/(365 * 24 * 60 * 60));
$seconds -= ($years * (365 * 24 * 60 * 60));
if ($years) { $retval .= $years . "y" };
$days = int($seconds/(24 * 60 * 60));
$seconds -= ($days * (24 * 60 * 60));
if ($days) { $retval .= $days . "d" };
return ($retval) if ($years >= 1);
$hours = int($seconds/(60 * 60));
$seconds -= ($hours * (60 * 60));
if ($hours) { $retval .= $hours . "h" };
return ($retval) if ($days >= 1);
$minutes = int($seconds/60);
$seconds -= ($minutes * 60);
if ($minutes) { $retval .= $minutes . "m" };
$retval .= $seconds . "s";
return ($retval);
}
sub Storage
{
$bytes = shift;
if ($bytes > $one_tb)
{
sprintf("%.2fTb", ($bytes / $one_tb));
}
elsif ($bytes > $one_gb)
{
sprintf("%.2fGb", ($bytes / $one_gb));
}
elsif ($bytes > $one_mb)
{
sprintf("%.2fMb", ($bytes / $one_mb));
}
elsif ($bytes > $one_kb)
{
sprintf("%.2fKb", ($bytes / $one_kb));
}
else
{
sprintf("%d bytes", $bytes);
}
}
print "For a CPU capable of $crypts_per_second crypts per second:\n\n";
foreach $pwlen (1..8)
{
print " password length=$pwlen\n";
foreach $setsize (10, 26, 36, 52, 62, 90)
{
$dwords = $setsize ** $pwlen;
$exhaust = int($dwords / $crypts_per_second);
$exhaust = &Expand($exhaust);
$storage = &Storage(($pwlen + 1) * $dwords);
printf "\tfor %d characters, words=%g\n", $setsize, $dwords;
printf "\t\texhaustive storage=%s (without compression)\n", $storage;
printf "\t\texhaustive search=%s (in cpu-years)\n", $exhaust;
}
print "\n";
}
|