This project was originally a part of a university assessment for the CS4097 Security course at the University of Aberdeen. The goal of that assessment was accelerating dictionary cracking of password hashes created using the SHA-512 hashing algorithm.
- Intel® oneAPI compiler*
- (optional) OpenSSL
* To run on Nvidia or AMD GPUS an open source plugin by Codeplay® is needed
The project uses CMake for build file generation as such the files can be
generated by running:
cmake -Bbuild -H. -DCMAKE_CXX_COMPILER=<Compiler> -D <Vendor name>_GPU=ON
Where:
<Compiler>
is a valid Intel SYCL compiler (clang
oricpx
)<Vendor name>
is a valid GPU vendor (NVIDIA
,AMD
orINTEL
)(not mutually exclusive)
Important
If the chosen vendors include NVIDIA and/or AMD the target architectures can
be specified via -D NVIDIA_ARCH=<Architecture>
and/or
-D AMD_ARCH=<Architecture>
Caution
Due to personal access to hardware only the NVIDIA sm_86 option has been tested
For troubleshooting/compatibility 2 more CMake options are available
CHECK_CORRECTNESS
and USE_GPU
. Both of them are booleans set to true by
default. Toggling the first one disables OpenSSL dependency. Toggling the
second one disables GPU acceleration and forces a CPU fallback.
After the build files have been generated the project can be built using:
cmake --build build --target all
After building the program can be run, by executing the GPU_SHA512
executable to see available modes and required arguments.
As part of the assessment the GPU vs CPU performance has been compared for increasing dictionary lengths. The data for the comparison was generated using a system equipped with: AMD Ryzen 7 2700, 16 GB of RAM and an NVIDIA GeForce RTX 3060 Ti Lite Hash Rate. The resulting data is visible in the plot below
- Hashing payload is limited to strings with maximum length of 111
- There is no input paging. As such the program will try to upload the whole input file to VRAM
- There was no exploration of better work group sizing, and the program relies on default splitting