Hashing Performance: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
(Created page with "which hashing algo to use? tested on atehena 1. list off all alsos that open ssl has. <pre> md5 mdc2 rmd160 sha sha1 sha224 sha256 sha384 sha512 </pre> 2. creat...")
 
No edit summary
Line 38: Line 38:


3. for each method calculate the mean and stddev
3. for each method calculate the mean and stddev
created a script to gets stats (it's still in flux):
stats.pl
<pre>
#!/usr/bin/perl
use Statistics::Basic::StdDev;
use Statistics::Basic qw(:all);
use Tie::File;
tie @array, 'Tie::File', "just-sha512" or die "failed to tie file ";
my $median = median(@array);
my $mean  = mean(@array);
my $variance = variance( @array );
my $stddev  = stddev(  @array );
#print "Median: $median\n";
#print "Mean $mean\n";
#print "Variance $variance\n";
#print "Stddev $stddev\n";
# from gnuplot docs:
# whisker plot: x box_min whisker_min whisker_high box_high
#
my $box_min      = $mean - $stddev;
my $box_high      = $mean + $stddev;
my $whisker_min  = $mean + ( 2 * stddev ) ;
my $whisker_high  = $mean - ( 2 * stddev ) ;
print "$mean $box_min $whisker_min $whisker_high $box_high\n";
</pre>

Revision as of 22:23, 28 July 2013

which hashing algo to use?

tested on atehena

1. list off all alsos that open ssl has.

md5
mdc2  
rmd160
sha   
sha1  
sha224
sha256
sha384
sha512

2. create a shell script that times the hashing of a file 100 times for each method, then shuffle that file

sample:

/usr/bin/time openssl dgst -md5 ../smartOS-latest-USB.img.bz2 2>out-md5-15
/usr/bin/time openssl dgst -sha ../smartOS-latest-USB.img.bz2 2>out-sha-16
/usr/bin/time openssl dgst -sha384 ../smartOS-latest-USB.img.bz2 2>out-sha384-17
/usr/bin/time openssl dgst -sha224 ../smartOS-latest-USB.img.bz2 2>out-sha224-18
/usr/bin/time openssl dgst -mdc2 ../smartOS-latest-USB.img.bz2 2>out-mdc2-19
/usr/bin/time openssl dgst -sha256 ../smartOS-latest-USB.img.bz2 2>out-sha256-20
/usr/bin/time openssl dgst -sha256 ../smartOS-latest-USB.img.bz2 2>out-sha256-21
/usr/bin/time openssl dgst -sha ../smartOS-latest-USB.img.bz2 2>out-sha-23
/usr/bin/time openssl dgst -sha384 ../smartOS-latest-USB.img.bz2 2>out-sha384-24
/usr/bin/time openssl dgst -md5 ../smartOS-latest-USB.img.bz2 2>out-md5-25
/usr/bin/time openssl dgst -sha512 ../smartOS-latest-USB.img.bz2 2>out-sha512-26
/usr/bin/time openssl dgst -sha224 ../smartOS-latest-USB.img.bz2 2>out-sha224-27
/usr/bin/time openssl dgst -mdc2 ../smartOS-latest-USB.img.bz2 2>out-mdc2-28
/usr/bin/time openssl dgst -sha1 ../smartOS-latest-USB.img.bz2 2>out-sha1-29

3. for each method calculate the mean and stddev

created a script to gets stats (it's still in flux):

stats.pl

#!/usr/bin/perl

use Statistics::Basic::StdDev;

use Statistics::Basic qw(:all);

use Tie::File;

tie @array, 'Tie::File', "just-sha512" or die "failed to tie file ";

my $median = median(@array);
my $mean   = mean(@array);
my $variance = variance( @array );
my $stddev   = stddev(   @array );

#print "Median: $median\n";
#print "Mean $mean\n";
#print "Variance $variance\n";
#print "Stddev $stddev\n";

# from gnuplot docs:
# whisker plot: x box_min whisker_min whisker_high box_high
#
my $box_min       = $mean - $stddev;
my $box_high      = $mean + $stddev;
my $whisker_min   = $mean + ( 2 * stddev ) ;
my $whisker_high  = $mean - ( 2 * stddev ) ;

print "$mean $box_min $whisker_min $whisker_high $box_high\n";