Hashcat benchmark comparator
#1
Lightbulb 
I recently developed a mini-suite of tools to process and compare hashcat benchmarks. The original intent was comparing the performance between using CUDA directly and using OpenCL.

The code is available on GitHub if anyone wants to use or review it/laugh at my code. It's written mostly in python, to parse, process and compare the hashcat results, and shell/bash, a single script to generate the benchmarks.

While doing the tests, I found some interesting diffs between the git version (v6.2.6-1320-g4a6b538b4+) and the release version on the Arch Linux repository (v6.2.6).

Comparing performance on the CUDA backend of both versions, where difference >50%:

Code:
{
  "old": [
    "LastPass + LastPass sniffed -> 19167.27%",
    "PKZIP (Compressed) -> 374.74%"
  ],
  "new": [
    "AIX {ssha1} -> 103.98%",
    "Cisco-IOS $9$ (scrypt) -> 60.05%",
    "PDF 1.4 - 1.6 (Acrobat 5 - 8) -> 57.46%",
    "Blockchain, My Wallet -> 192.90%",
    "DPAPI masterkey file v2 (context 3) -> 90.91%",
    "QNX /etc/shadow (MD5) -> 57.53%",
    "WPA-PMK-PMKID+EAPOL -> 464.19%",
    "Mozilla key3.db -> 287.52%",
    "NetNTLMv1 / NetNTLMv1+ESS (NT) -> 580.83%",
    "NetNTLMv2 (NT) -> 410.81%",
    "Flask Session Cookie ($salt.$salt.$pass) -> 263.46%"
  ]
}

This may be subject to quirks of my GPU (Nvidia GTX 1660), CPU (AMD Ryzen 7 3700X) and temperature fluctuations (the tests were run on my personal desktop). To normalize the data, I ran 5 sequential benchmarks for each hash type, with the "--benchmark-all" flag.

The full results are in a gist here: https://gist.github.com/whoisroot/5498a5...b8bc6646d4
Reply
#2
Very cool! Something like this has been needed for a while!
~
Reply
#3
Very interesting indeed! How about original intent : CUDA vs OpenCL? On the latest HC v7

P.S. Yes, confess, I'm lazy to run it myself :-)
Reply
#4
Wow, this is very useful. I am surprised to see there are such huge differences.
I am interested to see the comparison of CUDA and OpenCL.
Reply
#5
Sorry, I haven't got to check the forum in a while...
I had already uploaded the full diff between OpenCL vs CUDA in a gist a while ago, but forgot to post it here too... 😬

I took the opportunity to add a "big diffs" file to the gist:
https://gist.github.com/whoisroot/315d5b...diffs-json

Unfortunately, I don't remember which version of hashcat I used at the time.

Some highlights:

Code:
{
  "OpenCL": [
    {
      "name": "STDOUT",
      "diff": 0.7172924710406956,
      "raw_diff": 26447672015908.0,
      "pretty_winner": "63.32 TH/s",
      "pretty_diff": "26.45 TH/s",
      "percent": "71.73%"
    },
    {
      "name": "AIX {ssha1}",
      "diff": 1.125265167893867,
      "raw_diff": 16471779.5,
      "pretty_winner": "31.11 MH/s",
      "pretty_diff": "16.47 MH/s",
      "percent": "112.53%"
    },
    {
      "name": "Cisco-IOS $9$ (scrypt)",
      "diff": 1.6008820935019115,
      "raw_diff": 21778.4,
      "pretty_winner": "35.38 kH/s",
      "pretty_diff": "21.78 kH/s",
      "percent": "160.09%"
    },
    {
      "name": "Blockchain, My Wallet",
      "diff": 2.1599963859979043,
      "raw_diff": 37856693.9,
      "pretty_winner": "55.38 MH/s",
      "pretty_diff": "37.86 MH/s",
      "percent": "216.00%"
    },
    {
      "name": "QNX /etc/shadow (MD5)",
      "diff": 0.7236587567202399,
      "raw_diff": 8577358.45,
      "pretty_winner": "20.43 MH/s",
      "pretty_diff": "8.58 MH/s",
      "percent": "72.37%"
    },
    {
      "name": "Electrum Wallet (Salt-Type 4)",
      "diff": 0.5016247007102366,
      "raw_diff": 118266.29999999999,
      "pretty_winner": "354.03 kH/s",
      "pretty_diff": "118.27 kH/s",
      "percent": "50.16%"
    },
    {
      "name": "Electrum Wallet (Salt-Type 5)",
      "diff": 0.5021938965227994,
      "raw_diff": 116146.40000000002,
      "pretty_winner": "347.42 kH/s",
      "pretty_diff": "116.15 kH/s",
      "percent": "50.22%"
    },
    {
      "name": "WPA-PMK-PMKID+EAPOL",
      "diff": 6.779777622116611,
      "raw_diff": 173105790.8,
      "pretty_winner": "198.64 MH/s",
      "pretty_diff": "173.11 MH/s",
      "percent": "677.98%"
    },
    {
      "name": "NetNTLMv1 / NetNTLMv1+ESS (NT)",
      "diff": 5.684484700050565,
      "raw_diff": 143159715.45,
      "pretty_winner": "168.34 MH/s",
      "pretty_diff": "143.16 MH/s",
      "percent": "568.45%"
    },
    {
      "name": "NetNTLMv2 (NT)",
      "diff": 6.191252667871688,
      "raw_diff": 153509491.0,
      "pretty_winner": "178.30 MH/s",
      "pretty_diff": "153.51 MH/s",
      "percent": "619.13%"
    },
    {
      "name": "Bitcoin WIF private key (P2PKH), uncompressed",
      "diff": 0.9885051217485998,
      "raw_diff": 47202196413.05,
      "pretty_winner": "94.95 GH/s",
      "pretty_diff": "47.20 GH/s",
      "percent": "98.85%"
    },
    {
      "name": "Bitcoin WIF private key (P2WPKH, Bech32), uncompressed",
      "diff": 1.0800308837019954,
      "raw_diff": 51718160480.7,
      "pretty_winner": "99.60 GH/s",
      "pretty_diff": "51.72 GH/s",
      "percent": "108.00%"
    },
    {
      "name": "Bitcoin WIF private key (P2SH(P2WPKH)), uncompressed",
      "diff": 0.9687765513812707,
      "raw_diff": 44857494433.350006,
      "pretty_winner": "91.16 GH/s",
      "pretty_diff": "44.86 GH/s",
      "percent": "96.88%"
    }
  ],
  "CUDA": [
    {
      "name": "LastPass + LastPass sniffed",
      "diff": 187.26334657494428,
      "raw_diff": 1932745.0,
      "pretty_winner": "1.94 MH/s",
      "pretty_diff": "1.93 MH/s",
      "percent": "18726.33%"
    },
    {
      "name": "MS Office <= 2003 $3/$4, SHA1 + RC4",
      "diff": 0.7972561609779212,
      "raw_diff": 147966117.0,
      "pretty_winner": "333.56 MH/s",
      "pretty_diff": "147.97 MH/s",
      "percent": "79.73%"
    },
    {
      "name": "PKZIP (Compressed)",
      "diff": 2.8034622965266696,
      "raw_diff": 2421847904.75,
      "pretty_winner": "3.29 GH/s",
      "pretty_diff": "2.42 GH/s",
      "percent": "280.35%"
    },
    {
      "name": "sha1($salt1.$pass.$salt2)",
      "diff": 0.9760676912521096,
      "raw_diff": 293999029.95,
      "pretty_winner": "595.21 MH/s",
      "pretty_diff": "294.00 MH/s",
      "percent": "97.61%"
    },
    {
      "name": "Ruby on Rails Restful-Authentication",
      "diff": 1.5888865052849765,
      "raw_diff": 39817642.0,
      "pretty_winner": "64.88 MH/s",
      "pretty_diff": "39.82 MH/s",
      "percent": "158.89%"
    },
    {
      "name": "MultiBit HD (scrypt)",
      "diff": 0.8743543388429753,
      "raw_diff": 338.55,
      "pretty_winner": "725.75 H/s",
      "pretty_diff": "338.55 H/s",
      "percent": "87.44%"
    },
    {
      "name": "bcrypt(md5($pass)) / bcryptmd5",
      "diff": 0.5835459083250665,
      "raw_diff": 7411.85,
      "pretty_winner": "20.11 kH/s",
      "pretty_diff": "7.41 kH/s",
      "percent": "58.35%"
    },
    {
      "name": "MurmurHash",
      "diff": 0.7760598502998748,
      "raw_diff": 49842602905.45,
      "pretty_winner": "114.07 GH/s",
      "pretty_diff": "49.84 GH/s",
      "percent": "77.61%"
    },
    {
      "name": "bcrypt(sha1($pass)) / bcryptsha1",
      "diff": 0.5883675078864354,
      "raw_diff": 7460.5,
      "pretty_winner": "20.14 kH/s",
      "pretty_diff": "7.46 kH/s",
      "percent": "58.84%"
    },
    {
      "name": "MultiBit Classic .wallet (scrypt)",
      "diff": 0.9186046511627908,
      "raw_diff": 347.6,
      "pretty_winner": "726.00 H/s",
      "pretty_diff": "347.60 H/s",
      "percent": "91.86%"
    },
    {
      "name": "MurmurHash3",
      "diff": 0.6104491642946799,
      "raw_diff": 36079415415.85,
      "pretty_winner": "95.18 GH/s",
      "pretty_diff": "36.08 GH/s",
      "percent": "61.04%"
    },
    {
      "name": "Exodus Desktop Wallet (scrypt)",
      "diff": 0.8403141361256545,
      "raw_diff": 321.0,
      "pretty_winner": "703.00 H/s",
      "pretty_diff": "321.00 H/s",
      "percent": "84.03%"
    },
    {
      "name": "bcrypt(sha512($pass)) / bcryptsha512",
      "diff": 0.656686626746507,
      "raw_diff": 65.8,
      "pretty_winner": "166.00 H/s",
      "pretty_diff": "65.80 H/s",
      "percent": "65.67%"
    }
  ]
}
Reply
#6
About running the benchmarks again with the newer version, it will take a while... My "baseline" is 5 full benchmarks, one after another, for each version.

I use hashcat mostly for fun, and I just got a 3D printer, so my electricity costs are already high enough, haha.

If someone who uses it "more professionally" wants to give it a go, it would be more than welcomed!!

PS: From the numbers on these benchmarks I posted, something was DEFINITELY wrong with the LastPass mode, hahaha. I hope that was fixed on the newer version.
Reply
#7
Ok ok, I ran the short benchmarks, 5 runs of CUDA vs OpenCL, but I had a few slow-downs due to memory usage because I was running them while GNOME was active (no other programs open). These slow-downs affected both the CUDA and OpenCL benchmarks, but this test was not very "scientific" and not done in a "controlled environment" at all, so take them with a grain of salt...

Here are the most significant (>25%) differences:

Code:
{
  "CUDA": {
    "3200": {
      "name": "bcrypt $2*$, Blowfish (Unix)",
      "winner": "hashcat-7.1.2_CUDA_short/hashcat-7.1.2_CUDA_short.json",
      "diff": 0.5147074047235245,
      "raw_diff": 6960.799999999999,
      "pretty_winner": "20.48 kH/s",
      "pretty_diff": "6.96 kH/s",
      "percent": "51.47%"
    }
  },
  "OpenCL": {
    "1500": {
      "name": "descrypt, DES (Unix), Traditional DES",
      "winner": "hashcat-7.1.2_OpenCL_short/hashcat-7.1.2_OpenCL_short.json",
      "diff": 0.41465526166638833,
      "raw_diff": 212014724.40000004,
      "pretty_winner": "723.32 MH/s",
      "pretty_diff": "212.01 MH/s",
      "percent": "41.47%"
    },
    "1800": {
      "name": "sha512crypt $6$, SHA512 (Unix)",
      "winner": "hashcat-7.1.2_OpenCL_short/hashcat-7.1.2_OpenCL_short.json",
      "diff": 0.29825885050210843,
      "raw_diff": 20398.399999999994,
      "pretty_winner": "88.79 kH/s",
      "pretty_diff": "20.40 kH/s",
      "percent": "29.83%"
    },
    "17200": {
      "name": "PKZIP (Compressed)",
      "winner": "hashcat-7.1.2_OpenCL_short/hashcat-7.1.2_OpenCL_short.json",
      "diff": 0.49852851918197083,
      "raw_diff": 563290431.0,
      "pretty_winner": "1.69 GH/s",
      "pretty_diff": "563.29 MH/s",
      "percent": "49.85%"
    },
    "15700": {
      "name": "Ethereum Wallet, SCRYPT",
      "winner": "hashcat-7.1.2_OpenCL_short/hashcat-7.1.2_OpenCL_short.json",
      "diff": 0.2857142857142858,
      "raw_diff": 0.40000000000000013,
      "pretty_winner": "1.80 H/s",
      "pretty_diff": "0.40 H/s",
      "percent": "28.57%"
    }
  }
}

From the 107 hash modes ran, only these 5 were "significant" enough.

I hope someone with a better setup run the full benchmark later. I'll leave that to the community, hahaha.

The full results of the short benchmark are available here:
https://gist.github.com/whoisroot/c5db3d...0628d78e78
Reply
#8
Also, I was looking through the logs, something appears to be borked on the 17220 mode ("PKZIP (Compressed Multi-File)"):


OpenCL:

Code:
1 error generated.
clCompileProgram(): CL_COMPILE_PROGRAM_FAILURE

* Device #1: Kernel /usr/share/hashcat/OpenCL/m17220_a3-pure.cl build failed.

<kernel>:93:10: fatal error: '/usr/share/hashcat/OpenCL/inc_checksum_crc32.cl' file not found
#include M2S(INCLUDE_PATH/inc_checksum_crc32.cl)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<built-in>:4:16: note: expanded from here
#define M2S(x) XM2S(x)
              ^~~~~~~
<built-in>:3:17: note: expanded from here
#define XM2S(x) #x
                ^~
<scratch space>:7:1: note: expanded from here
"/usr/share/hashcat/OpenCL/inc_checksum_crc32.cl"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CUDA

Code:
nvrtcCompileProgram(): NVRTC_ERROR_COMPILATION

* Device #1: Kernel /usr/share/hashcat/OpenCL/m17220_a3-pure.cl build failed.

* Device #1: Kernel /usr/share/hashcat/OpenCL/m17220_a3-pure.cl build failed.

main_kernel(93): catastrophic error: cannot open source file "/usr/share/hashcat/OpenCL/inc_checksum_crc32.cl"
  #include M2S(INCLUDE_PATH/inc_checksum_crc32.cl)
                                                  ^

1 catastrophic error detected in the compilation of "main_kernel".
Compilation terminated.

Removing the "32" from the CRC import fixes it.
Reply