Last active
October 27, 2017 20:35
-
-
Save analogist/8408b00a04f35f8114f72e5ead1e1d3e to your computer and use it in GitHub Desktop.
Convert output of hashcat benchmark hashrates (first device) into relative bit strengths on log2 scale, then subtracts off baseline (coded as MD5 here) for complexity comparison between algorithms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| gawk '\ | |
| /^Hashtype/ { $1=""; printf "%s\t",$0 } \ | |
| /^Speed\.Dev\.#1/ { \ | |
| switch ($3) { \ | |
| case "H/s": \ | |
| hashrate = $2; \ | |
| break; \ | |
| case "kH/s": \ | |
| hashrate = $2*1000; \ | |
| break; \ | |
| case "MH/s": \ | |
| hashrate = $2*1000000; \ | |
| break; \ | |
| case "GH/s": \ | |
| hashrate = $2*1000000000; \ | |
| break; \ | |
| default: \ | |
| print "Bad hashrate parsing!"; \ | |
| exit 1; | |
| break; } \ | |
| hashbit = log(hashrate)/log(2); \ | |
| print hashbit }' \ | |
| | gawk '\ | |
| \ | |
| BEGIN { FS="\t"; \ | |
| cutprespaces = "sed \"s/^ *//\"" } \ | |
| { \ | |
| hashtype[NR] = $1; \ | |
| hashbits[NR] = $2; \ | |
| if($1 ~ /^ MD5/) { md5baseline = $2 } \ | |
| }\ | |
| END {\ | |
| for (i=1; i<=NR; i++) { \ | |
| rebasedbits = md5baseline - hashbits[i]; | |
| printf "%s,%.1f",hashtype[i],rebasedbits | cutprespaces; close(cutprespaces); \ | |
| } \ | |
| }' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output and usage:
./convhashcat.sh < 1080ti.txtwith Nvidia GTX 1080 Ti Hashcat Benchmarks